Submission #751196

# Submission time Handle Problem Language Result Execution time Memory
751196 2023-05-31T07:43:12 Z coding_snorlax Cyberland (APIO23_cyberland) C++17
0 / 100
3000 ms 7804 KB
#include<bits/stdc++.h>
#include "cyberland.h"
using namespace std;
using ll = long long int;
vector<pair<ll,ll>> G[100002];
set<pair<ll,ll>> now_node;
ll dis[100002];
int vis[100002]={0};
double solve(int N,int M,int K,int H, vector<int> x,vector<int> y,vector<int> c,vector<int> arr){
    int n=N,m=M;
    for(int i=0;i<=n;i++){
        dis[i]=100000000000000;
    }
    for(int i=0;i<m;i++){
        G[x[i]].push_back(make_pair(c[i],y[i]));
        G[y[i]].push_back(make_pair(c[i],x[i]));
    }
    dis[0]=0;
    vis[0]=1;
    for(auto i:G[0]){
        dis[i.second]=dis[0]+i.first;
        now_node.insert(i);
    }
    dis[0]=0;
    while((int)now_node.size()){
        auto it = *now_node.begin();
        if(!vis[it.second]){
            vis[it.second]=1;
            for(auto now:G[it.second]){
                if(dis[now.second]>dis[it.second]+now.first){
                    dis[now.second]=dis[it.second]+now.first;
                    now_node.insert(make_pair(dis[now.second],now.second));
                }
            }
        }
        now_node.erase(it);
    }
    return dis[n-1];
}
# Verdict Execution time Memory Grader output
1 Execution timed out 3059 ms 3676 KB Time limit exceeded
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 25 ms 4848 KB Wrong Answer.
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 26 ms 5100 KB Wrong Answer.
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 29 ms 7804 KB Wrong Answer.
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 23 ms 5072 KB Wrong Answer.
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 25 ms 5248 KB Wrong Answer.
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 27 ms 5156 KB Wrong Answer.
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 24 ms 5076 KB Wrong Answer.
2 Halted 0 ms 0 KB -