#include <bits/stdc++.h>
using namespace std;
bool ans[1000];
int N;
bool ask(int inf, int sup, bool preg){
cin.tie(nullptr);
ios::sync_with_stdio(0);
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;
cout.flush();
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;
ask(m+1, sup, ask(inf, m, true));
return true;
}
}
int main()
{
cin.tie(nullptr);
ios::sync_with_stdio(0);
int T;
double P;
cin>>N>>P>>T;
double jaskier=0.8;
for(int dalekofrivia=0; dalekofrivia<T; dalekofrivia++){
if(P<0.001) P=0.001;
int lambda=(jaskier/P);
for(int i=0; i<N; i=i+lambda) ask(i, min(i+lambda, N)-1, true);
cout<<"A ";
for(int i=0; i<N; i++) cout<<ans[i];
cout<<endl;
cout.flush();
char C;
cin>>C;
if(C!='C') break;
}
return 0;
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
0 ms |
344 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
31 ms |
344 KB |
Output is correct |
2 |
Correct |
31 ms |
344 KB |
Output is correct |
3 |
Execution timed out |
7053 ms |
344 KB |
Time limit exceeded |
4 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
156 ms |
344 KB |
Output is correct (P=0.001, F=15.1, Q=14.4) -> 90.00 points |
2 |
Correct |
640 ms |
344 KB |
Output is correct (P=0.005256, F=51.1, Q=59.4) -> 54.56 points |
3 |
Correct |
1147 ms |
344 KB |
Output is correct (P=0.011546, F=94.9, Q=111.6) -> 52.82 points |
4 |
Correct |
2350 ms |
344 KB |
Output is correct (P=0.028545, F=191.5, Q=225.9) -> 52.37 points |
5 |
Correct |
2952 ms |
344 KB |
Output is correct (P=0.039856, F=246.3, Q=293.8) -> 50.81 points |
6 |
Correct |
4367 ms |
344 KB |
Output is correct (P=0.068648, F=366.2, Q=427.5) -> 53.91 points |
7 |
Correct |
5637 ms |
344 KB |
Output is correct (P=0.104571, F=490.3, Q=549.7) -> 60.62 points |
8 |
Execution timed out |
7064 ms |
344 KB |
Time limit exceeded |
9 |
Halted |
0 ms |
0 KB |
- |