Submission #8586005


Source Code Expand

Copy
#include <bits/stdc++.h>
#define inf (long long)(1e18)
using namespace std;



int main(void){
    int N;
    scanf("%d", &N);
    int ans[2*N]; // 1:red -1:blu
    int sento;
    int mae=0;
    for(int i=0;i<=N;i++){
        printf("? ");
        for(int j=1;j<=N;j++)printf("%d ", i+j);
        fflush(stdout);
        string s;
        cin >> s;
        if(s[0]=='R'){
            if(i==0)mae=1;
            else if(mae==-1){
                sento = i-1;
                ans[i-1] = -1;
                ans[sento+N] = 1;
                break;
            }
        }
        else{
            if(i==0)mae=-1;
            else if(mae == 1){
                sento = i-1;
                ans[i-1] = 1;
                ans[sento+N] = -1;
                break;
            }
        }
    }
    for(int i=0;i<2*N;i++){
        if(i < sento || i > sento + N ){
            printf("? ");
            for(int j=sento+1;j<sento+N;j++)printf("%d ", j+1);
            printf("%d", i+1);
            fflush(stdout);
            string s;
            cin >> s;
            if(s[0] =='R')ans[i]=1;
            else ans[i]=-1;
        }
        if( i > sento && i < sento + N){
            printf("? ");
            for(int j=0;j<sento;j++)printf("%d ", j+1);
            for(int j=sento+N+1;j<2*N;j++)printf("%d ", j+1);
            printf("%d", i+1);
            fflush(stdout);
            string s;
            cin >> s;
            if(s[0] =='R')ans[i]=1;
            else ans[i]=-1;            
        }
    }
    printf("! ");
    for(int i=0;i<2*N;i++){
        if(ans[i]==-1)printf("B");
        else printf("R");
        }
    return 0;
}

Submission Info

Submission Time
Task E - Majority of Balls
User xxkiritoxx
Language C++14 (GCC 5.4.1)
Score 0
Code Size 1706 Byte
Status TLE
Exec Time 2107 ms
Memory 724 KB

Compile Error

./Main.cpp: In function ‘int main()’:
./Main.cpp:9:20: warning: ignoring return value of ‘int scanf(const char*, ...)’, declared with attribute warn_unused_result [-Wunused-result]
     scanf("%d", &N);
                    ^

Judge Result

Set Name Sample All
Score / Max Score 0 / 0 0 / 800
Status
TLE × 1
TLE × 65
Set Name Test Cases
Sample sample_01.txt
All in01.txt, in02.txt, in03.txt, in04.txt, in05.txt, in06.txt, in07.txt, in08.txt, in09.txt, in10.txt, in11.txt, in12.txt, in13.txt, in14.txt, in15.txt, in16.txt, in17.txt, in18.txt, in19.txt, in20.txt, in21.txt, in22.txt, in23.txt, in24.txt, in25.txt, in26.txt, in27.txt, in28.txt, in29.txt, in30.txt, in31.txt, in32.txt, in33.txt, in34.txt, in35.txt, in36.txt, in37.txt, in38.txt, in39.txt, in40.txt, in41.txt, in42.txt, in43.txt, in44.txt, in45.txt, in46.txt, in47.txt, in48.txt, in49.txt, in50.txt, in51.txt, in52.txt, in53.txt, in54.txt, in55.txt, in56.txt, in57.txt, in58.txt, in59.txt, in60.txt, in61.txt, in62.txt, in63.txt, in64.txt, sample_01.txt
Case Name Status Exec Time Memory
in01.txt TLE 2103 ms 716 KB
in02.txt TLE 2103 ms 720 KB
in03.txt TLE 2103 ms 720 KB
in04.txt TLE 2103 ms 716 KB
in05.txt TLE 2103 ms 720 KB
in06.txt TLE 2103 ms 724 KB
in07.txt TLE 2107 ms 724 KB
in08.txt TLE 2103 ms 592 KB
in09.txt TLE 2103 ms 720 KB
in10.txt TLE 2103 ms 720 KB
in11.txt TLE 2103 ms 720 KB
in12.txt TLE 2103 ms 720 KB
in13.txt TLE 2103 ms 716 KB
in14.txt TLE 2103 ms 596 KB
in15.txt TLE 2103 ms 592 KB
in16.txt TLE 2103 ms 720 KB
in17.txt TLE 2103 ms 720 KB
in18.txt TLE 2103 ms 724 KB
in19.txt TLE 2103 ms 724 KB
in20.txt TLE 2103 ms 724 KB
in21.txt TLE 2103 ms 724 KB
in22.txt TLE 2103 ms 720 KB
in23.txt TLE 2103 ms 724 KB
in24.txt TLE 2103 ms 724 KB
in25.txt TLE 2103 ms 720 KB
in26.txt TLE 2103 ms 720 KB
in27.txt TLE 2103 ms 724 KB
in28.txt TLE 2103 ms 716 KB
in29.txt TLE 2103 ms 724 KB
in30.txt TLE 2103 ms 592 KB
in31.txt TLE 2103 ms 716 KB
in32.txt TLE 2103 ms 724 KB
in33.txt TLE 2103 ms 592 KB
in34.txt TLE 2103 ms 720 KB
in35.txt TLE 2103 ms 716 KB
in36.txt TLE 2103 ms 724 KB
in37.txt TLE 2103 ms 720 KB
in38.txt TLE 2103 ms 724 KB
in39.txt TLE 2103 ms 592 KB
in40.txt TLE 2103 ms 592 KB
in41.txt TLE 2103 ms 716 KB
in42.txt TLE 2103 ms 596 KB
in43.txt TLE 2103 ms 720 KB
in44.txt TLE 2103 ms 588 KB
in45.txt TLE 2103 ms 596 KB
in46.txt TLE 2103 ms 592 KB
in47.txt TLE 2103 ms 588 KB
in48.txt TLE 2103 ms 592 KB
in49.txt TLE 2103 ms 720 KB
in50.txt TLE 2103 ms 724 KB
in51.txt TLE 2103 ms 724 KB
in52.txt TLE 2103 ms 720 KB
in53.txt TLE 2103 ms 724 KB
in54.txt TLE 2103 ms 720 KB
in55.txt TLE 2103 ms 720 KB
in56.txt TLE 2103 ms 720 KB
in57.txt TLE 2103 ms 588 KB
in58.txt TLE 2107 ms 720 KB
in59.txt TLE 2103 ms 592 KB
in60.txt TLE 2103 ms 724 KB
in61.txt TLE 2103 ms 720 KB
in62.txt TLE 2103 ms 724 KB
in63.txt TLE 2103 ms 720 KB
in64.txt TLE 2103 ms 596 KB
sample_01.txt TLE 2103 ms 720 KB