Submission #525440

#TimeUsernameProblemLanguageResultExecution timeMemory
525440LucaDantas던전 (IOI21_dungeons)C++17
Compilation error
0 ms0 KiB
#include "dungeons.h" #include <vector> #include <bits/stdc++.h> using namespace std; constexpr int maxn = 4e5+10, logn = 25, log_lift = 9, base_lift = 8; constexpr long long inf = 1e15L; struct FunctionalGraph { int f[maxn][log_lift], mn[maxn][log_lift]; // p[i] == peso da aresta saindo de i, f[i] == aresta saindo de i long long tab[maxn][log_lift], cost[maxn][log_lift]; // s[i] == força necessaria para matar i void add_i(int i, int x, int v, long long st) { f[i][0] = x, cost[i][0] = v, mn[i][0] = i, tab[i][0] = st; } void build(int n) { f[n][0] = n; cost[n][0] = 0; mn[n][0] = n; for(int l = 1; l < log_lift; l++) { for(int i = 0; i <= n; i++) { f[i][l] = i; tab[i][l] = tab[i][l-1]; mn[i][l] = mn[i][l-1]; for(int k = 0; k < base_lift; k++) { if(tab[i][l] > tab[ f[i][l] ][l-1] - cost[i][l]) { mn[i][l] = mn[ f[i][l] ][l-1]; tab[i][l] = tab[ f[i][l] ][l-1] - cost[i][l]; } cost[i][l] += cost[f[i][l]][l-1]; f[i][l] = f[f[i][l]][l-1]; } } } } void go(int& x, long long& val) { if(val >= tab[x][0]) return; for(int l = log_lift-1; l >= 0; l--) for(int k = 0; k < base_lift-1; k++) if(tab[x][l] > val) val += cost[x][l], x = f[x][l]; } } graph[logn]; void init(int n, std::vector<int> s, std::vector<int> p, std::vector<int> w, std::vector<int> l) { for(int lg = 0; lg < logn; lg++) { for(int i = 0; i < n; i++) { if(s[i] <= (1<<lg)) graph[lg].add_i(i, w[i], s[i], inf); else graph[lg].add_i(i, l[i], p[i], s[i]); } graph[lg].build(n); } return; } long long simulate(int x, int z) { long long val = z; for(int lg = 0; lg < logn; lg++) graph[lg].go(x, val); return val; }

Compilation message (stderr)

/tmp/ccjC8ZdF.o: in function `main':
grader.cpp:(.text.startup+0x178): relocation truncated to fit: R_X86_64_PC32 against `.bss'
grader.cpp:(.text.startup+0x17f): relocation truncated to fit: R_X86_64_PC32 against `.bss'
grader.cpp:(.text.startup+0x19d): relocation truncated to fit: R_X86_64_PC32 against `.bss'
grader.cpp:(.text.startup+0x1a4): relocation truncated to fit: R_X86_64_PC32 against `.bss'
grader.cpp:(.text.startup+0x1b0): relocation truncated to fit: R_X86_64_PC32 against `.bss'
grader.cpp:(.text.startup+0x1b7): relocation truncated to fit: R_X86_64_PC32 against `.bss'
grader.cpp:(.text.startup+0x1c3): relocation truncated to fit: R_X86_64_PC32 against `.bss'
grader.cpp:(.text.startup+0x1ca): relocation truncated to fit: R_X86_64_PC32 against `.bss'
grader.cpp:(.text.startup+0x1d6): relocation truncated to fit: R_X86_64_PC32 against `.bss'
grader.cpp:(.text.startup+0x1dd): relocation truncated to fit: R_X86_64_PC32 against `.bss'
grader.cpp:(.text.startup+0x1e9): additional relocation overflows omitted from the output
/usr/bin/ld: failed to convert GOTPCREL relocation; relink with --no-relax
collect2: error: ld returned 1 exit status