제출 #396333

#제출 시각아이디문제언어결과실행 시간메모리
396333definitelynotmee팀들 (IOI15_teams)C++98
34 / 100
4078 ms19856 KiB
#include <bits/stdc++.h> #include "teams.h" #define mp make_pair #define mt make_tuple #define ff first #define ss second using namespace std; typedef long long ll; typedef pair<int,int> pii; typedef pair<ll,ll> pll; const ll INFL = (1LL<<62)-1; const int INF = (1<<30)-1; const int MAXN = 500001; int n; pii v [MAXN]; void init (int N, int A[], int B[]){ n = N; for(int i = 0; i < n; i++){ v[i] = {A[i], B[i]}; } sort(v, v+n); } int can (int m, int k[]){ sort(k, k+m); multiset<int> active; int p1 = 0, p2 = 0; for(int i = 1; i <= n && p2 < m; i++){ while(p1 < n && v[p1].ff == i){ active.insert(v[p1].ss); p1++; } while(p2 < m && k[p2] == i){ if(active.size() < k[p2]) return 0; for(int j = 0; j < k[p2]; j++) active.erase(active.begin()); p2++; } while(!active.empty() && *active.begin() == i) active.erase(active.begin()); } return 1; }

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

teams.cpp: In function 'int can(int, int*)':
teams.cpp:37:30: warning: comparison of integer expressions of different signedness: 'std::multiset<int>::size_type' {aka 'long unsigned int'} and 'int' [-Wsign-compare]
   37 |             if(active.size() < k[p2])
      |                ~~~~~~~~~~~~~~^~~~~~~
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...