제출 #69735

#제출 시각아이디문제언어결과실행 시간메모리
69735Vahan팀들 (IOI15_teams)C++17
0 / 100
4035 ms39496 KiB
#include "teams.h" #include<vector> #include<algorithm> using namespace std; struct student{ int l; int r; }; student g[600000]; int n,K_mn[600000]; int cmp(student a,student b) { if(a.r<b.r) return 1; if(a.r==b.r && a.l<b.l) return 1; return 0; } void init(int N, int A[], int B[]) { for(int i=0;i<N;i++) g[i]={A[i],B[i]}; n=N; sort(g,g+N,cmp); } int can(int M, int K[]) { sort(K,K+M); for(int i=0;i<M;i++) K_mn[i]=K[i]; int t=0; for(int i=0;i<n;i++) { if(g[i].l<=K[t] && g[i].r>=K[t]) { K_mn[t]--; if(K_mn[t]==0) t++; } if(t==M) break; } if(t==M) return 1; return 0; }

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

teams.cpp: In function 'int can(int, int*)':
teams.cpp:42:5: warning: this 'if' clause does not guard... [-Wmisleading-indentation]
     if(t==M)
     ^~
teams.cpp:44:2: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the 'if'
  return 0;
  ^~~~~~
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...