Submission #1039287

#TimeUsernameProblemLanguageResultExecution timeMemory
1039287Dalek_of_RiviaCOVID tests (CEOI24_covid)C++17
0 / 100
7042 ms344 KiB
#include <bits/stdc++.h> using namespace std; bool ans[1000]; int N; bool ask(int inf, int sup, bool preg){ char c='P'; if(preg){ cout<<"Q "; for(int i=0; i<N; i++){ if((i<inf)|(i>sup)){ cout<<0; }else{ cout<<1; } } cout<<endl; cin>>c; } if(c=='N'){ for(int i=inf; i<=sup; i++) ans[i]=false; return false; }else if(inf==sup){ ans[inf]=true; return true; }else{ int m = (inf+sup)/2; bool tau=ask(inf, m, true); ask(m+1, sup, tau); return true; } } int main() { cin.tie(nullptr); int T; double P; cin>>N>>P>>T; double jaskier=0.5; for(int dalekofrivia=0; dalekofrivia<T; dalekofrivia++){ int lambda=(jaskier/P)+1; for(int i=0; i<N; i+=lambda) ask(i, min(i+lambda, N)-1, true); cout<<"A "; for(int i=0; i<N; i++) cout<<ans[i]; cout<<endl; char C; cin>>C; if(C!='C') break; } return 0; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...