답안 #1039284

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
1039284 2024-07-30T16:23:10 Z Dalek_of_Rivia COVID tests (CEOI24_covid) C++17
0 / 100
7000 ms 344 KB
#include <bits/stdc++.h>
using namespace std;

bool ans[1000];
int N;

bool ask(int inf, int sup, bool preg){
    char c='P';
    if(preg){
        cout<<"Q ";
        for(int i=0; i<N; i++){
            if((i<inf)|(i>sup)){
                cout<<0;
            }else{
                cout<<1;
            }
        }
        cout<<endl;
        cin>>c;
    }
    if(c=='N'){
        for(int i=inf; i<=sup; i++) ans[i]=false;
        return false;
    }else if(inf==sup){
        ans[inf]=true;
        return true;
    }else{
        int m = (inf+sup)/2;
        bool tau=ask(inf, m, true);
        ask(m+1, sup, tau);
        return true;
    }
}

int main()
{
    int T;
    double P;
    cin>>N>>P>>T;
    double jaskier=0.5;
    
    for(int dalekofrivia=0; dalekofrivia<T; dalekofrivia++){
        int lambda=jaskier/P;
        for(int i=0; i<N; i+=lambda) ask(i, min(i+lambda, N)-1, true);
        cout<<"A ";
        for(int i=0; i<N; i++) cout<<ans[i];
        cout<<endl;
        char C;
        cin>>C;
        if(C!='C') break;
    }

    return 0;
}
# 결과 실행 시간 메모리 Grader output
1 Correct 0 ms 344 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Execution timed out 7023 ms 344 KB Time limit exceeded
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 181 ms 344 KB Output is correct (P=0.001, F=15.1, Q=14.0) -> 90.00 points
2 Correct 703 ms 344 KB Output is correct (P=0.005256, F=51.1, Q=59.5) -> 54.30 points
3 Correct 1319 ms 344 KB Output is correct (P=0.011546, F=94.9, Q=114.6) -> 49.17 points
4 Correct 2673 ms 344 KB Output is correct (P=0.028545, F=191.5, Q=225.7) -> 52.50 points
5 Correct 3253 ms 344 KB Output is correct (P=0.039856, F=246.3, Q=293.0) -> 51.18 points
6 Correct 4946 ms 344 KB Output is correct (P=0.068648, F=366.2, Q=423.2) -> 55.47 points
7 Correct 6218 ms 344 KB Output is correct (P=0.104571, F=490.3, Q=541.0) -> 63.67 points
8 Execution timed out 7034 ms 344 KB Time limit exceeded
9 Halted 0 ms 0 KB -