Submission #97173

#TimeUsernameProblemLanguageResultExecution timeMemory
97173maruiiSnowy Roads (JOI16_snowy)C++14
Compilation error
0 ms0 KiB
#include "Anyalib.h" #include <bits/stdc++.h> using namespace std; #define ff first #define ss second static vector<int> edge[500]; static int A[500], B[500], prt[500], dth[500], c[500], N, piv; static void dfs(int x){ for(auto &i: edge[x]){ if(prt[x]==i) continue; prt[i] = x; dth[i] = dth[x]+1; dfs(i); } } static void dfs2(int x){ for(auto &i: edge[x]){ if(prt[x]==i) continue; if(x) c[x] += c[prt[x]]; dfs2(i); } if(dth[x]%10 == 0) for(int i=0; i<9; ++i) Save(piv++, (c[x]>>i) & 1); } void InitAnya(int N_ , int AA[] , int BB[]) { N = N_; for(int i=0; i<N; ++i) edge[i].clear(); for(int i=0; i<N-1; ++i){ A[i] = AA[i], B[i] = BB[i]; edge[A[i]].push_back(B[i]); edge[B[i]].push_back(A[i]); } for(int i=0; i<N; ++i) sort(edge[i].begin(), edge[i].end()); dfs(0); } void Anya(int C[]) { for(int i=0; i<N-1; ++i) Save(prt[A[i]]==B[i]?A[i]:B[i], C[i]), c[prt[A[i]]==B[i]?A[i]:B[i]] = C[i]; piv = N; dfs2(0); }
#include "Anyalib.h" #include <bits/stdc++.h> using namespace std; #define ff first #define ss second static vector<int> edge[500]; static int A[500], B[500], prt[500], dth[500], c[500], N, piv; static void dfs(int x){ for(auto &i: edge[x]){ if(prt[x]==i) continue; prt[i] = x; dth[i] = dth[x]+1; dfs(i); } } static void dfs2(int x){ for(auto &i: edge[x]){ if(prt[x]==i) continue; if(x) c[x] += c[prt[x]]; dfs2(i); } if(dth[x]%10 == 0) for(int i=0; i<9; ++i) Save(piv++, (c[x]>>i) & 1); } void InitAnya(int N_ , int AA[] , int BB[]) { N = N_; for(int i=0; i<N; ++i) edge[i].clear(); for(int i=0; i<N-1; ++i){ A[i] = AA[i], B[i] = BB[i]; edge[A[i]].push_back(B[i]); edge[B[i]].push_back(A[i]); } for(int i=0; i<N; ++i) sort(edge[i].begin(), edge[i].end()); dfs(0); } void Anya(int C[]) { for(int i=0; i<N-1; ++i) Save(prt[A[i]]==B[i]?A[i]:B[i], C[i]), c[prt[A[i]]==B[i]?A[i]:B[i]] = C[i]; piv = N; dfs2(0); }

Compilation message (stderr)

/tmp/ccA1rYcx.o: In function `dfs2(int)':
Boris.cpp:(.text+0x141): undefined reference to `Save(int, int)'
/tmp/ccA1rYcx.o: In function `Anya(int*)':
Boris.cpp:(.text+0x19f): undefined reference to `Save(int, int)'
/tmp/ccEXirCI.o: In function `main':
grader_boris.cpp:(.text.startup+0x1b1): undefined reference to `InitBoris(int, int*, int*)'
grader_boris.cpp:(.text.startup+0x2be): undefined reference to `Boris(int)'
collect2: error: ld returned 1 exit status