제출 #1035100

#제출 시각아이디문제언어결과실행 시간메모리
1035100huutuan콤보 (IOI18_combo)C++14
100 / 100
26 ms2060 KiB
#include "combo.h" #include <bits/stdc++.h> using namespace std; string guess_sequence(int N) { char a='A', b='B', x='X', y='Y'; string s; if (press("AB")){ if (press("A")); else swap(b, a); }else{ if (press("X")) swap(x, a); else swap(y, a); } s.push_back(a); if (N==1) return s; while ((int)s.size()+2<=N){ string ask=s+b+s+x+b+s+x+x+s+x+y; int tmp=press(ask); if (tmp==(int)s.size()+1) s.push_back(b); else if (tmp==(int)s.size()+2) s.push_back(x); else s.push_back(y); } if (press(s+b)==N) s.push_back(b); else if (press(s+x)==N) s.push_back(x); else s.push_back(y); return s; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...