Submission #439646

#TimeUTC-0UsernameProblemLanguageResultExecution timeMemory
4396462021-06-30 12:25:34haojiandanDungeons Game (IOI21_dungeons)C++17
0 / 100
52 ms78864 KiB
#include "dungeons.h"
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
const ll INF=1e18;
const int maxn=(4e5)+10;
int n,hd,tl,q[maxn],lg[maxn*2];
struct Tree {
int a[maxn],in[maxn];
ll w[maxn],dep[maxn],p[maxn]; bool cyc[maxn],vis[maxn];
vector<int> son[maxn];
int fa[maxn][20]; ll mn[maxn][20];
void dfs(int u) {
for (int v : son[u]) if (!cyc[v]) {
dep[v]=dep[u]+p[v]; dfs(v);
}
}
int cnt,L[maxn],R[maxn],tot,bel[maxn];
ll all[maxn],pre[maxn*2];
int rem[maxn*2],st[maxn*2][21],pos[maxn];
ll query(int l,int r) {
int j=lg[r-l+1];
return min(st[l][j],st[r-(1<<j)+1][j]);
}
void build() {
for (int i=1;i<=n;i++) in[a[i]]++,son[a[i]].push_back(i),fa[i][0]=a[i];
//for (int i=1;i<=n;i++) printf("a[%d]=%d,w[%d]=%lld,p[%d]=%lld\n",i,a[i],i,w[i],i,p[i]);
hd=1,tl=0;
for (int i=1;i<=n;i++) if (!in[i]) q[++tl]=i;
while (hd<=tl) {
 
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
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...
#Verdict Execution timeMemoryGrader output
Fetching results...