제출 #920445

#제출 시각UTC-0아이디문제언어결과실행 시간메모리
9204452024-02-02 14:44:31LudisseyCat Exercise (JOI23_ho_t4)C++14
100 / 100
804 ms148176 KiB
#include <bits/stdc++.h>
using namespace std;
#define int long long
vector<vector<int>> adj;
int n;
const int LOG=63;
vector<int> p;
vector<int> depth;
vector<bool> proc;
vector<bool> visited;
vector<int> parent;
vector<vector<pair<int,int>>> child;
vector<vector<int>> ancestors;
vector<int> sz;
int lca(int a, int b){
if(depth[b]>depth[a]) swap(a,b);
int k=depth[a]-depth[b];
for (int j = LOG-1; j >= 0; j--)
{
if(k&((long long)1<<j)) a=ancestors[a][j];
}
if(a==b) return a;
for (int j = LOG-1; j >= 0; j--)
{
if(ancestors[a][j]!=ancestors[b][j]) {
a=ancestors[a][j];
b=ancestors[b][j];
}
}
 
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

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

Main.cpp: In function 'int main()':
Main.cpp:131:22: warning: 'start' may be used uninitialized in this function [-Wmaybe-uninitialized]
  131 |     cout << dfs(start) << "\n";
      |                      ^
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...