# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
476565 | AdamGS | Saveit (IOI10_saveit) | C++14 | 283 ms | 13344 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 "grader.h"
#include "encoder.h"
#include<bits/stdc++.h>
using namespace std;
typedef long double ld;
typedef long long ll;
#define rep(a, b) for(ll a = 0; a < (b); ++a)
#define st first
#define nd second
#define pb push_back
#define all(a) a.begin(), a.end()
const int LIM=1e3+7, INF=1e9+7;
vector<ll>V[LIM], P;
ll oc[LIM], odw[LIM], odl[LIM], T[LIM];
void DFS(int x) {
P.pb(x);
odw[x]=1;
sort(all(V[x]));
for(auto i : V[x]) if(!odw[i]) {
oc[i]=x;
DFS(i);
}
}
void encode(int n, int h, int m, int *a, int *b) {
rep(i, m) {
V[a[i]].pb(b[i]);
V[b[i]].pb(a[i]);
}
DFS(0);
rep(i, n-1) rep(j, 10) encode_bit((oc[i+1]&(1<<j))>0);
Compilation message (stderr)
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |