Submission #1062409

#TimeUsernameProblemLanguageResultExecution timeMemory
1062409kunzaZa183Flights (JOI22_flights)C++17
0 / 100
49 ms2064 KiB
#include "Ali.h" #include <bits/stdc++.h> using namespace std; namespace { int variable_example = 0; vector<vector<int>> adjlist; auto decode = [](string S) { int cur = 0; for (auto a : S) { cur *= 2; cur += a - '0'; } return cur; }; auto base2 = [](int cur, int len) { string tmp = ""; for (int i = 0; i < len; i++) { tmp.push_back('0' + cur % 2); cur /= 2; } reverse(tmp.begin(), tmp.end()); return tmp; }; int N; } // namespace void Init(int N, vector<int> U, vector<int> V) { ::N = N; for (int i = 0; i < N; i++) SetID(i, i); adjlist.clear(); adjlist.resize(N); for (int i = 0; i < N - 1; i++) { adjlist[U[i]].push_back(V[i]), adjlist[V[i]].push_back(U[i]); } } string SendA(string S) { int val = decode(S); int from = val / 100, rem = val % 100; // cerr << from << ' ' << rem << "\n"; vector<int> dis(N); function<void(int, int, int)> dfs = [&](int cur, int par, int len) { dis[cur] = len; for (auto a : adjlist[cur]) if (a != par) dfs(a, cur, len + 1); }; dfs(from, from, 0); // for (auto a : dis) // cout << a << " "; // cout << "\n"; string tmp; for (int i = rem * 100; i < rem * 100 + 99 && i < N; i++) tmp += base2(dis[i], 14); // cerr << tmp << "\n"; return tmp; }
#include "Benjamin.h" #include <bits/stdc++.h> using namespace std; namespace { int variable_example = 0; auto decode = [](string S) { int cur = 0; for (auto a : S) { cur *= 2; cur += a - '0'; } return cur; }; auto base2 = [](int cur, int len) { string tmp = ""; for (int i = 0; i < len; i++) { tmp.push_back('0' + cur % 2); cur /= 2; } reverse(tmp.begin(), tmp.end()); return tmp; }; const int maxsend = 1e2; int X, Y; } // namespace string SendB(int N, int X, int Y) { ::X = X, ::Y = Y; // cerr << X << " " << Y << "\n"; int val = X * maxsend + Y / maxsend % maxsend; return base2(val, 20); } int Answer(string T) { int in = Y % maxsend; return decode(T.substr(in * 14, 14)); }

Compilation message (stderr)

Ali.cpp:7:5: warning: '{anonymous}::variable_example' defined but not used [-Wunused-variable]
    7 | int variable_example = 0;
      |     ^~~~~~~~~~~~~~~~
grader_ali.cpp:10:8: warning: '{anonymous}::_randmem' defined but not used [-Wunused-variable]
   10 |   char _randmem[12379];
      |        ^~~~~~~~

Benjamin.cpp:7:5: warning: '{anonymous}::variable_example' defined but not used [-Wunused-variable]
    7 | int variable_example = 0;
      |     ^~~~~~~~~~~~~~~~
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...