# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
1036494 | Andrey | Line Town (CCO23_day1problem3) | C++14 | 580 ms | 333752 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;
vector<long long> idk(500001);
vector<long long> lol(500001);
vector<long long> no(500001);
vector<pair<long long,long long>> roll(0);
void reset() {
for(int i = (int)roll.size()-1; i >= 0; i--) {
lol[roll[i].second] = roll[i].first;
}
roll.clear();
}
void upd2(long long a, long long x) {
while(a < lol.size()) {
roll.push_back({lol[a],a});
lol[a]+=x;
a+=(a&(-a));
}
}
long long calc2(long long a) {
long long c = 0,sb = 0;
for(long long i = 19; i >= 0; i--) {
if(c+(1 << i) <= a) {
c+=(1 << i);
sb+=lol[c];
}
Compilation message (stderr)
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |