# | 제출 시각UTC-0 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
444005 | aryan12 | Pipes (BOI13_pipes) | C++17 | 244 ms | 29484 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include <bits/stdc++.h>
using namespace std;
#define int long long
mt19937_64 RNG(chrono::steady_clock::now().time_since_epoch().count());
const int N = 1e5 + 5;
int change[N], result[N];
vector<pair<int, int> > g[N];
int edgeChange[N], temp[N];
bool vis[N];
int n, m, bruh;
vector<int> cycle, cycle_edges;
void dfs(int node, int par, int edgeNum) {
for(int i = 0; i < g[node].size(); i++) {
if(g[node][i].first != par) {
dfs(g[node][i].first, node, g[node][i].second);
}
}
int netWithParent = change[node] - result[node];
if(par != -1) {
result[node] += netWithParent;
edgeChange[edgeNum] = netWithParent;
result[par] += netWithParent;
}
}
void Tree() {
dfs(1, -1, -1);
컴파일 시 표준 에러 (stderr) 메시지
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |