Submission #1068705

# Submission time Handle Problem Language Result Execution time Memory
1068705 2024-08-21T11:26:15 Z vjudge1 COVID tests (CEOI24_covid) C++17
0 / 100
3735 ms 760 KB
#include <bits/stdc++.h>
#define int long long

using namespace std;

int n, t, mid;
double p;
string res, ask;
char temp;
bool ok;
void bs(int l, int r) {
    if(l == r) res[l] = '1';
    else {
        mid = (l + r) / 2;
        for(int i = 0; i < n; i++) {
            if(l <= i && i <= mid) ask[i] = '1';
            else ask[i] = '0';
        }
        cout << "Q " << ask << endl;
        cin >> temp;
        if(temp == 'P') bs(l, mid);
        //
        for(int i = 0; i < n; i++) {
            if(mid + 1 <= i && i <= r) ask[i] = '1';
            else ask[i] = '0';
        }
        cout << "Q " << ask << endl;
        cin >> temp;
        if(temp == 'P') bs(mid + 1, r);
    }
}

void solve() {
    res = string(n, '0');
    ask = string(n, '1');
    cout << "Q " << ask << endl;
    cin >> temp;
    if(temp == 'P') bs(0, n - 1);
    cout << "A " << res << endl;
    cin >> temp;
    if(temp == 'W') ok = false;
}

signed main() {
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    cin >> n >> p >> t;
    ok = true;
    while(t-- && ok) {
        solve();
    }
}
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 344 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 31 ms 344 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 48 ms 344 KB Output is correct (P=0.001, F=15.1, Q=20.7) -> 36.24 points
2 Correct 239 ms 344 KB Output is correct (P=0.005256, F=51.1, Q=96.6) -> 19.73 points
3 Correct 409 ms 344 KB Output is correct (P=0.011546, F=94.9, Q=192.7) -> 17.57 points
4 Correct 964 ms 760 KB Output is correct (P=0.028545, F=191.5, Q=412.1) -> 16.05 points
5 Correct 1314 ms 344 KB Output is correct (P=0.039856, F=246.3, Q=537.8) -> 15.70 points
6 Correct 1983 ms 344 KB Output is correct (P=0.068648, F=366.2, Q=823.1) -> 15.02 points
7 Correct 2785 ms 344 KB Output is correct (P=0.104571, F=490.3, Q=1124.7) -> 14.57 points
8 Execution timed out 3735 ms 344 KB Time limit exceeded (wall clock)
9 Halted 0 ms 0 KB -