| # | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
|---|---|---|---|---|---|---|---|
| 946202 | Nika533 | 팀들 (IOI15_teams) | C++17 | 4069 ms | 71068 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#pragma GCC diagnostic warning "-std=c++11"
#include <bits/stdc++.h>
#include "teams.h"
#define pb push_back
#define f first
#define s second
#define MOD 1000000007
#define flush fflush(stdout)
#define all(x) (x).begin(),(x).end()
#define allr(x) (x).rbegin(), (x).rend()
#define pii pair<int,int>
using namespace std;
const int N=5e5+5;
int n,m,T,k,a[N],b[N];
vector<pii> va[N],vb[N];
void init(int N, int A[], int B[]) {
n=N;
for (int i=1; i<=n; i++) {
a[i]=A[i-1];
b[i]=b[i-1];
va[a[i]].pb({b[i],i});
vb[b[i]].pb({b[i],i});
}
}
int can(int M, int K[]) {
vector<int> vk(n+1,0);
for (int i=0; i<M; i++) vk[K[i]]+=K[i];
set<pii> myset;
for (int i=1; i<=n; i++) {
for (auto x:va[i]) {
myset.insert(x);
}
while (vk[i]--) {
if (myset.size()==0) return 0;
myset.erase(myset.begin());
}
for (auto x:vb[i]) {
myset.erase(x);
}
}
return 1;
}
컴파일 시 표준 에러 (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... | ||||
