#include <bits/stdc++.h>
using namespace std;
bool ask_query(vector<bool> a)
{
cout << "Q ";
for (int i=0; i<1000; i++)
cout << a[i];
cout << '\n';
cout.flush();
char x;
cin >> x;
if (x=='P')
return 1;
return 0;
}
bool report(vector<bool> a)
{
cout << "A ";
for (int i=0; i<1000; i++)
cout << a[i];
cout << '\n';
cout.flush();
char x;
cin >> x;
if (x=='C')
return 1;
return 0;
}
int main()
{
int N, T;
long double P;
cin >> N >> P >> T;
if (T==1)
{
while (T--)
{
vector<bool> query(N, 0);
vector<bool> ans(N, 0);
for (int i=0; i<N; i++)
{
query[i] = 1;
ans[i] = ask_query(query);
query[i] = 0;
}
bool L = report(ans);
if (L==0)
T = 0;
}
}
}
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
0 ms |
344 KB |
Unexpected end of file - token expected |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
54 ms |
344 KB |
Output is correct |
2 |
Correct |
36 ms |
344 KB |
Output is correct |
3 |
Correct |
42 ms |
344 KB |
Output is correct |
4 |
Correct |
64 ms |
344 KB |
Output is correct |
5 |
Correct |
56 ms |
344 KB |
Output is correct |
6 |
Correct |
57 ms |
344 KB |
Output is correct |
7 |
Correct |
37 ms |
344 KB |
Output is correct |
8 |
Correct |
51 ms |
344 KB |
Output is correct |
9 |
Correct |
65 ms |
344 KB |
Output is correct |
10 |
Correct |
38 ms |
340 KB |
Output is correct |
11 |
Correct |
63 ms |
344 KB |
Output is correct |
12 |
Correct |
37 ms |
344 KB |
Output is correct |
13 |
Correct |
36 ms |
344 KB |
Output is correct |
14 |
Correct |
52 ms |
344 KB |
Output is correct |
15 |
Correct |
59 ms |
344 KB |
Output is correct |
16 |
Correct |
66 ms |
344 KB |
Output is correct |
17 |
Correct |
54 ms |
344 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
1 ms |
344 KB |
Unexpected end of file - token expected |
2 |
Halted |
0 ms |
0 KB |
- |