# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
465340 | marko | Arranging Shoes (IOI19_shoes) | C++17 | 392 ms | 201984 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;
struct Seg {
vector<int> arr{};
vector<int> a{};
int m;
Seg(vector<int> a) :a{a} {
const int n=a.size();
m=1;
do
{
m*=2;
} while (m<n);
arr.resize(2*m);
build(1, 0, m-1);
}
void build (int index, int l, int r) {
if (l==r) {
arr[index]=(index-m<a.size())?a[index-m]: 0;
return;
}
const int mid=(l+r)/2;
build(2*index, l, mid);
build(2*index+1, mid+1, r);
arr[index]=arr[2*index]+arr[2*index+1];
}
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... |