#include <traffic.h>
#include <bits/stdc++.h>
using namespace std;
void setIO() {
ios_base::sync_with_stdio(false);
cin.tie(nullptr);
}
const int maxn = 1e6;
vector<int> adj[maxn];
void bfs(int n) {
}
int LocateCentre(int n, int p[], int s[], int d[]) {
int left = 0, right = 0;
for (int i = 0; i < n - 1; ++i) {
adj[s[i]].push_back(d[i]);
adj[d[i]].push_back(s[i]);
right += p[i];
}
pair<int, int> sol = {right, 0};
for (int i = 0; i < n; ++i) {
left += p[i];
right -= p[i];
sol = min(sol, make_pair(max(left, right), i));
}
return sol.second;
}
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
16 ms |
23788 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
16 ms |
23788 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
16 ms |
23788 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
16 ms |
23788 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |