# | 제출 시각UTC-0 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
999653 | bachhoangxuan | 마상시합 토너먼트 (IOI12_tournament) | C++17 | 49 ms | 23316 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include<bits/stdc++.h>
using namespace std;
const int maxn = 1e5+5;
const int maxl = 20;
int rt[maxn],pos[maxn],deg[maxn],lst=0;
vector<int> edge[maxn];
int tree[4*maxn];
void build(int l,int r,int id){
tree[id]=r-l+1;
if(l==r) return;
int mid=(l+r)>>1;
build(l,mid,id<<1),build(mid+1,r,id<<1|1);
}
bool cur=true;
int update(int l,int r,int id,int tl,int tr,int p){
if(l==r){
tree[id]=cur;
lst=max(lst,rt[l]);
if(pos[l]!=-1) edge[p].push_back(pos[l]),deg[pos[l]]++;
return l;
}
int mid=(l+r)>>1,val=-1;
bool cc=cur;
if(tr<tree[id<<1]) val=update(l,mid,id<<1,tl,tr,p);
else if(tree[id<<1]<=tl) val=update(mid+1,r,id<<1|1,tl-tree[id<<1],tr-tree[id<<1],p);
else{
cur=false;
val=update(mid+1,r,id<<1|1,0,tr-tree[id<<1],p);
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |