# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
746475 | Sami_Massah | Race (IOI11_race) | C++17 | 482 ms | 84088 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 <bits/stdc++.h>
using namespace std;
const long long maxn = 2e5 + 12, mod = 998244353, inf = 1e9 + 12 ;
long long n, k, ans = maxn, h[maxn], sz[maxn], cost[maxn], U[maxn], V[maxn], dist[maxn];
int H2[maxn][2], L2[maxn];
vector <int> conn[maxn];
map <int, int> mp[maxn];
bitset <maxn> marked;
void dfs_set(int u){
marked[u] = 1;
sz[u] = 1;
for(int e: conn[u]){
int v = u ^ U[e] ^ V[e];
if(!marked[v]){
h[v] = h[u] + 1;
dist[v] = dist[u] + cost[e];
dfs_set(v);
sz[u] += sz[v];
}
}
}
void dfs(int u, int p = -1){
marked[u] = 1;
for(int e: conn[u]){
int v = u ^ U[e] ^ V[e];
if(!marked[v]){
dfs(v, u);
if(mp[v].find(k + dist[u]) != mp[v].end())
# | 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... |