# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
1198622 | em4ma2 | 사이버랜드 (APIO23_cyberland) | C++20 | 17 ms | 6720 KiB |
// اللهم صل على محمد وعلى ال محمد كما صليت على ابراهيم وعلى ال ابراهيم انك حميد مجيد
#include "bits/stdc++.h"
using namespace std;
#define ll long long
//#define int long long
#define pb push_back
#define applejuice ios::sync_with_stdio(false);cin.tie(nullptr);cout.tie(nullptr);
const int mod=1e9+7;
const double inf=1e18;
const int mxsz=1e5+4;
const int off=1<<20;
double dis[mxsz];
vector<pair<int,int>>adj[mxsz];
double solve(int n,int m,int k,int h,vector<int>x,vector<int>y,vector<int>c,vector<int>a){
for(int i=0;i<=n;i++)dis[i]=inf;
for (int i=0;i<m;i++){
int tx=x[i],ty=y[i],tc=c[i];
adj[ty].pb({tc,tx});
adj[tx].pb({tc,ty});
}
priority_queue<pair<double,int>>pq;
dis[0]=0;
pq.push({0,0});
while (!pq.empty()){
auto [w,i]=pq.top();
w*=-1;
pq.pop();
if (w>dis[i])continue;
for (auto [tw,j]:adj[i]){
if (tw+w<dis[j]){
dis[j]=tw+w;
pq.push({-dis[j],j});
}
}
}
if (dis[h]==inf){
cout<<-1<<endl;
}else{
cout<<dis[h]<<endl;
}
}
/*
signed main() {
applejuice;
return 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... |
# | 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... |