# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
503297 | rainboy | Hiperkocka (COCI21_hiperkocka) | C11 | 50 ms | 3808 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 <stdio.h>
#include <stdlib.h>
#define N 16
int *ej[N + 1], eo[N + 1];
void append(int i, int j) {
int o = eo[i]++;
if (o >= 2 && (o & o - 1) == 0)
ej[i] = (int *) realloc(ej[i], o * 2 * sizeof *ej[i]);
ej[i][o] = j;
}
int bb[N + 1], h;
void dfs(int p, int i, int b) {
int o;
bb[i] = b;
for (o = eo[i]; o--; ) {
int j = ej[i][o];
if (j != p)
dfs(i, j, b | 1 << h++);
}
}
int main() {
Compilation message (stderr)
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |