제출 #746475

#제출 시각UTC-0아이디문제언어결과실행 시간메모리
7464752023-05-22 13:35:45Sami_Massah경주 (Race) (IOI11_race)C++17
100 / 100
482 ms84088 KiB
#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())
 
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...