# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
784876 | TheSahib | The Big Prize (IOI17_prize) | C++14 | 87 ms | 16072 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;
const int BLOCK = 500;
const int MAX = 2e5 + 5;
int tree[MAX];
void update(int pos, int val){
while(pos < MAX){
tree[pos] += val;
pos += pos & (-pos);
}
}
int ask(int l, int r){
if(r < l) return 0;
if(l != 1) return ask(1, r) - ask(1, l - 1);
int ans = 0;
while(r > 0){
ans += tree[r];
r -= r & (-r);
}
return ans;
}
vector<int> mp[MAX];
Compilation message (stderr)
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |