제출 #126062

#제출 시각아이디문제언어결과실행 시간메모리
126062dragonslayerit팀들 (IOI15_teams)C++14
0 / 100
4041 ms57204 KiB
#include "teams.h" #include <vector> #include <set> std::vector<int> right[500005]; int N; void init(int N, int A[], int B[]) { ::N=N; for(int i=0;i<N;i++){ right[A[i]].push_back(B[i]); } } int can(int M, int K[]) { std::vector<int> freq(N+1); for(int i=0;i<M;i++){ freq[K[i]]+=K[i]; } std::multiset<int> active; for(int i=1;i<=N;i++){ for(int v:right[i]){ active.insert(v); } while(freq[i]--){ if(active.empty()) return 0; active.erase(active.begin()); } } return 1; }

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

teams.cpp: In function 'void init(int, int*, int*)':
teams.cpp:8:34: warning: declaration of 'N' shadows a global declaration [-Wshadow]
 void init(int N, int A[], int B[]) {
                                  ^
teams.cpp:6:5: note: shadowed declaration is here
 int 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...