제출 #63331

#제출 시각아이디문제언어결과실행 시간메모리
63331hamzqq9팀들 (IOI15_teams)C++14
34 / 100
4014 ms10196 KiB
#include "teams.h" #include<bits/stdc++.h> using namespace std; #define st first #define nd second #define MAX 100005 #define sz(x) ((int)x.size()) int N; pair<int,int> A[MAX]; void init(int N, int A[], int B[]) { ::N=N; for(int i=0;i<N;i++) ::A[i+1].st=A[i],::A[i+1].nd=B[i]; sort(::A+1,::A+1+N); } int can(int M, int K[]) { sort(K,K+M); multiset<int> s; int tut=0; for(int i=0;i<M;i++) { while(tut+1<=N && A[tut+1].st<=K[i]) { tut++; s.insert(A[tut].nd); } while(sz(s) && *s.begin()<K[i]) s.erase(s.begin()); if(sz(s)<K[i]) return 0; while(K[i]--) { s.erase(s.begin()); } } return 1; }

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

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