제출 #131387

#제출 시각아이디문제언어결과실행 시간메모리
131387antimirage팀들 (IOI15_teams)C++14
0 / 100
4093 ms10744 KiB
#include "teams.h" #include <bits/stdc++.h> #define fr first #define sc second using namespace std; const int N = 1e5 + 5; int cn[N], n; pair <int, int> a[N]; void init(int N, int l[], int r[]) { n = N; for (int i = 0; i < n; i++) { a[i] = {r[i], l[i]}; } sort(a, a + n); } int can(int m, int k[]) { sort(k, k + m); int j = 0; priority_queue <int> q; for (int i = 0; i < m; i++) { int cn = k[i]; while (j < n && cn > 0) { while (j < n && a[j].fr < k[i]) j++; q.push(-a[j].sc); j++; if (-q.top() <= k[i]) { cn--; q.pop(); } } if (j == n && cn > 0) return false; } return true; }

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

teams.cpp: In function 'void init(int, int*, int*)':
teams.cpp:15:34: warning: declaration of 'N' shadows a global declaration [-Wshadow]
 void init(int N, int l[], int r[]) {
                                  ^
teams.cpp:9:11: note: shadowed declaration is here
 const int N = 1e5 + 5;
           ^
teams.cpp: In function 'int can(int, int*)':
teams.cpp:29:7: warning: declaration of 'cn' shadows a global declaration [-Wshadow]
   int cn = k[i];
       ^~
teams.cpp:11:5: note: shadowed declaration is here
 int cn[N], n;
     ^~
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...