# | 제출 시각UTC-0 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
398429 | AugustinasJucas | 악어의 지하 도시 (IOI11_crocodile) | C++14 | 585 ms | 62140 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include "crocodile.h"
#include <bits/stdc++.h>
using namespace std;
const int dydis = 1e5 + 10;
const long long inf = 1e18;
vector<pair<int, int> > gr[dydis];
int n, m, k;
pair<long long, long long> dist[dydis];
int kek[dydis];
bool don[dydis];
int travel_plan(int N, int M, int R[][2], int L[], int K, int P[]){
n = N; m = M; k = K;
for(int i = 0; i < n; i++) dist[i] = {inf, inf};
for(int i = 0; i < M; i++) {
gr[R[i][0]].push_back({R[i][1], L[i]});
gr[R[i][1]].push_back({R[i][0], L[i]});
}
priority_queue<pair<int, int> > q;
for(int i = 0; i < k; i++){
q.push({0, P[i]});
}
while(q.size()){
int v = q.top().second;
long long dst = -q.top().first;
q.pop();
if(don[v]) continue;
if(dst != 0 && (dst == inf || dst != dist[v].second)) continue;
don[v] = 1;
for(auto x : gr[v]){
long long gal = x.second + dst;
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |