# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
598042 | LIF | Arranging Shoes (IOI19_shoes) | C++14 | 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>
#include<vector>
using namespace std;
int n;
int a[200005];
vector<int> v[300005];
long long int sum[300005];
bool vis[300005];
int lowbit(int x)
{
return x&(-x);
}
int add(int x,int val)
{
while(x<=n)
{
sum[x] +=val;
x+=lowbit(x);
}
}
long long int getsum(int x)
{
long long int ans = 0;
while(x>0)
{
ans += sum[x];
x-=lowbit(x);
}
return ans;
}