제출 #131385

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

컴파일 시 표준 에러 (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;
           ^
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...