# | Submission time | Handle | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
782730 | 2023-07-14T08:37:23 Z | vjudge1 | Cyberland (APIO23_cyberland) | C++17 | 28 ms | 6868 KB |
#include<bits/stdc++.h> using namespace std; #define lalala ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL); #define endl "\n" #define ll long long #define pb push_back #define uwu 100005 vector<pair<int,int>>adj[uwu]; double solve(int N, int M, int K, int H, vector<int> x, vector<int>y, vector<int> c, vector<int> arr){ int father[N]; ll int yol[N]; for(int i=0;i<N;i++){ father[i]=-1; yol[i]=1000000000000; } for(int i=0;i<M;i++){ adj[x[i]].pb({y[i],c[i]}); adj[y[i]].pb({x[i],c[i]}); } priority_queue<tuple<ll int,int,int>> pq; pq.push({(ll int)0,0,-1}); while(pq.size()){ ll int node,once, deg; tie(deg,node,once)=pq.top();deg=-deg; pq.pop(); //cout<<node<<" "<<once<<" "<<" "<<deg<<" "<<endl; if(yol[node]<=deg)continue; if(arr[node]==0){ deg=0; } yol[node]=deg; father[node]=once; for(auto u:adj[node]){ ll int kim=u.first, lira=u.second; pq.push({-(deg+lira),kim,node}); } } /*for(int i=0;i<N;i++)cout<<yol[i]<<" "; cout<<endl; for(int i=0;i<N;i++)cout<<father[i]<<" "; cout<<endl;*/ for(int i=0;i<N;i++)adj[i].clear(); if(yol[H]==1000000000000)yol[H]=-1; return (1.0)*yol[H]; }
Compilation message
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 14 ms | 2772 KB | Wrong Answer. |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 20 ms | 2756 KB | Correct. |
2 | Correct | 27 ms | 2948 KB | Correct. |
3 | Correct | 23 ms | 2920 KB | Correct. |
4 | Correct | 24 ms | 3000 KB | Correct. |
5 | Correct | 24 ms | 2992 KB | Correct. |
6 | Correct | 26 ms | 3788 KB | Correct. |
7 | Correct | 28 ms | 3716 KB | Correct. |
8 | Correct | 13 ms | 4564 KB | Correct. |
9 | Correct | 22 ms | 2876 KB | Correct. |
10 | Correct | 22 ms | 2780 KB | Correct. |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 24 ms | 2796 KB | Wrong Answer. |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 26 ms | 6868 KB | Wrong Answer. |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 19 ms | 2900 KB | Correct. |
2 | Correct | 24 ms | 3692 KB | Correct. |
3 | Correct | 22 ms | 3696 KB | Correct. |
4 | Correct | 25 ms | 4936 KB | Correct. |
5 | Correct | 24 ms | 3520 KB | Correct. |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 28 ms | 2876 KB | Wrong Answer. |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 28 ms | 2804 KB | Wrong Answer. |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 24 ms | 2896 KB | Wrong Answer. |
2 | Halted | 0 ms | 0 KB | - |