QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#528718#9162. COVID testsmakrav#39.04 277ms4068kbC++205.7kb2024-08-23 20:19:532024-08-23 20:19:54

Judging History

你现在查看的是最新测评结果

  • [2024-08-23 20:19:54]
  • 评测
  • 测评结果:39.04
  • 用时:277ms
  • 内存:4068kb
  • [2024-08-23 20:19:53]
  • 提交

answer

#include <bits/stdc++.h>

using namespace std;

#define all(x) (x).begin(), (x).end()
#define sz(x) (int)(x).size()

mt19937 rnd(time(NULL));

double rand_d() {
    return (double)(rnd() % RAND_MAX) / RAND_MAX;
}

void rsh(vector<int> &x) {
    for (int i = 1; i < x.size(); i++) {
        swap(x[i], x[rnd() % (i + 1)]);
    }
}   

vector<int> fs = {4530, 15330, 28470, 57450, 73890, 109860, 147090, 191730, 219420};

void solve(int tc) {
    int n, t; 
    double p; cin >> n >> p >> t;

    for (int _ = 0; _ < t; _++) {
        vector<int> res(n);
        for (int i = 0; i < n; i++) {
            res[i] = rand_d() <= p;
        }
        auto ask = [&](string s) -> bool {
            #ifdef LOCAL 
                int ans = 0;
                for (int i = 0; i < n; i++) {
                    if (s[i] == '1') ans |= res[i];
                }
                return ans;
            #else
                cout << "Q " << s << endl;
                char c; cin >> c;
                return (c == 'P');
            #endif
        };
        auto check = [&](string ans) {
            #ifdef LOCAL 
                for (int i = 0; i < n; i++) {
                    if (ans[i] - '0' != res[i]) return false;
                }
                return true;
            #else
                cout << "A " << ans << endl;
                char c; cin >> c;
                return (c == 'C');
            #endif
        };
        if (p == 0.2) {
            string ans, req;
            for (int i = 0; i < n; i++) {
                ans += '0';
                req += '0';
            }
            int K = 2;
            for (int i = 0; i < n; i+=K) {
                for (int j = i; j < min(n, i + K); j++) req[j] = '1';
                bool answ = ask(req);
                for (int j = i; j < min(n, i + K); j++) req[j] = '0';
                if (answ) {
                    for (int j = i; j < min(n,i+K); j++) {
                        req[j] = '1';
                        if (ask(req)) {
                            ans[j] = '1'; 
                            req[j] = '0'; 
                            continue;
                        }
                        else {
                            if (j < min(n, i + K) - 1) {
                                ans[j + 1] = '1'; 
                                req[j] = '0';
                            }
                            break;
                        }
                    }
                }
            }
            assert(check(ans));
        }
        else if (p >= 0.1) {
            string ans, req;
            for (int i = 0; i < n; i++) {
                ans += '0';
                req += '0';
            }
            int K = 4;
            auto solve = [&](int l, int r, auto&&solve) -> void {
                for (int i = l; i < r; i++) req[i] = '1';
                bool rs = ask(req);
                for (int i = l; i < r; i++) req[i] = '0';
                if (!rs) return;
                if (l + 1 == r) {
                    ans[l] = '1';
                    return;
                }
                if (l + 2 == r) {
                    req[l] = '1';
                    bool rs = ask(req);
                    if (!rs) {
                        ans[l + 1] = '1';
                        req[l] = '0';
                        return;
                    }
                    ans[l] = '1';
                    req[l] = '0';
                    req[l + 1] = '1';
                    if (ask(req)) ans[l + 1] = '1';
                    req[l + 1] = '0';
                    return;
                }   
                int m = (l + r) / 2;
                solve(l, m, solve);
                solve(m, r, solve);
            };
            for (int i = 0; i < n; i+=K) {
                for (int j = i; j < min(n, i + K); j++) req[j] = '1';
                bool answ = ask(req);
                for (int j = i; j < min(n, i + K); j++) req[j] = '0';
                if (answ) {
                    int m = (i + min(n, i + K)) / 2;
                    solve(i, m, solve);
                    solve(m, min(n, i + K), solve);
                }
            }
            assert(check(ans));
        } else {
            string ans, req;
            for (int i = 0; i < n; i++) {
                ans += '0';
                req += '0';
            }
            auto solve = [&](int l, int r, auto&&solve) -> void {
                for (int i = l; i < r; i++) req[i] = '1';
                bool rs = ask(req);
                for (int i = l; i < r; i++) req[i] = '0';
                if (!rs) return;
                if (l + 1 == r) {
                    ans[l] = '1';
                    return;
                }
                if (l + 2 == r) {
                    req[l] = '1';
                    bool rs = ask(req);
                    if (!rs) {
                        ans[l + 1] = '1';
                        req[l] = '0';
                        return;
                    }
                    ans[l] = '1';
                    req[l] = '0';
                    req[l + 1] = '1';
                    if (ask(req)) ans[l + 1] = '1';
                    req[l + 1] = '0';
                    return;
                }   
                int m = (l + r) / 2;
                solve(l, m, solve);
                solve(m, r, solve);
            };
            solve(0, n, solve);
            assert(check(ans));
        }
    } 
}

signed main() {
    int tt = 1;
    #ifdef LOCAL 
        freopen("in.txt", "r", stdin);
        freopen("out.txt", "w", stdout);
        cin >> tt;
    #endif

    for (int i = 0; i < tt; i++) {
        solve(i);
    }

    return 0;
}

Details

Tip: Click on the bar to expand more detailed information

Subtask #1:

score: 10
Accepted

Test #1:

score: 10
Accepted
time: 0ms
memory: 4016kb

input:

1000 0.789673 1
P
P
P
N
P
P
P
P
P
P
P
P
P
P
P
P
N
P
P
N
P
P
P
N
P
P
P
P
P
P
P
P
P
N
P
P
P
P
P
P
P
P
P
P
P
P
N
P
P
P
P
P
P
P
P
P
P
P
P
P
P
P
P
P
P
P
P
P
P
P
P
P
P
P
P
P
P
P
N
N
P
P
P
P
P
P
P
P
P
N
P
P
P
P
P
P
N
P
N
P
P
P
P
P
N
P
P
P
P
P
P
N
P
P
P
P
P
P
P
P
P
P
N
P
N
P
P
N
P
P
P
P
P
P
P
P
N
P
P
P
P
P
...

output:

Q 1111000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000...

result:

points 1.0 1.0 translate:success

Test #2:

score: 10
Accepted
time: 11ms
memory: 3796kb

input:

1000 0.686378 1
P
P
N
N
P
P
N
N
P
P
P
N
P
P
P
P
N
P
P
P
P
P
P
P
P
N
P
P
P
P
P
N
P
P
P
P
N
P
P
P
N
P
P
P
P
P
P
N
N
P
P
P
N
P
P
P
P
P
P
N
P
P
P
P
P
P
P
P
P
P
P
N
P
P
P
P
P
P
N
P
P
P
P
P
P
P
P
P
P
P
P
P
P
P
P
P
P
P
P
P
P
P
P
P
P
P
P
P
P
P
P
N
P
P
P
P
N
P
N
P
P
P
N
P
P
N
P
P
P
P
P
P
P
P
P
P
N
P
P
N
P
P
...

output:

Q 1111000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000...

result:

points 1.0 1.0 translate:success

Test #3:

score: 10
Accepted
time: 0ms
memory: 3820kb

input:

1000 0.873862 1
P
P
P
P
P
P
P
P
P
P
P
P
P
P
P
P
P
P
P
P
P
P
P
P
P
P
P
P
P
P
P
P
P
P
P
P
P
N
P
P
P
P
P
P
P
P
P
P
P
P
P
P
P
P
P
P
P
P
P
P
P
P
P
P
N
P
P
P
P
P
P
P
P
P
P
P
P
P
P
P
N
P
P
P
P
P
P
P
P
P
P
P
P
P
P
P
P
P
P
P
P
P
P
P
N
P
P
P
P
P
P
P
P
P
P
P
P
P
P
P
N
P
P
P
P
P
N
P
P
P
N
P
P
P
P
P
P
P
P
P
P
P
...

output:

Q 1111000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000...

result:

points 1.0 1.0 translate:success

Test #4:

score: 10
Accepted
time: 0ms
memory: 4064kb

input:

1000 0.669578 1
P
P
P
P
P
N
P
P
P
P
P
P
P
P
P
N
P
N
P
P
P
P
P
N
P
P
P
P
P
P
P
P
P
P
P
P
N
P
P
P
P
P
P
N
P
P
N
P
N
P
P
N
P
P
N
P
P
P
P
P
N
P
P
P
N
P
P
N
P
P
P
P
P
P
P
P
P
P
P
P
P
P
P
P
P
P
P
P
P
P
P
P
N
P
N
P
P
P
N
P
P
P
P
N
P
P
P
P
N
P
P
N
P
P
P
N
P
P
N
P
P
P
P
N
P
P
P
P
P
P
P
P
P
P
P
P
P
P
P
P
P
P
...

output:

Q 1111000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000...

result:

points 1.0 1.0 translate:success

Test #5:

score: 10
Accepted
time: 7ms
memory: 3784kb

input:

1000 0.907052 1
P
P
P
P
P
P
P
P
P
P
P
P
P
N
P
P
P
P
P
P
P
P
P
P
P
P
P
P
P
P
P
P
P
P
P
P
P
P
P
P
P
P
P
P
P
P
P
P
P
P
P
P
P
P
P
P
P
P
P
P
P
P
P
P
P
P
P
P
P
P
P
P
N
P
P
P
P
P
P
N
P
P
P
P
P
P
P
P
P
P
P
P
P
P
P
P
P
P
P
P
P
P
N
P
P
P
P
P
P
P
P
P
P
P
P
P
P
P
P
P
P
P
P
P
P
P
P
P
P
P
P
P
P
P
P
P
P
P
P
P
P
N
...

output:

Q 1111000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000...

result:

points 1.0 1.0 translate:success

Test #6:

score: 10
Accepted
time: 0ms
memory: 3824kb

input:

1000 0.844418 1
P
P
P
P
P
P
P
P
P
P
P
P
P
P
P
P
P
P
P
P
P
P
P
N
P
P
P
P
P
P
P
P
P
N
P
P
P
P
P
P
P
P
P
P
P
P
P
P
P
P
P
P
P
P
P
P
P
P
P
P
P
P
P
P
P
P
P
P
P
P
P
P
P
P
P
P
P
P
P
P
P
P
P
P
P
P
P
P
P
P
P
P
P
P
P
N
P
P
P
P
P
P
P
P
P
N
P
P
P
P
P
N
P
P
P
P
P
P
P
P
N
P
P
P
P
P
P
P
P
P
P
N
P
P
P
P
P
P
N
P
P
N
...

output:

Q 1111000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000...

result:

points 1.0 1.0 translate:success

Test #7:

score: 10
Accepted
time: 0ms
memory: 4052kb

input:

1000 0.533576 1
P
P
P
P
P
P
N
P
N
P
N
P
P
P
N
P
N
P
P
N
P
N
P
P
P
N
P
P
N
P
P
N
P
N
P
P
N
P
P
N
P
P
P
N
P
P
N
P
P
P
P
P
P
P
P
N
P
N
P
P
P
P
P
P
P
P
N
P
P
P
P
P
N
P
P
P
P
P
P
P
P
N
P
P
P
P
P
P
N
N
P
P
P
N
P
P
P
P
P
P
N
P
P
N
P
P
P
P
P
P
N
P
P
P
P
P
P
P
P
P
N
P
N
P
P
P
N
P
N
P
N
P
P
N
P
P
P
P
N
P
P
P
...

output:

Q 1111000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000...

result:

points 1.0 1.0 translate:success

Test #8:

score: 10
Accepted
time: 0ms
memory: 3856kb

input:

1000 0.415944 1
N
P
N
P
N
P
N
P
P
N
P
P
N
P
N
P
N
P
N
N
N
P
P
N
N
P
N
P
P
P
P
P
P
P
P
N
P
N
P
P
N
P
P
N
N
P
P
P
P
P
N
P
P
P
P
N
P
P
P
N
P
P
N
N
P
P
P
N
P
P
N
P
P
P
N
P
P
N
P
N
P
P
N
P
N
P
N
P
N
P
P
P
P
P
P
P
P
P
N
P
N
P
P
P
P
N
P
N
P
N
P
P
N
P
P
P
P
P
P
N
P
P
P
P
P
N
P
P
P
P
P
N
P
P
N
P
P
P
P
P
P
P
...

output:

Q 1111000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000...

result:

points 1.0 1.0 translate:success

Test #9:

score: 10
Accepted
time: 0ms
memory: 3880kb

input:

1000 0.596017 1
P
P
P
N
P
P
P
P
N
P
P
N
P
P
N
P
P
P
P
P
N
N
P
P
P
P
P
P
N
P
P
P
N
P
P
N
P
N
P
P
N
P
P
N
N
P
P
P
N
P
P
P
P
P
P
N
P
P
P
P
P
N
P
P
P
P
P
N
P
N
P
P
P
P
P
N
P
N
P
P
P
P
P
P
N
P
P
N
P
N
P
P
N
P
N
P
P
P
P
P
P
N
P
P
P
P
P
P
N
P
N
P
N
P
P
P
P
N
P
P
N
P
P
P
N
P
N
P
N
P
P
N
P
P
P
P
N
P
P
P
P
P
...

output:

Q 1111000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000...

result:

points 1.0 1.0 translate:success

Test #10:

score: 10
Accepted
time: 2ms
memory: 3892kb

input:

1000 0.157686 1
N
N
N
P
P
N
N
P
P
N
P
P
N
P
P
N
N
P
N
P
P
N
N
N
P
N
P
P
N
P
N
P
P
P
P
N
P
P
N
P
P
P
N
N
P
N
P
P
N
N
N
N
N
P
P
N
N
N
N
N
P
P
N
P
P
N
N
P
N
P
P
P
N
N
P
P
N
P
P
P
P
P
P
N
N
N
N
N
P
N
P
N
P
N
P
P
N
N
P
P
P
N
N
P
N
P
P
N
N
P
N
P
P
N
N
N
P
N
P
N
N
P
P
N
P
N
N
P
N
P
P
N
P
P
N
N
N
N
N
P
P
P
...

output:

Q 1111000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000...

result:

points 1.0 1.0 translate:success

Test #11:

score: 10
Accepted
time: 7ms
memory: 3892kb

input:

1000 0.380215 1
P
N
P
N
P
N
P
N
P
N
P
P
N
P
N
P
P
P
P
P
N
N
P
P
N
P
P
P
P
P
N
P
P
N
P
N
P
P
N
P
N
P
P
N
P
N
P
P
P
P
P
P
P
N
P
N
P
N
P
P
P
N
N
N
N
P
N
P
N
P
P
P
N
N
P
P
N
P
P
N
P
N
P
P
N
N
P
P
P
N
P
P
N
P
P
N
N
P
N
P
P
N
P
N
P
N
P
P
P
P
P
P
P
P
P
P
P
N
N
N
P
P
P
N
P
N
P
N
P
N
N
N
P
P
N
P
N
P
P
N
N
P
...

output:

Q 1111000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000...

result:

points 1.0 1.0 translate:success

Test #12:

score: 10
Accepted
time: 0ms
memory: 3768kb

input:

1000 0.432565 1
P
P
P
N
P
P
N
P
P
N
N
P
P
N
P
P
P
P
P
N
P
P
N
N
N
P
P
P
P
P
P
N
P
P
P
P
N
P
P
P
P
P
P
P
P
P
N
P
P
N
P
N
P
N
P
P
P
P
P
P
N
P
P
P
N
P
N
P
P
P
P
N
P
N
P
P
N
P
P
P
N
P
P
N
P
P
P
N
P
P
P
P
N
P
P
N
P
P
N
N
P
P
N
P
N
P
N
P
N
P
N
P
P
N
P
P
P
N
N
P
P
P
N
P
N
P
P
P
P
P
P
P
P
P
P
N
P
P
N
N
P
N
...

output:

Q 1111000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000...

result:

points 1.0 1.0 translate:success

Test #13:

score: 10
Accepted
time: 4ms
memory: 4024kb

input:

1000 0.509199 1
P
P
P
P
P
N
P
N
P
N
P
P
P
N
N
P
N
P
P
N
P
P
N
P
P
N
P
P
P
P
P
N
P
P
P
P
P
P
P
P
N
P
P
N
P
P
P
P
P
N
P
P
P
P
P
P
P
P
P
P
P
P
P
P
P
P
P
N
P
P
P
P
P
P
N
P
N
P
P
N
P
P
N
P
P
P
N
P
P
N
P
P
N
P
N
P
P
N
N
P
N
P
N
P
P
P
N
N
P
P
P
P
P
P
N
P
P
N
P
P
P
P
P
P
N
N
P
P
N
P
P
N
P
P
P
N
N
P
P
P
P
P
...

output:

Q 1111000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000...

result:

points 1.0 1.0 translate:success

Test #14:

score: 10
Accepted
time: 4ms
memory: 3824kb

input:

1000 0.381646 1
P
N
P
N
N
P
P
P
P
P
P
N
N
P
P
P
N
N
P
P
P
N
P
P
N
P
P
P
N
P
P
N
N
P
N
P
P
P
N
P
P
P
P
N
P
N
P
N
N
P
P
P
N
P
P
N
P
N
P
N
P
P
P
P
P
N
P
P
P
N
P
P
P
P
P
P
N
P
P
N
P
P
P
P
P
P
N
N
P
P
P
N
P
N
P
P
P
N
P
P
P
P
P
N
P
P
N
P
N
P
N
P
P
P
N
P
N
N
P
P
N
N
P
P
P
P
N
P
N
P
N
P
P
P
N
P
P
N
P
P
N
N
...

output:

Q 1111000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000...

result:

points 1.0 1.0 translate:success

Test #15:

score: 10
Accepted
time: 0ms
memory: 4068kb

input:

1000 0.42815 1
P
P
N
P
P
N
P
P
P
N
P
P
P
P
P
P
N
P
N
P
N
P
P
N
P
P
N
P
P
P
N
P
P
P
P
P
P
N
P
N
P
P
P
P
P
N
N
P
P
P
N
N
P
P
P
P
N
P
N
P
P
N
P
P
N
P
P
N
P
P
P
N
N
P
P
N
N
P
N
P
N
P
P
N
P
P
N
P
P
P
P
P
P
P
P
N
P
N
P
P
P
P
P
N
P
P
P
P
P
N
P
P
P
N
P
P
N
P
N
P
P
N
P
P
N
N
P
P
P
P
P
N
P
P
P
N
P
N
P
N
P
P
P...

output:

Q 1111000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000...

result:

points 1.0 1.0 translate:success

Test #16:

score: 10
Accepted
time: 0ms
memory: 3816kb

input:

1000 1 1
P
P
P
P
P
P
P
P
P
P
P
P
P
P
P
P
P
P
P
P
P
P
P
P
P
P
P
P
P
P
P
P
P
P
P
P
P
P
P
P
P
P
P
P
P
P
P
P
P
P
P
P
P
P
P
P
P
P
P
P
P
P
P
P
P
P
P
P
P
P
P
P
P
P
P
P
P
P
P
P
P
P
P
P
P
P
P
P
P
P
P
P
P
P
P
P
P
P
P
P
P
P
P
P
P
P
P
P
P
P
P
P
P
P
P
P
P
P
P
P
P
P
P
P
P
P
P
P
P
P
P
P
P
P
P
P
P
P
P
P
P
P
P
P
P
P...

output:

Q 1111000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000...

result:

points 1.0 1.0 translate:success

Test #17:

score: 10
Accepted
time: 0ms
memory: 3940kb

input:

1000 0 1
N
C

output:

Q 1111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111...

result:

points 1.0 1.0 translate:success

Subtask #2:

score: 29.04
Acceptable Answer

Test #18:

score: 56.86
Acceptable Answer
time: 14ms
memory: 3820kb

input:

1000 0.001 300
N
C
P
N
P
P
N
P
N
P
P
P
P
N
P
N
P
P
N
N
N
N
N
C
P
N
P
N
P
P
N
P
P
N
P
P
N
P
P
N
N
N
P
N
P
N
P
P
N
P
N
N
P
P
P
N
P
N
P
P
N
P
P
N
N
N
N
C
N
C
N
C
P
P
N
P
P
N
P
P
N
P
N
P
N
P
P
P
N
N
N
N
N
C
P
N
P
N
P
P
P
P
N
P
N
P
N
P
N
P
N
N
N
N
C
N
C
N
C
P
P
N
P
P
P
P
P
N
P
P
N
P
N
N
N
N
N
N
N
C
N
C
P...

output:

Q 1111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111...

result:

points 0.63177777780 0.6317777778 Output is correct (P=0.001, F=15.1, Q=17.3) -> 56.86 points

Test #19:

score: 30.85
Acceptable Answer
time: 57ms
memory: 3744kb

input:

1000 0.005256 300
P
P
P
P
N
P
N
P
P
P
P
P
P
N
N
N
P
P
N
P
P
N
N
N
N
P
N
P
N
P
P
P
P
N
P
N
P
N
N
N
N
P
N
P
P
P
N
P
P
P
P
P
N
N
N
N
N
P
N
P
P
N
P
P
N
P
P
P
N
N
N
N
C
P
N
P
P
P
N
P
N
P
P
N
P
N
P
P
P
N
N
N
N
P
P
N
P
N
P
P
N
P
P
N
P
N
N
N
P
P
N
P
P
P
P
N
P
N
N
N
N
N
C
P
N
P
N
P
N
P
P
N
P
P
N
P
N
P
N
P
N
...

output:

Q 1111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111...

result:

points 0.34277777780 0.3427777778 Output is correct (P=0.005256, F=51.1, Q=75.6) -> 30.85 points

Test #20:

score: 29.04
Acceptable Answer
time: 59ms
memory: 3824kb

input:

1000 0.011546 300
P
P
P
P
P
P
N
P
P
P
P
N
N
N
P
P
N
P
P
N
N
N
N
P
N
P
N
P
N
P
P
N
P
P
N
N
N
P
P
P
N
P
N
P
P
N
P
N
P
N
P
P
P
N
P
N
N
P
P
N
P
N
P
P
P
P
N
N
N
P
P
P
P
P
P
N
N
N
N
N
N
P
N
P
P
P
N
P
N
P
N
P
N
P
P
N
N
P
N
P
P
N
P
P
N
P
P
N
N
N
P
N
P
P
P
P
P
P
N
N
N
N
P
P
P
P
P
P
N
N
N
N
N
C
P
P
P
P
N
P
N
...

output:

Q 1111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111...

result:

points 0.32266666670 0.3226666667 Output is correct (P=0.011546, F=94.9, Q=144.7) -> 29.04 points

Test #21:

score: 29.32
Acceptable Answer
time: 65ms
memory: 3888kb

input:

1000 0.028545 300
P
P
P
P
P
P
P
P
P
P
N
N
N
N
N
P
P
N
P
P
P
N
P
P
N
N
N
N
P
P
P
P
N
P
P
N
P
N
P
N
P
N
N
N
P
P
N
P
N
P
P
P
P
N
N
P
P
P
N
N
P
N
P
P
N
P
N
P
P
N
N
P
P
N
P
P
N
P
N
P
P
P
N
N
N
P
P
N
P
N
P
N
P
P
N
P
N
P
N
P
P
N
N
P
P
P
P
N
P
P
N
P
N
N
N
P
P
P
P
N
P
P
P
N
P
P
N
P
P
N
P
N
P
N
N
P
P
N
P
N
P
...

output:

Q 1111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111...

result:

points 0.32577777780 0.3257777778 Output is correct (P=0.028545, F=191.5, Q=290.6) -> 29.32 points

Test #22:

score: 30.01
Acceptable Answer
time: 140ms
memory: 3816kb

input:

1000 0.039856 300
P
P
P
P
P
P
P
N
P
P
N
P
P
N
N
P
N
P
N
P
N
P
P
N
P
P
P
P
N
P
N
N
N
N
N
P
P
N
P
P
P
P
N
P
P
N
N
N
P
N
P
N
P
P
P
N
P
P
N
P
P
P
P
N
P
P
N
N
P
N
P
P
P
N
N
P
P
N
P
P
P
N
N
P
P
P
P
N
N
N
N
P
P
P
P
P
P
P
P
N
N
N
P
P
P
P
N
N
N
N
P
P
P
P
N
P
N
N
N
P
P
N
P
P
P
N
N
N
P
P
P
N
P
N
P
P
P
N
N
N
N
...

output:

Q 1111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111...

result:

points 0.33344444440 0.3334444444 Output is correct (P=0.039856, F=246.3, Q=369.4) -> 30.01 points

Test #23:

score: 31.31
Acceptable Answer
time: 277ms
memory: 3824kb

input:

1000 0.068648 300
P
P
P
P
P
P
P
N
P
N
P
N
P
N
P
P
P
N
P
N
P
N
P
N
P
P
P
P
N
N
N
P
P
P
N
P
P
N
P
P
N
P
P
P
P
N
N
N
P
P
P
P
N
N
P
N
P
P
N
N
P
P
P
N
P
N
P
N
P
P
N
P
P
N
P
N
P
N
N
P
P
P
P
P
P
N
N
N
N
P
N
P
P
N
P
P
N
N
P
P
P
N
P
P
P
P
N
N
N
N
N
P
P
N
P
N
P
P
P
N
N
N
P
P
P
P
N
P
P
P
P
P
P
N
N
N
P
P
P
N
P
...

output:

Q 1111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111...

result:

points 0.34788888890 0.3478888889 Output is correct (P=0.068648, F=366.2, Q=537.8) -> 31.31 points

Test #24:

score: 51.75
Acceptable Answer
time: 228ms
memory: 3856kb

input:

1000 0.104571 300
N
N
N
N
N
P
P
N
N
N
N
P
N
P
P
N
P
P
P
P
N
N
N
N
N
P
N
P
P
N
P
P
N
N
P
N
P
N
P
N
P
P
N
N
P
P
N
N
P
P
P
P
N
N
P
P
P
N
P
P
N
N
N
N
N
N
N
N
N
P
P
P
N
N
N
N
N
P
P
P
N
N
N
N
N
P
P
N
N
N
N
N
N
N
N
P
N
P
P
N
P
P
P
N
N
P
P
P
N
P
N
P
N
P
N
N
N
P
N
P
P
N
N
N
P
P
N
N
N
N
N
P
N
P
P
N
P
P
N
P
P
...

output:

Q 1111000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000...

result:

points 0.5750 0.575 Output is correct (P=0.104571, F=490.3, Q=580.9) -> 51.75 points

Test #25:

score: 59.23
Acceptable Answer
time: 253ms
memory: 3880kb

input:

1000 0.158765 300
N
N
N
N
P
P
P
N
N
P
N
P
P
N
N
N
P
P
P
P
N
N
N
N
N
N
N
N
N
P
P
N
P
N
N
N
N
N
P
P
N
N
N
N
P
N
P
N
N
N
N
P
N
P
N
N
P
N
P
N
N
N
P
N
P
P
N
N
N
N
P
P
N
N
P
P
P
N
N
P
P
N
N
N
P
P
P
N
N
N
N
N
N
N
P
P
N
P
P
P
N
N
P
P
N
N
N
N
N
N
N
P
P
N
N
N
P
N
P
N
P
N
P
P
P
P
P
N
N
P
P
N
N
N
P
P
P
N
N
P
P
...

output:

Q 1111000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000...

result:

points 0.65811111110 0.6581111111 Output is correct (P=0.158765, F=639.1, Q=722.1) -> 59.23 points

Test #26:

score: 70.61
Acceptable Answer
time: 273ms
memory: 3984kb

input:

1000 0.2 300
N
N
P
P
N
N
P
N
P
N
N
N
N
N
N
N
N
N
P
N
P
N
P
P
N
N
P
N
P
N
N
P
P
N
P
P
N
N
P
P
N
P
P
N
N
P
P
P
N
N
P
N
N
P
P
N
N
N
N
N
N
N
P
N
P
P
P
N
N
P
N
N
N
P
N
N
P
N
N
P
N
N
N
N
N
N
N
P
N
P
N
P
P
N
P
N
N
N
N
P
P
P
P
N
N
P
P
N
N
N
P
P
N
P
P
N
P
P
N
N
N
N
N
N
N
P
P
P
P
P
N
P
N
N
N
N
P
N
N
N
N
N
N
P...

output:

Q 1100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000...

result:

points 0.78455555560 0.7845555556 Output is correct (P=0.2, F=731.4, Q=781.6) -> 70.61 points