# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
1064950 | sammyuri | Game (APIO22_game) | C++17 | 512 ms | 3408 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 "game.h"
#include <bits/stdc++.h>
using namespace std;
const int MAXN = 30005;
vector<int> adj[MAXN];
int smallest[MAXN];
int nn, kk;
void init(int n, int k) {
nn = n; kk = k;
for (int i = 0; i < n; i ++)
smallest[i] = k;
}
void dfs(int node) {
for (auto a : adj[node]) {
if (smallest[a] > smallest[node]) {
smallest[a] = smallest[node];
dfs(a);
}
}
}
int add_teleporter(int u, int v) {
adj[v].push_back(u);
int cur = smallest[v];
if (v < kk)
cur = v;
if (smallest[u] > cur) {
# | 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... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |