#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;
if(P>0.1) lambda=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 time |
Memory |
Grader output |
1 |
Correct |
0 ms |
344 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
39 ms |
344 KB |
Output is correct |
2 |
Correct |
34 ms |
344 KB |
Output is correct |
3 |
Correct |
57 ms |
344 KB |
Output is correct |
4 |
Correct |
34 ms |
344 KB |
Output is correct |
5 |
Correct |
35 ms |
344 KB |
Output is correct |
6 |
Correct |
34 ms |
344 KB |
Output is correct |
7 |
Correct |
34 ms |
344 KB |
Output is correct |
8 |
Correct |
42 ms |
344 KB |
Output is correct |
9 |
Correct |
34 ms |
344 KB |
Output is correct |
10 |
Correct |
34 ms |
344 KB |
Output is correct |
11 |
Correct |
34 ms |
344 KB |
Output is correct |
12 |
Correct |
34 ms |
344 KB |
Output is correct |
13 |
Correct |
35 ms |
344 KB |
Output is correct |
14 |
Correct |
34 ms |
344 KB |
Output is correct |
15 |
Correct |
36 ms |
344 KB |
Output is correct |
16 |
Correct |
34 ms |
344 KB |
Output is correct |
17 |
Runtime error |
0 ms |
344 KB |
Execution killed with signal 11 |
18 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
168 ms |
344 KB |
Output is correct (P=0.001, F=15.1, Q=14.0) -> 90.00 points |
2 |
Correct |
664 ms |
344 KB |
Output is correct (P=0.005256, F=51.1, Q=59.5) -> 54.30 points |
3 |
Correct |
1195 ms |
344 KB |
Output is correct (P=0.011546, F=94.9, Q=114.2) -> 49.63 points |
4 |
Correct |
2458 ms |
344 KB |
Output is correct (P=0.028545, F=191.5, Q=227.7) -> 51.25 points |
5 |
Correct |
3242 ms |
344 KB |
Output is correct (P=0.039856, F=246.3, Q=293.6) -> 50.90 points |
6 |
Correct |
4499 ms |
596 KB |
Output is correct (P=0.068648, F=366.2, Q=407.2) -> 62.16 points |
7 |
Execution timed out |
7025 ms |
344 KB |
Time limit exceeded |
8 |
Halted |
0 ms |
0 KB |
- |