제출 #1111411

#제출 시각아이디문제언어결과실행 시간메모리
1111411epicci23콤보 (IOI18_combo)C++17
30 / 100
70 ms1104 KiB
#include "bits/stdc++.h" #include "combo.h" //#define int long long #define all(v) v.begin() , v.end() #define sz(a) (int)a.size() using namespace std; vector<char> v; mt19937_64 rng(chrono::steady_clock::now().time_since_epoch().count()); int ask(string s,int ekle){ s.push_back(v[ekle]); return press(s); } string guess_sequence(int n){ string res=""; if(press("A")==1){ res.push_back('A'); v.push_back('B'); v.push_back('X'); v.push_back('Y'); } else{ v.push_back('A'); if(press("B")==1){ res.push_back('B'); v.push_back('X'); v.push_back('Y'); } else{ v.push_back('B'); if(press("X")==1){ res.push_back('X'); v.push_back('Y'); } else{ res.push_back('Y'); v.push_back('X'); } } } for(int i=1;i<n;i++){ bool ok=0; shuffle(all(v),rng); for(int j=0;j<2;j++){ if(ask(res,j)==i+1){ res.push_back(v[j]); ok=1; break; } } if(!ok) res.push_back(v.back()); } return res; } /*void _(){ } int32_t main(){ cin.tie(0); ios::sync_with_stdio(0); int tc=1;//cin >> tc; while(tc--) _(); return 0; }*/
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...