Submission #1185766

#TimeUsernameProblemLanguageResultExecution timeMemory
1185766Mamikonm1Combo (IOI18_combo)C++20
Compilation error
0 ms0 KiB
#include<bits//stdc++.h> #include "combo.h" using namespace std; string guess_sequence(int N) { string s; vector<pair<int,char>>x({{0,'A'},{0,'B'},{0,'X'},{0,'Y'}); set<string>st; int mx=0,cur; for(;;){ bool ok=0; sort(rbegin(x),rend(x)); for(auto& j:x){ s+=j.second; if(!st.count(s)){ cur=press(s); if(cur>mx){ mx=cur; j.first++; ok=1; break; } st.insert(s); } s.pop_back(); } if(!ok or s.size()==N)break; } for(;s.size()!=N;){ bool ok=0; sort(rbegin(x),rend(x)); for(auto& j:x){ s=j.second+s; if(!st.count(s)){ cur=press(s); if(cur>mx){ mx=cur; ok=1; j.first++; break; } st.insert(s); } reverse(begin(s),end(s)); s.pop_back(); reverse(begin(s),end(s)); } if(!ok)break; } return s; }

Compilation message (stderr)

combo.cpp: In function 'std::string guess_sequence(int)':
combo.cpp:6:61: error: expected '}' before ')' token
    6 |     vector<pair<int,char>>x({{0,'A'},{0,'B'},{0,'X'},{0,'Y'});
      |                             ~                               ^