제출 #166571

#제출 시각아이디문제언어결과실행 시간메모리
166571dydCarnival (CEOI14_carnival)C++14
0 / 100
2 ms376 KiB
#include<bits/stdc++.h> using namespace std; const int MAXN=200; int c[MAXN]; int main(){ int n,cur=1; scanf("%d",&n); for(int i=1;i<=n;i++){ if(c[i]==0){ c[i]=cur; cur++; } for(int j=i+1;j<=n;j++){ if(c[j]!=0) continue; printf("2 %d %d",i,j); int x; scanf("%d",&x); if(x==1) c[j]=c[i]; } } printf("0"); for(int i=1;i<=n;i++) printf(" %d",c[i]); return 0; }

컴파일 시 표준 에러 (stderr) 메시지

carnival.cpp: In function 'int main()':
carnival.cpp:7:7: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
  scanf("%d",&n);
  ~~~~~^~~~~~~~~
carnival.cpp:17:9: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
    scanf("%d",&x);
    ~~~~~^~~~~~~~~
#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...