# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
470950 | flappybird | City (JOI17_city) | C++14 | 557 ms | 58372 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 "Encoder.h"
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
vector<ll> adj[303030];
ll ord[303030], e[303030];
ll cnt;
void dfs(ll x, ll p = 0) {
ord[x] = cnt++;
e[x] = ord[x];
for (auto v : adj[x]) {
if (v == p) continue;
dfs(v, x);
e[x] = max(e[x], e[v]);
}
}
void Encode(int N, int A[], int B[]) {
ll i;
for (i = 0; i < N - 1; i++) adj[A[i]].push_back(B[i]), adj[B[i]].push_back(A[i]);
dfs(0);
for (i = 0; i < N; i++) Code(i, ord[i] * 250001 + e[i]);
}
#include "Device.h"
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
void InitDevice()
{
}
int Answer(long long S, long long T) {
ll o1, e1, o2, e2;
o1 = S / 250001;
o2 = T / 250001;
e1 = S % 250001;
e2 = T % 250001;
if (o1 < o2 && e2 <= e1) return 1;
else if (o1 > o2 && e2 >= e1) return 0;
else return 2;
}
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |