Submission #1062379

#TimeUsernameProblemLanguageResultExecution timeMemory
1062379vjudge1Flights (JOI22_flights)C++17
Compilation error
0 ms0 KiB
#include "Ali.h" #include "Benjamin.h" #include<bits/stdc++.h> using namespace std; using ll = long long; vector<int> adj[10010]; int dis[10010], n1; void dfs(int v, int p = -1) { for (auto& x : adj[v]) { if (x == p) continue; dis[x] = dis[v] + 1; dfs(x, v); } } void Init(int __N, vector<int> U, vector<int> V) { n1 = __N; for (int i = 0;i < n1 - 1;i++) { adj[U[i]].push_back(V[i]); adj[V[i]].push_back(U[i]); } for (int i = 0;i < n1;i++) SetID(i, i); } string SendA(string S) { // first 14 bit of S is X // last 6 bit of S is Y (partial) int X = 0; for (int i = 0;i < 14;i++) X ^= ((S[i] - '0') << i); int Y = 0; for (int i = 14;i < 20;i++) Y ^= ((S[i] - '0') << (i - 14)); dfs(X); string res = ""; for (int i = 0;i < n1;i++) { if ((i & 63) != Y) continue; for (int j = 0;j < 14;j++) res += ((dis[i] >> j) & 1) + '0'; } return res; } int n, Y; string SendB(int __N, int X, int Y) { n = __N; string res = ""; for (int i = 0;i < 14;i++) { res += ((X >> i) & 1) + '0'; } for (int i = 14;i < 20;i++) { res += ((Y >> (i - 14)) & 1) + '0'; } ::Y = Y; return res; } int Answer(string T) { int s = 0; for (int i = 0;i < n;i++) { if ((i & 63) != (Y & 63)) continue; if (i == Y) { int ans = 0; for (int j = s;j < s + 14;j++) { ans ^= ((T[j] - '0') << (j - s)); } return ans; } s += 14; } return -1; }

Compilation message (stderr)

grader_ali.cpp:10:8: warning: '{anonymous}::_randmem' defined but not used [-Wunused-variable]
   10 |   char _randmem[12379];
      |        ^~~~~~~~

/usr/bin/ld: /tmp/cc58BBNL.o: in function `main':
grader_benjamin.cpp:(.text.startup+0x19a): undefined reference to `Answer(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >)'
/usr/bin/ld: grader_benjamin.cpp:(.text.startup+0x24f): undefined reference to `SendB[abi:cxx11](int, int, int)'
collect2: error: ld returned 1 exit status