제출 #140667

#제출 시각아이디문제언어결과실행 시간메모리
140667Nerarith콤보 (IOI18_combo)C++14
5 / 100
3 ms1960 KiB
#include <bits/stdc++.h> #include "combo.h" using namespace std; int press (string p); string guess_sequence(int n) { char tr, alt, fir; if (press("AB")) tr = 'A', alt = 'B'; else tr = 'X', alt = 'Y'; string ss = ""; ss += tr; if (press(ss)) fir = tr; else fir = alt; string cs = "ABXY"; cs.erase(cs.find(fir), 1); string pr = ""; pr += fir; for (int i=1; i < n-1; i++) { string s = pr + cs[1] + pr + cs[2]+cs[0] + pr + cs[2]+cs[1] + pr + cs[2]+cs[2]; int res = press(s); cerr<<res<<endl; if (res==i) pr += cs[0]; else if (res==i+1) pr += cs[1]; else pr += cs[2]; } if (press(pr+cs[0])==n) return pr+cs[0]; if (press(pr+cs[1])==n) return pr+cs[1]; return pr+cs[2]; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...