Submission #39165

# Submission time Handle Problem Language Result Execution time Memory
39165 2018-01-09T16:53:38 Z faustaadp Game (IOI13_game) C++14
Compilation error
0 ms 0 KB
#include "game.h"
#include<bits/stdc++.h>
#define ll long long
#define pb push_back
#define mp make_pair
#define fi first
#define se second
using namespace std;
long long fpb(long long X, long long Y) {
    long long tmp;
    while (X != Y && Y != 0) {
        tmp = X;
        X = Y;
        Y = tmp % Y;
    }
    return X;
}
ll n,m,st[13][40040404],hz,i;
void un(ll aa,ll bb,ll cc,ll dd,ll ee,ll ff)
{
	if(aa==bb)
		st[ff][ee]=dd;
	else
	{
		ll ce=(aa+bb)/2;
		if(cc<=ce)
			un(aa,ce,cc,dd,ee*2,ff);
		else
			un(ce+1,bb,cc,dd,ee*2+1,ff);
		st[ff][ee]=fpb(st[ff][ee*2],st[ff][ee*2+1]);
	}
}
ll hn(ll aa,ll bb,ll cc,ll dd,ll ee,ll ff)
{
	if(dd<aa||bb<cc)
		return 0;
	else
	if(cc<=aa&&bb<=dd)
		return st[ff][ee];
	else
	{
		ll ce=(aa+bb)/2;
		return fpb(hn(aa,ce,cc,dd,ee*2,ff),hn(ce+1,bb,cc,dd,ee*2+1,ff));
	}
}
void init(int R, int C) {
	n=R;
	m=C;
}

void update(int P, int Q, long long K) {
	un(0,m-1,Q,K,1,P);
}

long long calculate(int P, int Q, int U, int V) {
	hz=0;
	for(i=P;i<=U;i++)
		hz=fpb(hz,hn(0,m-1,Q,V,1,i));
    return hz;
}

Compilation message

grader.c: In function 'int main()':
grader.c:18:6: warning: variable 'res' set but not used [-Wunused-but-set-variable]
  int res;
      ^
/tmp/ccjVCvk0.o: In function `init':
game.cpp:(.text+0x229): relocation truncated to fit: R_X86_64_PC32 against symbol `n' defined in .bss section in /tmp/ccjVCvk0.o
game.cpp:(.text+0x230): relocation truncated to fit: R_X86_64_PC32 against symbol `m' defined in .bss section in /tmp/ccjVCvk0.o
/tmp/ccjVCvk0.o: In function `update':
game.cpp:(.text+0x243): relocation truncated to fit: R_X86_64_PC32 against symbol `m' defined in .bss section in /tmp/ccjVCvk0.o
/tmp/ccjVCvk0.o: In function `calculate':
game.cpp:(.text+0x29c): relocation truncated to fit: R_X86_64_PC32 against symbol `m' defined in .bss section in /tmp/ccjVCvk0.o
/usr/lib/gcc/x86_64-linux-gnu/5/libstdc++.a(ios_init.o): In function `std::ios_base::Init::Init()':
(.text._ZNSt8ios_base4InitC2Ev+0x4a): relocation truncated to fit: R_X86_64_PC32 against symbol `__gnu_internal::buf_cout_sync' defined in .bss._ZN14__gnu_internal13buf_cout_syncE section in /usr/lib/gcc/x86_64-linux-gnu/5/libstdc++.a(globals_io.o)
/usr/lib/gcc/x86_64-linux-gnu/5/libstdc++.a(ios_init.o): In function `std::ios_base::Init::Init()':
(.text._ZNSt8ios_base4InitC2Ev+0x51): relocation truncated to fit: R_X86_64_PC32 against symbol `__gnu_internal::buf_cout_sync' defined in .bss._ZN14__gnu_internal13buf_cout_syncE section in /usr/lib/gcc/x86_64-linux-gnu/5/libstdc++.a(globals_io.o)
/usr/lib/gcc/x86_64-linux-gnu/5/libstdc++.a(ios_init.o): In function `std::ios_base::Init::Init()':
(.text._ZNSt8ios_base4InitC2Ev+0x5c): relocation truncated to fit: R_X86_64_PC32 against symbol `__gnu_internal::buf_cout_sync' defined in .bss._ZN14__gnu_internal13buf_cout_syncE section in /usr/lib/gcc/x86_64-linux-gnu/5/libstdc++.a(globals_io.o)
/usr/lib/gcc/x86_64-linux-gnu/5/libstdc++.a(ios_init.o): In function `std::ios_base::Init::Init()':
(.text._ZNSt8ios_base4InitC2Ev+0x67): relocation truncated to fit: R_X86_64_PC32 against symbol `__gnu_internal::buf_cout_sync' defined in .bss._ZN14__gnu_internal13buf_cout_syncE section in /usr/lib/gcc/x86_64-linux-gnu/5/libstdc++.a(globals_io.o)
/usr/lib/gcc/x86_64-linux-gnu/5/libstdc++.a(ios_init.o): In function `std::ios_base::Init::Init()':
(.text._ZNSt8ios_base4InitC2Ev+0x72): relocation truncated to fit: R_X86_64_PC32 against symbol `__gnu_internal::buf_cout_sync' defined in .bss._ZN14__gnu_internal13buf_cout_syncE section in /usr/lib/gcc/x86_64-linux-gnu/5/libstdc++.a(globals_io.o)
/usr/lib/gcc/x86_64-linux-gnu/5/libstdc++.a(ios_init.o): In function `std::ios_base::Init::Init()':
(.text._ZNSt8ios_base4InitC2Ev+0x7d): relocation truncated to fit: R_X86_64_PC32 against symbol `__gnu_internal::buf_cout_sync' defined in .bss._ZN14__gnu_internal13buf_cout_syncE section in /usr/lib/gcc/x86_64-linux-gnu/5/libstdc++.a(globals_io.o)
/usr/lib/gcc/x86_64-linux-gnu/5/libstdc++.a(ios_init.o): In function `std::ios_base::Init::Init()':
(.text._ZNSt8ios_base4InitC2Ev+0x92): additional relocation overflows omitted from the output
collect2: error: ld returned 1 exit status