#include <bits/stdc++.h>
#define int long long
using namespace std;
int n, t, mid;
double p;
string res;
char temp;
void bs(int l, int r) {
if(r - l < 2) res[l] = '1';
else {
mid = (l + r) / 2;
string ask(n, '0');
for(int i = l; i < mid; i++) ask[i] = '1';
cout << "Q " << ask << endl;
cin >> temp;
if(temp == 'P') bs(l, mid);
else bs(mid, r);
}
}
void solve() {
res = string(n, '0');
string ask(n, '1');
cout << "Q " << ask << endl;
cin >> temp;
if(temp == 'P') bs(0, n);
cout << "A " << res << endl;
cin >> temp;
}
signed main() {
ios_base::sync_with_stdio(false);
cin.tie(NULL);
cin >> n >> p >> t;
while(t--) solve();
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Runtime error |
1 ms |
344 KB |
Execution killed with signal 13 |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
1 ms |
344 KB |
translate:wrong |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Runtime error |
0 ms |
344 KB |
Execution killed with signal 13 |
2 |
Halted |
0 ms |
0 KB |
- |