Submission #1124798

#TimeUsernameProblemLanguageResultExecution timeMemory
1124798owoovo콤보 (IOI18_combo)C++20
Compilation error
0 ms0 KiB
#include "combo.h" #include<bits/stdc++.h> #define ll long long #define F first #define S second using namespace std; char ori[4]={'A','B','X','Y'}; int Pint(vector<int> v){ string s=""; for(auto x:v){ s+=ori[x]; } return press(s); } string guess_sequence(int N) { int l=0,r=3; while(l!=r){ int m=(l+r)>>1; vector<int> v; for(int i=l;i<=m;i++){ v.push_back(i); } if(Pint(v)){ r=m; }else{ l=m+1; } } string now=""; now+=ori[l]; for(int i=2;i<N;i++){ int ct=press(now+ori[(l+1)%4]+now+ori[(l+2)%4]+ori[(l+1)%4]+now+ori[(l+2)%4]+ori[(l+2)%4]+now+ori[(l+2)%4]+ori[(l+3)%4]); if(ct==i){ now+=ori[(l+1)%4]; }else if(ct==i+1){ now+=ori[(l+2)%4]; }else { now+=ori[(l+3)%4]; } } for(int i=1;i<3;i++){ if(press(now+ori[(l+i)%4])==N){ now+=ori[(l+i)%4]; } } if(now.size()<N){ now+=ori[(l+3)%4] } return now; }

Compilation message (stderr)

combo.cpp: In function 'std::string guess_sequence(int)':
combo.cpp:48:22: error: expected ';' before '}' token
   48 |     now+=ori[(l+3)%4]
      |                      ^
      |                      ;
   49 |   }
      |   ~