제출 #1056320

#제출 시각아이디문제언어결과실행 시간메모리
1056320Huseyn123Dungeons Game (IOI21_dungeons)C++17
컴파일 에러
0 ms0 KiB
#include <bits/stdc++.h> 
#include "dungeons.h"
#define INF LLONG_MAX
using namespace std;
typedef long long ll;
const int lgb=8;
const int lg=10;
ll st[3][lg][25][400001];
vector<int> S,P,W,L;
int N;
void init(int n, vector<int> s, vector<int> p, vector<int> w, vector<int> l) {
	s.push_back(0);
	N=n;
	S=s; 
	P=p; 
	W=w; 
	L=l;
	for(int i=0;i<lg;i++){
		for(int z=0;z<n;z++){
			if(s[z]<(1<<i)){
				st[0][i][0][z]=s[z];
				if(w[z]!=n && s[w[z]]<(1<<i)){
					st[1][i][0][z]=-INF;
				}
				else{
					st[1][i][0][z]=s[z]-s[w[z]];
				}
				st[2][i][0][z]=w[z];
			}
			else{
				st[0][i][0][z]=p[z];
				if(l[z]!=n && s[l[z]]<(1<<i)){
					st[1][i][0][z]=-INF;
				}
				else{
					st[1][i][0][z]=p[z]-s[l[z]];
				}
				st[2][i][0][z]=l[z];
			}
		}
		st[0][i][0][n]=0;
		st[1][i][0][n]=0;
		st[2][i][0][n]=n;
		for(int j=1;j<lg;j++){
			for(int z=0;z<=n;z++){
				st[0][i][j][z]=st[0][i][j-1][z];
				st[1][i][j][z]=st[1][i][j-1][z];
				st[2][i][j][z]=st[2][i][j-1][z];
				for(int k=0;k<lgb-1;k++){
					int ind=st[2][i][j][z];
					if(st[1][i][j-1][ind]!=-INF){
						st[1][i][j][z]=max(st[1][i][j][z],st[1][i][j-1][ind]+st[0][i][j][z]);
					}
					st[0][i][j][z]+=st[0][i][j-1][ind];
					st[2][i][j][z]=st[2][i][j-1][ind];
				}
			}
		}
	}
	return;
}
long long simulate(int x, int z) {
	ll res=z;
	while(x!=N){
		int h=0; 
		for(int i=0;i<lg;i++){
			if((res&(1<<i))){
				h=i;
			}
		}
		if(S[x]>=(1LL<<h) && res>=S[x]){
			res+=S[x];
			x=W[x];
		}
		else{
			for(int i=lg-1;i>=0;i--){
				for(int j=1;j<lgb;j++){
					if(st[1][h][i][x]<-res){
						res+=st[0][h][i][x];
						x=st[2][h][i][x];
					}
				}
			}
			res+=st[0][h][0][x];
			x=st[2][h][0][x];
		}
	}
	return res;
}

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

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