Submission #933347

#TimeUsernameProblemLanguageResultExecution timeMemory
933347QuizmosCombo (IOI18_combo)C++14
5 / 100
1 ms344 KiB
#include <bits/stdc++.h> int press(std::string p); std::string guess_sequence(int N) { std::string p="AB", s=""; char a, b, c; int coins, rizz; if(press(p)==0) { p="X"; if(press(p)==0) { s+='Y'; a='A'; b='B'; c='X'; } else { s+='X'; a='A'; b='B'; c='Y'; } } else { p="A"; if(press(p)==0) { s+='B'; a='A'; b='X'; c='Y'; } else { s+='A'; a='X'; b='B'; c='Y'; } } for(int i=1; i<N-1; i++) { p=s+a+s+b+a+s+b+b+s+b+c; coins=press(p); rizz=s.size(); if(coins==rizz) s+=c; else if(coins==rizz+1) s+=a; else s+=b; } p=s+a+s+b; rizz=s.size(); if(press(p)==rizz+1) { p=s+a; if(press(p)==rizz+1) s+=a; else s+=b; } else s+=c; return s; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...