이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include <bits/stdc++.h>
#include "highway.h"
#define N 200009
#define pii pair <int, int>
#define ff first
#define ss second
#define pb push_back
#define ll long long
using namespace std;
int n, m, l[N], qwe, a;
vector<int>e[N];
vector<int>asd;
ll x;
int c[N][N];
void f(int nd, int lv){
for(int i=0; i<e[nd].size(); i++){
if(lv==x-1){
asd[c[nd][i]]=1;
int y=ask(asd);
if(x*a!=y){
answer(0, nd);
qwe=1;
return;
}
}
if(!l[e[nd][i]] and e[nd][i]>0)
f(e[nd][i], lv+1);
if(qwe)
return;
}
}
void find_pair(int NN, std::vector<int>u, std::vector<int>v, int A, int b){
n=NN;
m=u.size();
a=A;
for(int i=0; i<m; i++){
e[u[i]].pb(v[i]);
e[v[i]].pb(u[i]);
c[v[i]][u[i]]=i;
c[u[i]][v[i]]=i;
asd.pb(0);
}
if(a>b)
swap(a, b);
x=ask(asd);
x=x/a;
f(0, 0);
}
컴파일 시 표준 에러 (stderr) 메시지
highway.cpp: In function 'void f(int, int)':
highway.cpp:19:16: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
19 | for(int i=0; i<e[nd].size(); i++){
| ~^~~~~~~~~~~~~
/tmp/ccXN7ZvZ.o: In function `ask(std::vector<int, std::allocator<int> > const&)':
grader.cpp:(.text+0xb1): relocation truncated to fit: R_X86_64_PC32 against `.bss'
grader.cpp:(.text+0xef): relocation truncated to fit: R_X86_64_PC32 against `.bss'
grader.cpp:(.text+0x171): relocation truncated to fit: R_X86_64_PC32 against `.bss'
/tmp/ccXN7ZvZ.o: In function `main':
grader.cpp:(.text.startup+0x23): relocation truncated to fit: R_X86_64_PC32 against `.bss'
grader.cpp:(.text.startup+0x2d): relocation truncated to fit: R_X86_64_32 against `.bss'
grader.cpp:(.text.startup+0x3b): relocation truncated to fit: R_X86_64_PC32 against `.bss'
grader.cpp:(.text.startup+0x47): relocation truncated to fit: R_X86_64_PC32 against `.bss'
grader.cpp:(.text.startup+0x4c): relocation truncated to fit: R_X86_64_32 against `.bss'
grader.cpp:(.text.startup+0x58): relocation truncated to fit: R_X86_64_PC32 against `.bss'
grader.cpp:(.text.startup+0x70): relocation truncated to fit: R_X86_64_PC32 against `.bss'
grader.cpp:(.text.startup+0x77): additional relocation overflows omitted from the output
collect2: error: ld returned 1 exit status