제출 #793976

#제출 시각아이디문제언어결과실행 시간메모리
793976mathematik던전 (IOI21_dungeons)C++17
컴파일 에러
0 ms0 KiB
#include "dungeons.h" #include <bits/stdc++.h> #define ll long long using namespace std; int binary[15][500000][25][3];//index, +, max excluded int safe_add(int a, int b) { if (a > INT_MAX - b) return INT_MAX; return a + b; } int safe_sub(int a, int b) { return max(a - b, 0); } int N; vector<int> S, P, W, L; void init(int n, vector<int> s, vector<int> p, vector<int> w, vector<int> l) { s.push_back(0); p.push_back(0); w.push_back(n); l.push_back(n); n++; N = n; S = s, P = p, W = w, L = l; for (int range = 0; range < 15; range++) { ll r = 1 << (range + 10); for (int i = 0; i < n; i++) { if (s[i] <= r) { binary[range][i][0][0] = w[i]; binary[range][i][0][1] = s[i]; binary[range][i][0][2] = INT_MAX; } else { binary[range][i][0][0] = l[i]; binary[range][i][0][1] = p[i]; binary[range][i][0][2] = s[i]; } } for (int i = 1; i < 25; i++) { for (int ind = 0; ind < n; ind++) { int pointer = binary[range][ind][i - 1][0]; binary[range][ind][i][0] = binary[range][pointer][i - 1][0]; binary[range][ind][i][1] = safe_add(binary[range][ind][i - 1][1], binary[range][pointer][i - 1][1]); binary[range][ind][i][2] = min(binary[range][ind][i - 1][2], safe_sub(binary[range][pointer][i - 1][2], binary[range][ind][i - 1][1])); } } } } long long simulate(int x, int z) { ll t = z; while (t < 1024 && x != N - 1) { if (t >= S[x]) { t += S[x]; x = W[x]; } else { t += P[x]; x = L[x]; } } for (int r = 0; r < 15; r++) { for (int s = 24; s >= 0; s--) { while ((binary[r][x][s][2] > t || binary[r][x][s][2] == INT_MAX) && x != N - 1 && binary[r][x][s][1] != INT_MAX) { t += binary[r][x][s][1]; x = binary[r][x][s][0]; } } } return t; }

컴파일 시 표준 에러 (stderr) 메시지

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