Submission #36398

#TimeUsernameProblemLanguageResultExecution timeMemory
36398mohammad_kilaniCarnival (CEOI14_carnival)C++14
20 / 100
63 ms3188 KiB
#include <bits/stdc++.h> using namespace std; #define mod 1000000007 #define oo 2000000000 const int N = 300010; int num[N]; int main() { //freopen("in.txt","r",stdin); int n , cnt = 1; scanf("%d",&n); for(int i=1;i<=n;i++){ if(num[i]) continue; num[i] = cnt; for(int j=i+1;j<=n;j++){ if(num[j]) continue; printf("2 %d %d\n",i,j); fflush(stdout); int a; scanf("%d",&a); if(a == 1) num[j] = cnt; } cnt++; } putchar('0'); for(int i=1;i<=n;i++) printf(" %d",num[i]); puts(""); return 0; }

Compilation message (stderr)

carnival.cpp: In function 'int main()':
carnival.cpp:11:16: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
  scanf("%d",&n);
                ^
carnival.cpp:20:18: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
    scanf("%d",&a);
                  ^
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...