QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#682003#9162. COVID testsRDFZchenyy70.45 2584ms3940kbC++144.2kb2024-10-27 13:27:152024-10-27 13:27:15

Judging History

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

  • [2024-10-27 13:27:15]
  • 评测
  • 测评结果:70.45
  • 用时:2584ms
  • 内存:3940kb
  • [2024-10-27 13:27:15]
  • 提交

answer

#include <bits/stdc++.h>

using ld = long double;

int n;
ld p;
int T;
int a[1005];
char c;
char b[1005];

bool ask(int l, int r) {
    std::cout << 'Q' << ' ';

    for (int j = 1; j <= n; j++) {
        std::cout << (char)((j >= l && j <= r) + '0');
    }

    std::cout << std::endl;
    std::cin >> c;
    return c == 'P';
}
// bool ask(int l,int r){
//     for(int i=l;i<=r;i++){
//         if(b[i]=='1') return true;
//     }
//     return false;
// }

void run() {
    memset(a, 0, sizeof(a));

    for (int i = 1; i <= n; i++) {
        std::cout << 'Q' << ' ';

        for (int j = 1; j <= n; j++) {
            std::cout << (char)((j == i) + '0');
        }

        std::cout << std::endl;
        std::cin >> c;

        if (c == 'P')
            a[i] = 1;
    }

    std::cout << 'A' << ' ';

    for (int i = 1; i <= n; i++) {
        std::cout << a[i];
    }

    std::cout << std::endl;
    std::cin >> c;
    return;
}

namespace Sol1 {
int a[1005];
void query(int l, int r) {
    if (l == r) {
        a[l] = 1;
        return;
    }

    int mid = (l + r) >> 1;

    if (ask(l, mid)) {
        query(l, mid);

        if (ask(mid + 1, r)) {
            query(mid + 1, r);
        }
    } else {
        query(mid + 1, r);
    }

    return;
}

void run() {
    memset(a, 0, sizeof(a));

    if (ask(1, n))
        query(1, n);

    std::cout << 'A' << ' ';

    for (int i = 1; i <= n; i++) {
        std::cout << a[i];
    }

    std::cout << std::endl;
    std::cin >> c;
    return;
}
}

namespace Sol9 {
void query(int l, int r) {
    if (l == r) {
        a[l] = 1;
        return;
    }

    int mid = (l + r) >> 1;

    if (ask(l, mid)) {
        query(l, mid);

        if (ask(mid + 1, r)) {
            query(mid + 1, r);
        }
    } else {
        query(mid + 1, r);
    }

    return;
}

void run() {
    memset(a, 0, sizeof(a));

    for (int i = 1; i <= n - 1; i += 3) {
        if (ask(i, i + 2))
            query(i, i + 2);
    }

    a[n] = ask(n, n);
    std::cout << 'A' << ' ';

    for (int i = 1; i <= n; i++) {
        std::cout << a[i];
    }

    std::cout << std::endl;
    std::cin >> c;
    return;
}
}

namespace Ex {
int pre[1005][2];
ld f[1005][2];
ld fpow(ld a, int b) {
    ld ret = 1;

    for (; b; b >>= 1, a *= a)
        if (b & 1)
            ret *= a;

    return ret;
}
void init() {
    f[1][0] = 1;
    f[1][1] = 0;

    for (int i = 2; i <= n; i++) {
        f[i][0] = f[i][1] = 1e18;

        for (int j = 1; j <= i - 1; j++) {
            ld p1 = ((ld)1.0 - fpow((ld)1.0 - p, j));
            ld p2 = p1 / ((ld)1.0 - fpow((ld)1.0 - p, i));

            if ((ld)1.0 + p1 * (f[i - j][0] + f[j][1]) + (1 - p1)*f[i - j][0] < f[i][0]) {
                pre[i][0] = j;
                f[i][0] = (ld)1.0 + p1 * (f[i - j][0] + f[j][1]) + (1 - p1) * f[i - j][0];
            }

            if ((ld)1.0 + p2 * (f[i - j][0] + f[j][1]) + (1 - p2)*f[i - j][1] < f[i][1]) {
                pre[i][1] = j;
                f[i][1] = (ld)1.0 + p2 * (f[i - j][0] + f[j][1]) + (1 - p2) * f[i - j][1];
            }
        }

        if (f[i][0] > 1 + ((ld)1.0 - fpow((ld)1.0 - p, i))*f[i][1]) {
            pre[i][0] = 0;
            f[i][0] = 1 + ((ld)1.0 - fpow((ld)1.0 - p, i)) * f[i][1];
        }
    }

    return;
}
void query(int l, int r, int o) {
    if (l == r) {
        if (o == 1)
            a[l] = 1;
        else
            a[l] = ask(l, l);

        return;
    }

    int x = r - l + 1;

    if (pre[x][o] == 0) {
        if (ask(l, r))
            query(l, r, 1);
    } else {
        int y = pre[x][o];

        if (ask(l, l + y - 1))
            query(l, l + y - 1, 1), query(l + y, r, 0);
        else
            query(l + y, r, o);
    }

    return;
}
void run() {
    memset(a, 0, sizeof(a));
    query(1, n, 0);
    std::cout << 'A' << ' ';

    for (int i = 1; i <= n; i++) {
        std::cout << a[i];
    }

    std::cout << std::endl;
    std::cin >> c;
    return;
}
}

int main() {
    std::cin >> n >> p >> T;
    // std::cin>>(b+1);
    Ex::init();

    for (int i = 1; i <= T; i++)
        Ex::run();

    return 0;
}

详细

Subtask #1:

score: 10
Accepted

Test #1:

score: 10
Accepted
time: 41ms
memory: 3748kb

input:

1000 0.789673 1
P
N
P
P
P
P
P
P
N
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
P
P
P
P
P
P
P
P
N
N
N
P
P
P
P
N
P
P
P
P
N
N
P
P
P
N
P
P
P
P
N
P
P
P
P
P
N
N
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
P
N
N
P
N
P
P
P
P
P
P
P
P
N
P
N
P
P
P
N
N
P
P
P
P
P
P
P
P
P
P
P
P
P
P
P
P
P
P
P
P
N
...

output:

Q 1000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000...

result:

points 1.0 1.0 translate:success

Test #2:

score: 10
Accepted
time: 35ms
memory: 3876kb

input:

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

output:

Q 1000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000...

result:

points 1.0 1.0 translate:success

Test #3:

score: 10
Accepted
time: 36ms
memory: 3936kb

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
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
N
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
N
P
P
N
P
P
P
P
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
P
P
P
P
P
P
P
P
P
P
P
P
P
P
P
P
N
P
P
P
P
P
N
P
P
N
P
P
P
P
P
P
P
P
...

output:

Q 1000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000...

result:

points 1.0 1.0 translate:success

Test #4:

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

input:

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

output:

Q 1000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000...

result:

points 1.0 1.0 translate:success

Test #5:

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

input:

1000 0.907052 1
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
N
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
N
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
N
P
P
P
N
P
P
P
P
N
N
P
...

output:

Q 1000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000...

result:

points 1.0 1.0 translate:success

Test #6:

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

input:

1000 0.844418 1
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
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
N
P
P
P
P
P
P
N
P
P
P
N
P
N
P
P
N
P
P
P
N
P
P
N
P
P
P
N
N
N
P
P
P
P
N
N
P
N
N
P
P
P
P
P
P
P
N
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 1000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000...

result:

points 1.0 1.0 translate:success

Test #7:

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

input:

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

output:

Q 1000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000...

result:

points 1.0 1.0 translate:success

Test #8:

score: 10
Accepted
time: 48ms
memory: 3792kb

input:

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

output:

Q 1000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000...

result:

points 1.0 1.0 translate:success

Test #9:

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

input:

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

output:

Q 1000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000...

result:

points 1.0 1.0 translate:success

Test #10:

score: 10
Accepted
time: 32ms
memory: 3864kb

input:

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

output:

Q 1111100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000...

result:

points 1.0 1.0 translate:success

Test #11:

score: 10
Accepted
time: 37ms
memory: 3808kb

input:

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

output:

Q 1100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000...

result:

points 1.0 1.0 translate:success

Test #12:

score: 10
Accepted
time: 44ms
memory: 3812kb

input:

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

output:

Q 1000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000...

result:

points 1.0 1.0 translate:success

Test #13:

score: 10
Accepted
time: 47ms
memory: 3872kb

input:

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

output:

Q 1000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000...

result:

points 1.0 1.0 translate:success

Test #14:

score: 10
Accepted
time: 42ms
memory: 3884kb

input:

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

output:

Q 1100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000...

result:

points 1.0 1.0 translate:success

Test #15:

score: 10
Accepted
time: 40ms
memory: 3860kb

input:

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

output:

Q 1000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000...

result:

points 1.0 1.0 translate:success

Test #16:

score: 10
Accepted
time: 48ms
memory: 3748kb

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 1000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000...

result:

points 1.0 1.0 translate:success

Test #17:

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

input:

1000 0 1
N
C

output:

Q 1111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111...

result:

points 1.0 1.0 translate:success

Subtask #2:

score: 60.45
Acceptable Answer

Test #18:

score: 90
Accepted
time: 79ms
memory: 3876kb

input:

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

output:

Q 1111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111...

result:

points 1.0 1.0 Output is correct (P=0.001, F=15.1, Q=13.2) -> 90.00 points

Test #19:

score: 65.79
Acceptable Answer
time: 213ms
memory: 3828kb

input:

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

output:

Q 1111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111110000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000...

result:

points 0.7310 0.731 Output is correct (P=0.005256, F=51.1, Q=55.8) -> 65.79 points

Test #20:

score: 60.45
Acceptable Answer
time: 336ms
memory: 3816kb

input:

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

output:

Q 1111111111111111111111111111111111111111111111111111111000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000...

result:

points 0.67166666670 0.6716666667 Output is correct (P=0.011546, F=94.9, Q=106.5) -> 60.45 points

Test #21:

score: 61.31
Acceptable Answer
time: 670ms
memory: 3936kb

input:

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

output:

Q 1111111111111111111110000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000...

result:

points 0.68122222220 0.6812222222 Output is correct (P=0.028545, F=191.5, Q=213.9) -> 61.31 points

Test #22:

score: 62.57
Acceptable Answer
time: 938ms
memory: 3832kb

input:

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

output:

Q 1111111111111000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000...

result:

points 0.69522222220 0.6952222222 Output is correct (P=0.039856, F=246.3, Q=273.3) -> 62.57 points

Test #23:

score: 66.37
Acceptable Answer
time: 1364ms
memory: 3932kb

input:

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

output:

Q 1111111100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000...

result:

points 0.73744444440 0.7374444444 Output is correct (P=0.068648, F=366.2, Q=398.8) -> 66.37 points

Test #24:

score: 71.05
Acceptable Answer
time: 1789ms
memory: 3816kb

input:

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

output:

Q 1111111100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000...

result:

points 0.78944444440 0.7894444444 Output is correct (P=0.104571, F=490.3, Q=523.0) -> 71.05 points

Test #25:

score: 77.82
Acceptable Answer
time: 2127ms
memory: 3936kb

input:

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

output:

Q 1111100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000...

result:

points 0.86466666670 0.8646666667 Output is correct (P=0.158765, F=639.1, Q=664.1) -> 77.82 points

Test #26:

score: 81.41
Acceptable Answer
time: 2584ms
memory: 3828kb

input:

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

output:

Q 1110000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000...

result:

points 0.90455555560 0.9045555556 Output is correct (P=0.2, F=731.4, Q=750.7) -> 81.41 points