제출 #222463

#제출 시각아이디문제언어결과실행 시간메모리
222463rainyGrudanje (COCI19_grudanje)C++14
0 / 70
58 ms4476 KiB
#include<bits/stdc++.h> #define MAXN 112345 #define MAXQ 112345 using namespace std; char wd[MAXN]; int N; int Q,A[MAXQ],B[MAXQ]; int P[MAXN]; bool st3=true; int ss[MAXQ]; bool isp(){ for(int i=0;i<Q;i++) if(ss[i]>0)return false; return true; } int main(){ scanf("%s",&wd); for(int i=0;i<10;i++){ if(wd[i]!='a'&&wd[i]!='\0')st3=false; if(wd[i]=='\0'){N=i;break;} } scanf("%d",&Q); for(int i=0;i<Q;i++){scanf("%d%d",&A[i],&B[i]);A[i]--;B[i]--;} for(int i=0;i<N;i++){ scanf("%d",&P[i]); P[i]--; } memset(ss,0,sizeof(ss)); assert(st3); if(st3){ for(int i=0;i<Q;i++){ ss[i]=B[i]-A[i]; printf("%d: %d, %d, %d\n",i,ss[i],B[i],A[i]); } if(isp()){ printf("0\n");return 0; } for(int i=0;i<N;i++){ //printf("i=%d\n",i); for(int j=0;j<Q;j++){ if(A[j]<=P[i]&&P[i]<=B[j]){ss[j]--;} } if(isp()){ printf("%d\n",i+1); return 0; } } } return 0; }

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

grudanje.cpp: In function 'int main()':
grudanje.cpp:19:19: warning: format '%s' expects argument of type 'char*', but argument 2 has type 'char (*)[112345]' [-Wformat=]
     scanf("%s",&wd);
                ~~~^
grudanje.cpp:19:10: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
     scanf("%s",&wd);
     ~~~~~^~~~~~~~~~
grudanje.cpp:24:10: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
     scanf("%d",&Q);
     ~~~~~^~~~~~~~~
grudanje.cpp:25:31: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
     for(int i=0;i<Q;i++){scanf("%d%d",&A[i],&B[i]);A[i]--;B[i]--;}
                          ~~~~~^~~~~~~~~~~~~~~~~~~~
grudanje.cpp:27:14: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
         scanf("%d",&P[i]);
         ~~~~~^~~~~~~~~~~~
#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...
#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...