# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
1136250 | Hamed_Ghaffari | Swap (BOI16_swap) | C++20 | 706 ms | 219204 KiB |
#include<bits/stdc++.h>
using namespace std;
#pragma GCC optimize("O3,unroll-loops")
#pragma GCC target("avx2,bmi,bmi2,sse4,sse4.2,lzcnt,popcnt")
#define pb push_back
#define all(x) x.begin(), x.end()
const int MXN = 2e5+1;
struct node {
int val;
node *lc, *rc;
node(int val=0, node *lc=NULL, node *rc=NULL): val(val), lc(lc), rc(rc) {}
};
int n, a[MXN];
vector<int> vals[MXN];
vector<node*> dp[MXN];
void dfs(int v) {
vals[v].pb(a[v]);
dp[v].resize(vals[v].size(), NULL);
if((v<<1)<=n) {
vals[v<<1] = vals[v];
if((v<<1|1)<=n) vals[v<<1].pb(a[v<<1|1]);
dfs(v<<1);
}
if((v<<1|1)<=n) {
vals[v<<1|1] = vals[v];
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... |