Submission #8586554


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);
        printf("\n");
        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);
            printf("\n");
            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);
            printf("\n");
            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");
        }
        printf("\n");
    return 0;
}

Submission Info

Submission Time
Task E - Majority of Balls
User xxkiritoxx
Language C++14 (GCC 5.4.1)
Score 0
Code Size 1806 Byte
Status WA
Exec Time 20 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
AC × 1
AC × 43
WA × 22
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 AC 3 ms 720 KB
in02.txt AC 3 ms 720 KB
in03.txt AC 3 ms 720 KB
in04.txt AC 3 ms 720 KB
in05.txt AC 3 ms 724 KB
in06.txt AC 3 ms 720 KB
in07.txt AC 3 ms 720 KB
in08.txt AC 3 ms 720 KB
in09.txt AC 3 ms 680 KB
in10.txt AC 3 ms 720 KB
in11.txt AC 3 ms 720 KB
in12.txt AC 3 ms 724 KB
in13.txt AC 3 ms 716 KB
in14.txt AC 3 ms 716 KB
in15.txt AC 3 ms 720 KB
in16.txt AC 3 ms 720 KB
in17.txt AC 3 ms 672 KB
in18.txt AC 3 ms 720 KB
in19.txt AC 3 ms 720 KB
in20.txt AC 3 ms 720 KB
in21.txt AC 3 ms 720 KB
in22.txt AC 3 ms 724 KB
in23.txt AC 18 ms 724 KB
in24.txt AC 18 ms 592 KB
in25.txt WA 18 ms 592 KB
in26.txt WA 19 ms 720 KB
in27.txt AC 18 ms 592 KB
in28.txt AC 17 ms 588 KB
in29.txt AC 18 ms 720 KB
in30.txt WA 18 ms 592 KB
in31.txt AC 17 ms 672 KB
in32.txt WA 19 ms 724 KB
in33.txt WA 18 ms 720 KB
in34.txt AC 18 ms 716 KB
in35.txt WA 19 ms 596 KB
in36.txt WA 18 ms 720 KB
in37.txt WA 19 ms 720 KB
in38.txt AC 19 ms 720 KB
in39.txt AC 17 ms 660 KB
in40.txt WA 19 ms 720 KB
in41.txt WA 19 ms 720 KB
in42.txt AC 17 ms 720 KB
in43.txt AC 17 ms 596 KB
in44.txt WA 20 ms 720 KB
in45.txt WA 20 ms 720 KB
in46.txt WA 19 ms 596 KB
in47.txt WA 18 ms 720 KB
in48.txt AC 18 ms 592 KB
in49.txt AC 18 ms 716 KB
in50.txt WA 19 ms 724 KB
in51.txt AC 18 ms 720 KB
in52.txt AC 18 ms 720 KB
in53.txt WA 19 ms 720 KB
in54.txt WA 18 ms 724 KB
in55.txt WA 19 ms 720 KB
in56.txt WA 19 ms 720 KB
in57.txt WA 19 ms 592 KB
in58.txt WA 19 ms 720 KB
in59.txt AC 3 ms 720 KB
in60.txt AC 4 ms 652 KB
in61.txt AC 5 ms 716 KB
in62.txt AC 7 ms 652 KB
in63.txt AC 11 ms 716 KB
in64.txt WA 18 ms 720 KB
sample_01.txt AC 3 ms 720 KB