제출 #603674

#제출 시각아이디문제언어결과실행 시간메모리
603674StrawHatWess팀들 (IOI15_teams)C++17
34 / 100
4078 ms45492 KiB
#include "teams.h" #include <bits/stdc++.h> using namespace std; #define FOR(i,a,b) for(int i=a; i<b; i++) typedef vector<int>vi; #define sz(x) (int)x.size() #define all(x) begin(x),end(x) #define pb push_back //------------------------------- const int MX=5e5+10; int N; vi vec[MX]; void init(int N, int A[], int B[]) { ::N=N; FOR(i,0,N) vec[A[i]].pb(B[i]); } int can(int M, int K[]) { vi here(N+1,0); FOR(i,0,M) here[K[i]]++; //FOR(i,1,N+1) cout << here[i] << ' '; cout << endl; multiset<int>s; FOR(i,1,N+1){ for(int x: vec[i]) s.insert(x); while(sz(s) && *s.begin()<i) s.erase(s.begin()); FOR(k,0,here[i]){ if(sz(s)<i) return 0; int rep=i; while(rep--) s.erase(s.begin()); } } return 1; }

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

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