# | 제출 시각UTC-0 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
1096191 | Sunbae | Putovanje (COCI20_putovanje) | C++17 | 50 ms | 41412 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include <bits/stdc++.h>
typedef long long ll;
using namespace std;
const int N = 2e5 + 5, M = 4e5 + 5;
vector<int> g[N];
tuple<int,int,int,int> e[N];
int E[M], T[M], mn[N], ST[M][20], m;
ll d[N];
void dfs(int u){
E[m++] = u;
for(int v: g[u]){
g[v].erase(find(g[v].begin(), g[v].end(), u));
dfs(v); E[m++] = u;
}
}
int get_lca(int u, int v){
if(mn[u] > mn[v]) swap(u, v);
int j = 31 - __builtin_clz(mn[v] - mn[u] + 1);
return T[min(ST[mn[u]][j], ST[mn[v]-(1<<j)+1][j])];
}
void efs(int u){
for(int v: g[u]) efs(v), d[u] += d[v];
}
signed main(){
int n; scanf("%d", &n);
for(int i = 0, u, v, w[2]; i<n-1; ++i){
scanf("%d %d %d %d", &u, &v, w, w+1); --u; --v;
g[u].push_back(v); g[v].push_back(u);
e[i] = {u, v, w[0], w[1]};
}
컴파일 시 표준 에러 (stderr) 메시지
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |