Submission #720928

#TimeUsernameProblemLanguageResultExecution timeMemory
720928uroskDungeons Game (IOI21_dungeons)C++17
Compilation error
0 ms0 KiB
#include "dungeons.h" #include <bits/stdc++.h> #define here cerr<<"===========================================\n" #define dbg(x) cerr<<#x<<": "<<x<<endl; #define ll long long #define llinf 1000000000000000LL #define pb push_back using namespace std; #define maxn 400005 #define lg 25 #define lg2 9 #define B 9 ll n; ll a[maxn],b[maxn],w[maxn],l[maxn]; ll bs[lg2]; ll st[maxn][lg2][lg]; ll sum[maxn][lg2][lg]; ll mx[maxn][lg2][lg]; void init(int N, vector<int> s, vector<int> p, vector<int> W, vector<int> L) { bs[0] = 1; for(ll i = 1;i<lg2;i++) bs[i] = bs[i-1]*B; n = N; for(ll i = 1;i<=n;i++) a[i] = s[i-1]; for(ll i = 1;i<=n;i++) b[i] = p[i-1]; for(ll i = 1;i<=n;i++) w[i] = W[i-1]+1; for(ll i = 1;i<=n;i++) l[i] = L[i-1]+1; for(ll j = 0;j<lg2;j++){ for(ll i = 1;i<=n;i++){ if(bs[j]>a[i]){ st[i][j][0] = w[i]; sum[i][j][0] = a[i]; mx[i][j][0] = llinf; }else{ st[i][j][0] = l[i]; sum[i][j][0] = b[i]; mx[i][j][0] = a[i]; } } } for(ll j = 0;j<lg2;j++){ for(ll k = 1;k<lg;k++){ for(ll i = 1;i<=n;i++){ if(st[i][j][k]==n+1||st[st[i][j][k-1]][j][k-1]==n+1) continue; st[i][j][k] = st[st[i][j][k-1]][j][k-1]; sum[i][j][k] = sum[i][j][k-1] + sum[st[i][j][k-1]][j][k-1]; mx[i][j][k] = min(mx[i][j][k-1],mx[st[i][j][k-1]][j][k-1]-sum[i][j][k-1]); } } } return; } long long simulate(int x, int z) { x++; ll j = 0; while(x!=n+1){ while(j+1<lg2&&bs[j+1]<z) j++; for(ll k = lg-1;k>=0;k--){ if(st[x][j][k]==n+1) continue; if(z>=mx[x][j][k]) continue; z+=sum[x][j][k]; x = st[x][j][k]; } if(z>=a[x]){ z+=a[x]; x = w[x]; }else{ z+=b[x]; x = l[x]; } } return z; } /** 3 2 2 6 9 3 1 2 2 2 3 1 0 1 0 1 2 3 3 2 9 9 9 3 1 2 2 2 3 1 0 1 0 1 2 3 **/

Compilation message (stderr)

/tmp/ccpirUdL.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