제출 #921329

#제출 시각아이디문제언어결과실행 시간메모리
921329AverageAmogusEnjoyer콤보 (IOI18_combo)C++17
10 / 100
26 ms1712 KiB
#include <bits/stdc++.h> using namespace std; using ll = long long; template<class T> bool cmin(T &i, T j) { return i > j ? i=j,true:false; } template<class T> bool cmax(T &i, T j) { return i < j ? i=j,true:false; } /* string W = "ABXYY"; int sz = 5; int press(string p) { for (int i=1;i<=sz;i++) { if (p.find(W.substr(0,i)) == string::npos) { return i-1; } } return sz; } */ int press(string p); string guess_sequence(int n) { string res = ""; vector<string> v = {"A","B","X","Y"}; string F; for (auto &x: v) { if (press(x) == 1) { F = x; break; } } res += F; for (int i=2;i<=n;i++) { for (auto &x: v) { if (x != F && press(res+x) == i) { res += x; break; } } } return res; } /* int main() { ios_base::sync_with_stdio(false); cin.tie(nullptr); cout << guess_sequence(sz) << endl; } */
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...