Submission #771395

#TimeUTC-0UsernameProblemLanguageResultExecution timeMemory
7713952023-07-02 23:37:48BidoTeimaSan (COCI17_san)C++17
0 / 120
116 ms13488 KiB
#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;
 
 
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...