# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
726668 | TheSahib | 팀들 (IOI15_teams) | C++17 | 4033 ms | 38948 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include "teams.h"
#include <bits/stdc++.h>
#define ll long long
#define pii pair<int, int>
using namespace std;
int n;
vector<pii> v;
void init(int N, int A[], int B[])
{
n = N;
for (int i = 0; i < n; i++)
{
v.push_back({A[i], B[i]});
}
}
int can(int M, int K[])
{
sort(K, K + M);
vector<pii> events[n + 1];
for (int i = 0; i < n; i++)
{
events[v[i].first].push_back({0, i});
if(v[i].second + 1 <= n){
events[v[i].second + 1].push_back({1, i});
}
}
int j = 0;
multiset<pii> s;
for (int x = 0; x <= n && j < M; x++)
{
for(auto& e:events[x]){
if(e.first == 0){
s.insert({v[e.second].second, v[e.second].first});
}
else{
auto itr = s.find({v[e.second].second, v[e.second].first});
if(itr != s.end()){
s.erase(itr);
}
}
}
while(x == K[j]){
if(s.size() < K[j]){
return false;
}
for (int i = 0; i < K[j]; i++)
{
s.erase(s.begin());
}
++j;
if(j == M) break;
}
}
return true;
}
컴파일 시 표준 에러 (stderr) 메시지
# | 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... |