# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
1111841 | hungnt | Jousting tournament (IOI12_tournament) | C++17 | 0 ms | 0 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>
#define BIT(x, k) (((x) >> (k)) & 1)
#define on(x, k) ((x) ^ (1ll << (k)))
#define pii pair<int, int>
#define fi first
#define se second
#define all(x) x.begin(), x.end()
#define ll long long
using namespace std;
const int N = 200005;
int n, ro, point;
vector<int> adj[N];
int a[N], bit[N], pa[N], h[N], par[20][N];
int pre[N], suf[N];
int numNode;
void update(int x, int v)
{
for(; x <= n; x += x & -x) bit[x] += v;
}
int Find_pos(int v)
{
int sum = 0;
int pos = 0;
for(int i= __lg(n); i>= 0; i--)
{