# | 제출 시각UTC-0 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
468924 | Soumya1 | 꿈 (IOI13_dreaming) | C++14 | 55 ms | 12028 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include "dreaming.h"
#include <bits/stdc++.h>
using namespace std;
const int mxN = 1e5;
vector<pair<int, int>> ad[mxN];
bool vis[mxN];
int dp[mxN][2];
int mn = 1e9 + 5;
int ans = 0;
void dfs(int node) {
vis[node] = true;
for (auto [child, w] : ad[node]) {
if (vis[child]) continue;
dfs(child);
if (dp[child][1] + w >= dp[node][1]) {
dp[node][0] = dp[node][1];
dp[node][1] = dp[child][1] + w;
} else if (dp[child][1] + w > dp[node][0]) {
dp[node][0] = dp[child][1] + w;
}
}
ans = max(ans, dp[node][1] + dp[node][0]);
}
void dfs1(int node, int par, int cur) {
mn = min(mn, max(cur, dp[node][1]));
for (auto [child, w] : ad[node]) {
if (child == par) continue;
dfs1(child, node, max(cur, (dp[node][1] == dp[child][1] + w ? dp[node][0] : dp[node][1])) + w);
}
}
컴파일 시 표준 에러 (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... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |