# | Submission time | Handle | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
782919 | 2023-07-14T11:31:30 Z | vjudge1 | Cyberland (APIO23_cyberland) | C++17 | 639 ms | 17320 KB |
#include <bits/stdc++.h> using namespace std; //#define int long long //#define mid (start+end)/2 //#define OYY 10000 //#define faster ios_base::sync_with_stdio(false);cin.tie(NULL); const long double OYY=1e112; double solve(int N, int M, int K, int H, std::vector<int> x, std::vector<int>y, std::vector<int> c, std::vector<int> arr){ int n=N; int m=M; int k=K; vector <vector<pair<long long int,long long int>>> v; v.assign(n,{}); k=min(k,70); for(int i=0;i<m;i++){ int a=x[i]; int b=y[i]; int co=c[i]; v[a].push_back({b,co}); v[b].push_back({a,co}); } vector <long double> uza(n,OYY); uza[0]=0; for(int ip=0;ip<=k+2;ip++){ set <pair<long double,int>> st; for(int i=0;i<n;i++){ st.insert({uza[i],i}); } while(!st.empty()){ int node=st.begin()->second; st.erase(st.begin()); if(node==H)continue; for(int i=0;i<v[node].size();i++){ int go=v[node][i].first; int cost=v[node][i].second; if(uza[go]>uza[node]+cost){ st.erase({uza[go],go}); uza[go]=uza[node]+cost; st.insert({uza[go],go}); } } } auto ne=uza; for(int j=0;j<n;j++){ if(uza[j]<OYY){ if(arr[j]==0)ne[j]=0; } else if(arr[j]==2 && ip>1 && ip!=k+2){ for(int i=0;i<v[j].size();i++){ int go=v[j][i].first; int cost=v[j][i].second; ne[go]=min(ne[go],uza[j]/2+(long double)cost); } } } uza=ne; } if(uza[H]<OYY){ return uza[H]; } return -1; }
Compilation message
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 56 ms | 476 KB | Wrong Answer. |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 287 ms | 880 KB | Correct. |
2 | Correct | 315 ms | 1468 KB | Correct. |
3 | Correct | 304 ms | 1352 KB | Correct. |
4 | Correct | 324 ms | 1368 KB | Correct. |
5 | Correct | 318 ms | 1480 KB | Correct. |
6 | Correct | 342 ms | 3072 KB | Correct. |
7 | Correct | 462 ms | 2948 KB | Correct. |
8 | Correct | 217 ms | 4596 KB | Correct. |
9 | Correct | 185 ms | 1144 KB | Correct. |
10 | Correct | 183 ms | 1112 KB | Correct. |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 293 ms | 1332 KB | Correct. |
2 | Correct | 314 ms | 1272 KB | Correct. |
3 | Correct | 281 ms | 1328 KB | Correct. |
4 | Correct | 191 ms | 764 KB | Correct. |
5 | Correct | 204 ms | 1220 KB | Correct. |
6 | Correct | 76 ms | 2100 KB | Correct. |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 618 ms | 12784 KB | Wrong Answer. |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 257 ms | 1356 KB | Correct. |
2 | Correct | 259 ms | 1352 KB | Correct. |
3 | Correct | 271 ms | 1436 KB | Correct. |
4 | Correct | 266 ms | 2664 KB | Correct. |
5 | Correct | 179 ms | 1096 KB | Correct. |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 289 ms | 1360 KB | Correct. |
2 | Correct | 222 ms | 1188 KB | Correct. |
3 | Correct | 639 ms | 17320 KB | Correct. |
4 | Correct | 219 ms | 2132 KB | Correct. |
5 | Correct | 186 ms | 1256 KB | Correct. |
6 | Correct | 244 ms | 1056 KB | Correct. |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 258 ms | 1368 KB | Wrong Answer. |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 549 ms | 1120 KB | Wrong Answer. |
2 | Halted | 0 ms | 0 KB | - |