제출 #222858

#제출 시각아이디문제언어결과실행 시간메모리
222858dolphingarlic팀들 (IOI15_teams)C++14
34 / 100
4074 ms58432 KiB
#include "teams.h"
#include <bits/stdc++.h>
#define FOR(i, x, y) for (int i = x; i < y; i++)
using namespace std;

multiset<pair<int, int>> students;

void init(int N, int A[], int B[]) {
	FOR(i, 0, N) students.insert({B[i], A[i]});
}

int can(int M, int K[]) {
	sort(K, K + M);
	multiset<pair<int, int>> cp = students;
	FOR(i, 0, M) {
		vector<pair<int, int>> to_remove;
		for (pair<int, int> j : cp) {
			if (K[i] <= j.first && K[i] >= j.second) to_remove.push_back(j);
			if (to_remove.size() == K[i]) break;
		}
		if (to_remove.size() != K[i]) return 0;
		for (pair<int, int> j : to_remove) cp.erase(cp.find(j));
	}
	return 1;
}

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

teams.cpp: In function 'int can(int, int*)':
teams.cpp:19:25: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
    if (to_remove.size() == K[i]) break;
        ~~~~~~~~~~~~~~~~~^~~~~~~
teams.cpp:21:24: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
   if (to_remove.size() != K[i]) 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...