QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#682059#9162. COVID testsRDFZchenyy70.28 2287ms3940kbC++144.0kb2024-10-27 13:41:302024-10-27 13:41:32

Judging History

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

  • [2024-10-27 13:41:32]
  • 评测
  • 测评结果:70.28
  • 用时:2287ms
  • 内存:3940kb
  • [2024-10-27 13:41:30]
  • 提交

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{
    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 guess;
    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,guess--;
            else a[l]=ask(l,l),guess-=a[l];
            return;
        }
        int x=r-l+1;
		if(guess<=0&&o==1) Sol1::query(l,r);
		else 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);
		guess=ceil(n*p)+5;
        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;
}

Details

Tip: Click on the bar to expand more detailed information

Subtask #1:

score: 10
Accepted

Test #1:

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

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: 46ms
memory: 3824kb

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: 41ms
memory: 3920kb

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: 41ms
memory: 3816kb

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: 46ms
memory: 3940kb

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: 48ms
memory: 3816kb

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: 46ms
memory: 3876kb

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: 45ms
memory: 3896kb

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: 38ms
memory: 3896kb

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: 39ms
memory: 3884kb

input:

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

output:

Q 1111100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000...

result:

points 1.0 1.0 translate:success

Test #11:

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

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: 39ms
memory: 3896kb

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: 48ms
memory: 3824kb

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: 3748kb

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: 35ms
memory: 3936kb

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: 44ms
memory: 3828kb

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: 434ms
memory: 3860kb

input:

1000 0 1
N
C

output:

Q 1111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111...

result:

points 1.0 1.0 translate:success

Subtask #2:

score: 60.28
Acceptable Answer

Test #18:

score: 90
Accepted
time: 83ms
memory: 3816kb

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.42
Acceptable Answer
time: 237ms
memory: 3828kb

input:

1000 0.005256 300
P
N
P
N
P
P
N
P
N
N
P
P
N
N
N
N
N
N
P
P
P
N
P
P
P
P
N
N
N
N
N
N
N
N
P
P
N
N
N
N
P
N
N
N
P
N
P
N
N
P
P
P
N
N
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
...

output:

Q 1111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111110000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000...

result:

points 0.72688888890 0.7268888889 Output is correct (P=0.005256, F=51.1, Q=55.9) -> 65.42 points

Test #20:

score: 60.28
Acceptable Answer
time: 405ms
memory: 3936kb

input:

1000 0.011546 300
P
P
N
P
P
N
P
N
N
P
N
P
P
N
N
N
N
N
N
P
P
N
P
N
P
N
N
N
N
P
N
P
P
P
P
P
N
P
P
N
P
P
P
N
N
N
N
P
P
P
P
N
P
N
N
P
N
N
N
N
N
N
N
N
N
N
N
P
N
P
N
N
P
P
N
N
N
P
N
P
P
P
P
P
N
N
N
N
N
N
P
P
P
P
P
P
N
N
N
N
N
P
P
P
P
P
P
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
...

output:

Q 1111111111111111111111111111111111111111111111111111111000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000...

result:

points 0.66977777780 0.6697777778 Output is correct (P=0.011546, F=94.9, Q=106.6) -> 60.28 points

Test #21:

score: 61.14
Acceptable Answer
time: 708ms
memory: 3808kb

input:

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

output:

Q 1111111111111111111110000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000...

result:

points 0.67933333330 0.6793333333 Output is correct (P=0.028545, F=191.5, Q=214.1) -> 61.14 points

Test #22:

score: 62.21
Acceptable Answer
time: 943ms
memory: 3748kb

input:

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

output:

Q 1111111111111000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000...

result:

points 0.69122222220 0.6912222222 Output is correct (P=0.039856, F=246.3, Q=273.8) -> 62.21 points

Test #23:

score: 66.21
Acceptable Answer
time: 1380ms
memory: 3824kb

input:

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

output:

Q 1111111100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000...

result:

points 0.73566666670 0.7356666667 Output is correct (P=0.068648, F=366.2, Q=399.1) -> 66.21 points

Test #24:

score: 70.82
Acceptable Answer
time: 1695ms
memory: 3752kb

input:

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

output:

Q 1111111100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000...

result:

points 0.78688888890 0.7868888889 Output is correct (P=0.104571, F=490.3, Q=523.5) -> 70.82 points

Test #25:

score: 77.57
Acceptable Answer
time: 2078ms
memory: 3748kb

input:

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

output:

Q 1111100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000...

result:

points 0.86188888890 0.8618888889 Output is correct (P=0.158765, F=639.1, Q=664.7) -> 77.57 points

Test #26:

score: 81.05
Acceptable Answer
time: 2287ms
memory: 3932kb

input:

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

output:

Q 1110000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000...

result:

points 0.90055555560 0.9005555556 Output is correct (P=0.2, F=731.4, Q=751.6) -> 81.05 points