제출 #1193060

#제출 시각아이디문제언어결과실행 시간메모리
1193060Agageldi콤보 (IOI18_combo)C++20
30 / 100
11 ms936 KiB
#include "bits/stdc++.h" // #include "grader.cpp" #include "combo.h" using namespace std; string guess_sequence(int N) { string g = ""; int p = 0; set <char> h = {'A','B','X','Y'}, in[3000]; for(int i = 0; i < N; i++) { in[i].clear(); for(auto k : h) { in[i].insert(k); } } for(auto j : h) { g += j; p++; if(p == 4) break; int calc = press(g); if(calc == 1) break; g.pop_back(); } h.erase(g[0]); for(int i = 1; i < N; i++) { g += *h.begin(); in[i].erase(g[0]); } int pos = 1; while(pos < N) { if((int)in[pos].size() == 1) { g[pos] = *in[pos].begin(); pos++; continue; } g[pos] = *in[pos].begin(); int c = press(g); if(c == N) break; if(c == pos) { in[pos].erase(g[pos]); continue; } in[c].erase(g[c]); pos = c; } return g; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...