# | 제출 시각UTC-0 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
1126046 | m_bezrutchka | 꿈 (IOI13_dreaming) | C++20 | 257 ms | 15036 KiB |
#include "dreaming.h"
#include <bits/stdc++.h>
using namespace std;
typedef pair<int, int> pii;
const int MAXN = 1e5 + 10;
vector<pii> adj[MAXN];
int n, distante;
int dist[MAXN];
vector<vector<pii>> chains;
bool mrk_1[MAXN], mrk_2[MAXN];
void dfs(int v, int c, bool save) {
mrk_1[v] = true;
if (save) {
mrk_2[v] = true;
chains.back().push_back({v, c});
}
if (dist[distante] < dist[v]) {
distante = v;
}
for (auto [w, nc]: adj[v]) {
if (mrk_1[w]) continue;
dist[w] = dist[v] + nc;
dfs(w, nc, save);
}
}
void find_chain(int v) {
# | 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... |