# | 제출 시각UTC-0 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
132496 | socho | 경주 (Race) (IOI11_race) | C++14 | 3019 ms | 12208 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include "race.h"
#include <bits/stdc++.h>
using namespace std;
int n, targ;
vector<pair<int, int> > adj[200005]; // other, dist
bool vis[200005];
pair<int, int> dstore[200005];
void dfs(int node, int dist, int paths) {
// dist: current distance, paths: num paths
vis[node] = true;
for (int i=0; i<adj[node].size(); i++) {
int cons = adj[node][i].first;
if (!vis[cons]) {
dfs(cons, dist+adj[node][i].second, paths+1);
}
}
dstore[node] = make_pair(dist, paths);
}
int getbest(int s) {
memset(vis, 0, sizeof vis);
dfs(s, 0, 0);
int best = INT_MAX;
bool can = false;
for (int i=0; i<n; i++) {
if (dstore[i].first == targ) {
can = true;
best = min(best, dstore[i].second);
컴파일 시 표준 에러 (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... |