# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
890080 | TAhmed33 | Flights (JOI22_flights) | C++17 | 8 ms | 1888 KiB |
This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#include "Ali.h"
#include <bits/stdc++.h>
using namespace std;
vector <int> adj[10001];
int n2;
void Init (int N, vector <int> a, vector <int> b) {
n2 = N;
for (int i = 0; i < n2; i++) adj[i].clear();
for (int i = 0; i + 1 < n2; i++) {
adj[a[i]].push_back(b[i]);
adj[b[i]].push_back(a[i]);
}
for (int i = 0; i < n2; i++) {
SetID(i, i);
}
}
string get (int x) {
string ret;
for (int i = 13; i >= 0; i--) {
if ((x >> i) & 1) ret += '1';
else ret += '0';
}
return ret;
}
string t;
void dfs (int pos, int par, int dep) {
t += get(pos);
t += get(dep);
for (auto j : adj[pos]) if (j != par) dfs(j, pos, dep + 1);
}
string SendA (string s) {
int x = 0;
for (auto i : s) {
x *= 2; if (i == '1') x++;
}
t.clear();
dfs(x, -1, 0);
return t;
}
#include "Benjamin.h"
#include <bits/stdc++.h>
using namespace std;
int n, xx, yy;
string SendB (int N, int X, int Y) {
n = N; xx = X; yy = Y;
string ret;
for (int i = 13; i >= 0; i--) {
if ((xx >> i) & 1) ret += '1';
else ret += '0';
}
while (ret.size() < 20) ret = '0' + ret;
return ret;
}
int Answer (string t) {
for (int i = 0; i < (int)t.length(); i += 28) {
int z = 0;
for (int j = i; j <= i + 13; j++) {
z *= 2; if (t[j] == '1') z++;
}
if (z == yy) {
int ret = 0;
for (int j = i + 14; j <= i + 27; j++) {
ret *= 2;
if (t[j] == '1') ret++;
}
return ret;
}
}
}
Compilation message (stderr)
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |