Submission #374211

# Submission time Handle Problem Language Result Execution time Memory
374211 2021-03-06T21:55:17 Z MilosMilutinovic Carnival (CEOI14_carnival) C++14
0 / 100
1 ms 512 KB
#include <bits/stdc++.h>
using namespace std;
const int N=200;
int ans[N];
int main(){
    int n;scanf("%i",&n);
    int cnt=0;
    for(int i=1;i<=n;i++){
        if(ans[i]>0)continue;
        ans[i]=++cnt;
        for(int j=i+1;j<=n;j++){
            if(ans[j]>0)continue;
            fflush(stdout);
            printf("2 %i %i\n",i,j);
            int x;scanf("%i",&x);
            if(x==1)ans[j]=ans[i];
        }
    }
    printf("0 ");
    for(int i=1;i<=n;i++)printf("%i ",ans[i]);
    return 0;
}

Compilation message

carnival.cpp: In function 'int main()':
carnival.cpp:6:16: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
    6 |     int n;scanf("%i",&n);
      |           ~~~~~^~~~~~~~~
carnival.cpp:15:24: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
   15 |             int x;scanf("%i",&x);
      |                   ~~~~~^~~~~~~~~
# Verdict Execution time Memory Grader output
1 Execution timed out 1 ms 364 KB Time limit exceeded (wall clock)
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Execution timed out 1 ms 364 KB Time limit exceeded (wall clock)
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Execution timed out 1 ms 512 KB Time limit exceeded (wall clock)
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Execution timed out 1 ms 364 KB Time limit exceeded (wall clock)
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Execution timed out 1 ms 364 KB Time limit exceeded (wall clock)
2 Halted 0 ms 0 KB -