제출 #648189

#제출 시각UTC-0아이디문제언어결과실행 시간메모리
6481892022-10-05 16:36:15LeonaRagingBall Machine (BOI13_ballmachine)C++14
16.23 / 100
1084 ms34128 KiB
#include <bits/stdc++.h>
using namespace std;
#define fi first
#define se second
#define ll long long
#define pb push_back
#define db(val) "[" #val " = " << (val) << "] "
const ll mod = 1e9 + 7;
const int maxn = 1e5 + 4;
const int INF = 1e9;
const int N = 20;
int n, q, root, f[maxn], h[maxn], up[maxn][20], tin[maxn];
bool has[maxn];
vector<int> adj[maxn];
set<pair<int,int>> mySet;
void dfs(int u) {
for (int j = 1; j <= N; j++)
up[u][j] = up[up[u][j - 1]][j - 1];
f[u] = u;
for (int v : adj[u]) {
h[v] = h[u] + 1;
up[v][0] = u;
dfs(v);
f[u] = min(f[u], f[v]);
}
}
 
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

컴파일 시 표준 에러 (stderr) 메시지

ballmachine.cpp: In function 'void dfs(int)':
ballmachine.cpp:22:18: warning: iteration 19 invokes undefined behavior [-Waggressive-loop-optimizations]
   22 |         up[u][j] = up[up[u][j - 1]][j - 1];
      |         ~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~
ballmachine.cpp:21:23: note: within this loop
   21 |     for (int j = 1; j <= N; j++)
      |                     ~~^~~~
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...