제출 #386642

#제출 시각아이디문제언어결과실행 시간메모리
386642alishahali1382팀들 (IOI15_teams)C++14
0 / 100
4077 ms12244 KiB
#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 timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...