Submission #343471

#TimeUsernameProblemLanguageResultExecution timeMemory
343471leinad2The Potion of Great Power (CEOI20_potion)C++17
Compilation error
0 ms0 KiB
#include<bits/stdc++.h> using namespace std; int n, d, H[100010], i, j, u, A[200010], B[200010], b, x, a; set<int>adj[100010][450], F[100010], X; set<int>::iterator it, it2; void init(int N, int D, int X[]) { n=N; d=D; for(i=0;i<n;i++)H[i]=X[i]; } void curseChanges(int U, int C[], int D[]) { u=U; for(i=0;i++<u;)A[i]=C[i-1],B[i]=D[i-1]; b=(int)round(sqrt(u)); for(i=0;i++<u;) { if(F[B[i]].find(A[i])==F[B[i]].end()) { F[A[i]].insert(B[i]); F[B[i]].insert(A[i]); } else { F[A[i]].erase(B[i]); F[B[i]].erase(A[i]); } if(i%b==0) { for(j=0;j<n;j++) { for(it=F[j].begin();it!=F[j].end();it++) { adj[j][i/b].insert(*it); } } } } } int question(int s, int e, int v) { x=v/b; for(i=b*x+1;i<=v;i++) { if(adj[B[i]][x].find(A[i])==adj[B[i]][x].end()) { adj[A[i]][x].insert(B[i]); adj[B[i]][x].insert(A[i]); } else { adj[A[i]][x].erase(B[i]); adj[B[i]][x].erase(A[i]); } } int ans=1e9; if(adj[s][x].size()==0||adj[e][x].size()==0) { goto w; } X.clear(); for(it=adj[s][x].begin();it!=adj[s][x].end();it++) { X.insert(H[*it]); } for(it=adj[e][x].begin();it!=adj[e][x].end();it++) { it2=X.lower_bound(H[*it]); if(it2==X.end())it2--; ans=min(ans, abs(H[*it]-*it2)); if(it2==X.begin())continue; it2--; ans=min(ans, abs(H[*it]-*it2)); } w:; for(i=v;i>b*x;i--) { if(adj[B[i]][x].find(A[i])==adj[B[i]][x].end()) { adj[A[i]][x].insert(B[i]); adj[B[i]][x].insert(A[i]); } else { adj[A[i]][x].erase(B[i]); adj[B[i]][x].erase(A[i]); } } return ans; }

Compilation message (stderr)

/tmp/cc5XqHI4.o: In function `main':
grader.cpp:(.text.startup+0x3e): relocation truncated to fit: R_X86_64_PC32 against symbol `std::cin' defined in .bss._ZSt3cin section in /usr/lib/gcc/x86_64-linux-gnu/9/libstdc++.a(globals_io.o)
grader.cpp:(.text.startup+0x45): relocation truncated to fit: R_X86_64_PC32 against symbol `std::cin' defined in .bss._ZSt3cin section in /usr/lib/gcc/x86_64-linux-gnu/9/libstdc++.a(globals_io.o)
grader.cpp:(.text.startup+0x9e): relocation truncated to fit: R_X86_64_PC32 against symbol `std::cin' defined in .bss._ZSt3cin section in /usr/lib/gcc/x86_64-linux-gnu/9/libstdc++.a(globals_io.o)
grader.cpp:(.text.startup+0x135): relocation truncated to fit: R_X86_64_PC32 against symbol `std::cin' defined in .bss._ZSt3cin section in /usr/lib/gcc/x86_64-linux-gnu/9/libstdc++.a(globals_io.o)
grader.cpp:(.text.startup+0x19e): relocation truncated to fit: R_X86_64_PC32 against symbol `std::cin' defined in .bss._ZSt3cin section in /usr/lib/gcc/x86_64-linux-gnu/9/libstdc++.a(globals_io.o)
grader.cpp:(.text.startup+0x1d8): relocation truncated to fit: R_X86_64_PC32 against symbol `std::cout' defined in .bss._ZSt4cout section in /usr/lib/gcc/x86_64-linux-gnu/9/libstdc++.a(globals_io.o)
grader.cpp:(.text.startup+0x206): relocation truncated to fit: R_X86_64_PC32 against symbol `std::cout' defined in .bss._ZSt4cout section in /usr/lib/gcc/x86_64-linux-gnu/9/libstdc++.a(globals_io.o)
/tmp/cc5XqHI4.o: In function `_GLOBAL__sub_I__Z4sigHi':
grader.cpp:(.text.startup+0x257): relocation truncated to fit: R_X86_64_PC32 against `.bss'
grader.cpp:(.text.startup+0x275): relocation truncated to fit: R_X86_64_PC32 against `.bss'
/usr/bin/ld: failed to convert GOTPCREL relocation; relink with --no-relax
collect2: error: ld returned 1 exit status