제출 #599297

#제출 시각UTC-0아이디문제언어결과실행 시간메모리
5992972022-07-19 12:28:35Bench0310마상시합 토너먼트 (IOI12_tournament)C++17
100 / 100
121 ms36612 KiB
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
const int N=100000;
int tree[4*N];
void update(int idx,int l,int r,int pos,int x)
{
if(l==r) tree[idx]=x;
else
{
int m=(l+r)/2;
if(pos<=m) update(2*idx,l,m,pos,x);
else update(2*idx+1,m+1,r,pos,x);
tree[idx]=tree[2*idx]+tree[2*idx+1];
}
}
int descend(int idx,int l,int r,int p)
{
if(l==r) return l;
int m=(l+r)/2;
if(p<=tree[2*idx]) return descend(2*idx,l,m,p);
else return descend(2*idx+1,m+1,r,p-tree[2*idx]);
}
int GetBestPosition(int n,int m,int R,int *K,int *S,int *E)
{
 
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...