제출 #1199508

#제출 시각아이디문제언어결과실행 시간메모리
1199508AMel0n콤보 (IOI18_combo)C++20
100 / 100
7 ms484 KiB
#include <bits/stdc++.h> using namespace std; typedef long long ll; #define FOR(i,N) for(ll i = 0; i < N; i++) #define all(x) (x).begin(), (x).end() #define F first #define S second #include "combo.h" string guess_sequence(int N) { string s; string buton; // hehe guanhan 🫡 if (press("AB") >= 1) { if (press("A") == 1) { s = "A"; buton = "BXY"; } else { s = "B"; buton = "AXY"; } } else { if (press("X") == 1) { s = "X"; buton = "ABY"; } else { s = "Y"; buton = "ABX"; } } if (N == 1) return s; for (int i = 1; i < N-1; i++) { int res = press(s+buton[0] + s+buton[1]+buton[0] + s+buton[1]+buton[1] + s+buton[1]+buton[2]); if (res == s.size()) s += buton[2]; if (res == s.size()+1) s += buton[0]; if (res == s.size()+2) s += buton[1]; } if (press(s+buton[0]) == s.size()+1) { s += buton[0]; } else { if (press(s+buton[1]) == s.size()+1) s += buton[1]; else s += buton[2]; } return s; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...