# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
497247 | FerThugGato12500 | Crocodile's Underground City (IOI11_crocodile) | C++98 | 2 ms | 2636 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include<bits/stdc++.h>
using namespace std;
#include "crocodile.h"
const int lmt = 100005;
struct wer{
int i, x;
};
bool operator < (const wer &a, const wer &b){
return a.x > b.x;
}
bool mark[lmt];
bool vis[lmt];
vector< pair<int, int> > ed[lmt];
int travel_plan(int N, int M, int R[][2], int L[], int K, int P[])
{
for(int i = 0; i < N; i++){
ed[R[i][0]].push_back({R[i][1],L[i]});
ed[R[i][1]].push_back({R[i][0],L[i]});
}
priority_queue<wer> mqun;
for(int i = 0; i < K; i++){
mqun.push({P[i],0});
mark[P[i]] = true;
}
while(mqun.size()){
int ind = mqun.top().i, v = mqun.top().x; mqun.pop();
// cout<<ind<<" "<<v<<" : ";
if(mark[ind]){
cout<<"a\n";
if(ind==0){
return v;
}
vis[ind] = true;
for(int i = 0; i < ed[ind].size(); i++){
int to = ed[ind][i].first, vs = v+ed[ind][i].second;
if(!vis[to]){
mqun.push({to,vs});
}
}
}else {
mark[ind] = true;
// cout<<"b\n";
}
}
}
컴파일 시 표준 에러 (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... |