제출 #1017113

#제출 시각아이디문제언어결과실행 시간메모리
1017113rakhim_ova콤보 (IOI18_combo)C++17
30 / 100
38 ms2164 KiB
#include "combo.h" #include <bits/stdc++.h> using namespace std; using ll = long long; char find_the_first_character(){ if(press("A")==1) return 'A'; if(press("B")==1) return 'B'; if(press("X")==1) return 'X'; return 'Y'; } string guess_sequence(int n) { char f=find_the_first_character(); string just="ABXY", abxy=""; string s=""; s+=f; for(auto c: just){ if(c==f) continue; abxy+=c; } mt19937 rng(chrono::high_resolution_clock::now().time_since_epoch().count()); int i=2; while(i<=n){ int j=0; for(auto c: abxy){ j++; if(j==3){ s+=c; i++; break; } string s1=s+c; char c1=abxy[rng()%3]; char c2=abxy[rng()%3]; char c3=abxy[rng()%3]; if(i+1<=n){ s1+=s+c+c1; } if(i+2<=n){ s1+=s+c+c1+c2; } if(i+3<=n){ s1+=s+c+c1+c2+c3; } int coins=press(s1); if(coins==i-1) continue; if(coins>=i) s+=c; if(coins>=i+1) s+=c1; if(coins>=i+2) s+=c2; if(coins>=i+3) s+=c3; i=coins+1; break; } } return s; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...