# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
771395 | BidoTeima | San (COCI17_san) | C++17 | 116 ms | 13488 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;
using ll = long long;
vector<pair<ll,int>>vals;
const int N = (1 << 10) + 1;
vector<vector<int>> st(4 * N);
void build(int l, int r, int node){
st[node]=vector<int>(r-l+1);
if(l == r){
st[node].push_back(vals[l].second);
return;
}
int mid = (l + r) >> 1;
build(l, mid, 2 * node + 1);
build(mid + 1, r, 2 * node + 2);
int i = 0, j = 0;
while(i<(int)st[2 * node + 1].size() && j<(int)st[2 * node + 2].size()){
if(i == (int)st[2 * node + 1].size()){
st[node][i + j]=st[2 * node + 2][j];
++j;
continue;
}
if(j == (int)st[2 * node + 2].size()){
st[node][i + j]=st[2 * node + 1][i];
++i;
continue;
}
if(st[2 * node + 1][i] < st[2 * node + 2][j]){
st[node][i + j]=st[2 * node + 1][i];
++i;
# | 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... |