# | 제출 시각UTC-0 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
855218 | serifefedartar | Parkovi (COCI22_parkovi) | C++17 | 997 ms | 53792 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include <bits/stdc++.h>
using namespace std;
#define fast ios::sync_with_stdio(0);cin.tie(0);
#define s second
#define f first
typedef long long ll;
const ll MOD = 998244353;
const ll LOGN = 18;
const ll MAXN = 2e5 + 5;
ll n, k, q;
vector<vector<pair<int,ll>>> graph;
vector<int> parks, ans_parks;
ll nearest[MAXN], longest[MAXN];
void dfs(int node, int parent) {
for (auto u : graph[node]) {
if (u.f == parent)
continue;
dfs(u.f, node);
nearest[node] = min(nearest[node], nearest[u.f] + u.s);
if (longest[u.f] + u.s <= q) // bir üste aktarabilme durumu
longest[node] = max(longest[node], longest[u.f] + u.s);
else {
parks.push_back(u.f);
nearest[node] = min(nearest[node], u.s);
}
}
컴파일 시 표준 에러 (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... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |