제출 #131383

#제출 시각아이디문제언어결과실행 시간메모리
131383antimirage팀들 (IOI15_teams)C++14
0 / 100
4011 ms19968 KiB
#include "teams.h" #include <bits/stdc++.h> 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 <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); while (j < m && i >= j && !q.empty() && -q.top() <= k[j]) { cn[j]--; q.pop(); if (cn[j] == 0) j++; } } return j == m; }

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

teams.cpp: In function 'void init(int, int*, int*)':
teams.cpp:12:34: warning: declaration of 'N' shadows a global declaration [-Wshadow]
 void init(int N, int l[], int r[]) {
                                  ^
teams.cpp:6: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...