# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
963232 | SuPythony | 악어의 지하 도시 (IOI11_crocodile) | C++17 | 6 ms | 8796 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include "crocodile.h"
#include <bits/stdc++.h>
using namespace std;
vector<vector<pair<int,int>>> al(1000, vector<pair<int,int>>());
vector<int> is_exit(1000, 0);
vector<int> dp(1000,0);
void dfs(int u, int p) {
if (is_exit[u]) return;
int mn=INT_MAX;
int mn2=0;
for (auto v: al[u]) {
if (v.first==p) continue;
dfs(v.first,u);
if (dp[v.first]+v.second<=mn) {
mn2=mn;
mn=min(mn,dp[v.first]+v.second);
}
}
dp[u]=mn2;
}
int travel_plan(int N, int M, int R[][2], int L[], int K, int P[])
{
for (int i=0; i<M; i++) {
int u=R[i][0], v=R[i][1];
al[u].push_back({v, L[i]});
al[v].push_back({u, L[i]});
}
for (int i=0; i<K; i++) {
is_exit[P[i]]=1;
}
if (is_exit[0]) return 0;
dfs(0,-1);
cout<<dp[0];
}
컴파일 시 표준 에러 (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... |