제출 #707674

#제출 시각UTC-0아이디문제언어결과실행 시간메모리
7076742023-03-09 17:55:04SamNguyen팀들 (IOI15_teams)C++14
0 / 100
132 ms16336 KiB
#include "teams.h"
#include <bits/stdc++.h>
using namespace std;
inline int IN_RANGE(int x, pair<int, int> p) { return p.first <= x and x <= p.second; }
vector<pair<int, int>> students;
void init(int N, int L[], int R[]) {
students.resize(N);
for (int i = 0; i < N; i++)
students[i] = make_pair(L[i], R[i]);
sort(students.begin(), students.end());
}
int can(int M, int K[]) {
vector<int> groups(K, K + M);
sort(groups.begin(), groups.end());
set<int> rights;
auto it = students.begin();
for (int g : groups) {
while (it != students.end() and IN_RANGE(g, *it)) {
rights.insert(it->second);
it++;
}
if (rights.empty() or *rights.begin() < g)
return false;
 
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...