제출 #65218

#제출 시각아이디문제언어결과실행 시간메모리
65218Talant팀들 (IOI15_teams)C++17
34 / 100
4032 ms24484 KiB
#include "teams.h" //#include "grader.cpp" #include <bits/stdc++.h> #define mk make_pair #define sc second #define fr first #define pb push_back using namespace std; const int NN = (1e6 + 5); const int inf = (1e9 + 7); int n,m; int a[NN],b[NN]; int k[NN]; int u[NN]; vector <pair<int,int> > v; void init(int N, int A[], int B[]) { n = N; for (int i = 0; i < n; i ++) a[i] = A[i],b[i] = B[i]; } int can(int M, int K[]) { int m = M; v.clear(); for (int i = 0; i < m; i ++) k[i] = K[i]; sort (k,k + m); for (int i = 0; i < n; i ++) v.pb(mk(b[i],a[i])),u[i] = 0; sort (v.begin(),v.end()); for (int i = 0; i < m; i ++) { int cn = 0; for (int j = 0; j < n; j ++) { if (!u[j] && v[j].fr >= k[i] && v[j].sc <= k[i]) u[j] = 1,cn ++; if (cn == k[i]) break; } if (cn != k[i]) return 0; } return 1; }

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

teams.cpp: In function 'int can(int, int*)':
teams.cpp:30:11: warning: declaration of 'm' shadows a global declaration [-Wshadow]
       int m = M;
           ^
teams.cpp:16:7: note: shadowed declaration is here
 int n,m;
       ^
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...