# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
423069 | MDario | The Big Prize (IOI17_prize) | C++11 | 129 ms | 5940 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 "prize.h"
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
#define F first
#define S second
int maxn, abi[200001];
vector<int> v[200001];
void update_abi(int xf, int yf){
while(xf<=maxn){
abi[xf]+=yf;
xf+=xf&(-xf);
}
return;
}
int query_abi1(int xf){
int cr=0;
while(xf>0){
cr+=abi[xf];
xf-=xf&(-xf);
}
return cr;
}
int query_abi2(int xf){
int cr=0, cf=0;
for(int i=18; i>=0; i--){
if(cr+(1<<i)<=maxn){
if(cf+(1<<i)-abi[cr+(1<<i)]<xf){
cf+=(1<<i)-abi[cr+(1<<i)];
cr+=(1<<i);
Compilation message (stderr)
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |