이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include "teams.h"
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<int, int> pii;
#define debug(x) {cerr<<#x<<"="<<x<<"\n";}
#define debug2(x, y) {cerr<<#x<<", "<<#y<<"="<<x<<", "<<y<<"\n";}
#define debugp(p) {cerr<<#p<<"={"<<p.first<<", "<<p.second<<"}\n";}
#define all(x) x.begin(), x.end()
#define pb push_back
const int MAXN=500010, SQ=320;
int n, m, k, x, y;
int A[MAXN], B[MAXN], C[MAXN];
priority_queue<int, vector<int>, greater<int>> pq;
void init(int nn, int AA[], int BB[]){
n=nn;
vector<pii> vec;
for (int i=0; i<n; i++) vec.pb({AA[i], BB[i]});
sort(all(vec));
for (int i=0; i<n; i++) A[i+1]=vec[i].first, B[i+1]=vec[i].second;
}
bool SolveBig(){
while (pq.size()) pq.pop();
int j=1;
for (int i=0; i<m; i++){
while (j<=n && A[j]<=C[i]) pq.push(B[j++]);
int t=C[i];
if (pq.size()<t) return 0;
while (t--) pq.pop();
}
return 1;
}
int can(int mm, int CC[]) {
m=mm;
for (int i=0; i<m; i++) C[i]=CC[i];
sort(C, C+m);
return SolveBig();
}
컴파일 시 표준 에러 (stderr) 메시지
teams.cpp: In function 'bool SolveBig()':
teams.cpp:32:16: warning: comparison of integer expressions of different signedness: 'std::priority_queue<int, std::vector<int>, std::greater<int> >::size_type' {aka 'long unsigned int'} and 'int' [-Wsign-compare]
32 | if (pq.size()<t) return 0;
| ~~~~~~~~~^~
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |