# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
599297 | Bench0310 | Jousting tournament (IOI12_tournament) | C++17 | 121 ms | 36612 KiB |
This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#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)
{
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |