Submission #768316

# Submission time Handle Problem Language Result Execution time Memory
768316 2023-06-27T22:36:43 Z HD1 Cyberland (APIO23_cyberland) C++17
0 / 100
47 ms 14028 KB
//we are all lost trying to be someone.
#include <bits/stdc++.h>
#include "cyberland.h"
#define fastio ios_base::sync_with_stdio(0); cin.tie(0);
#define sz(x) ll(x.size())
#define reve(x) reverse(x.begin(),x.end())
#define ff first
#define ss second
using namespace std;
typedef int ll;
typedef long double ld;
typedef pair<ll,ll> ii;
const ll MAX=1e5+10;
const ll mod=1e9+7;
const ll inf=1e18;
vector<ll> gfo[MAX];
bool vst[MAX];
double dist[MAX];
map<ii,ll>A;
void bfs(ll ini){
    queue<ll> q;
    q.push(ini);
    vst[ini]=true;
    dist[ini]=0;
    while(sz(q)){
        ll u=q.front();
        q.pop();
        for(ll v:gfo[u]){
            if(!vst[v]){
                vst[v]=true;
                dist[v]=dist[u]+A[{u,v}];
                q.push(v);
            }
        }
    }
}
double solve(ll N, ll M, ll K,ll H, vector<ll> x, vector<ll> y, vector<ll> c, vector<ll> arr){
    for(ll i=0; i<M; i++){
        gfo[x[i]].push_back(y[i]);
        gfo[y[i]].push_back(x[i]);
        A[{x[i],y[i]}]=c[i];
        A[{y[i],x[i]}]=c[i];
    }
    bfs(0);
    return dist[H];

}

Compilation message

cyberland.cpp:15:14: warning: overflow in conversion from 'double' to 'll' {aka 'int'} changes value from '1.0e+18' to '2147483647' [-Woverflow]
   15 | const ll inf=1e18;
      |              ^~~~
# Verdict Execution time Memory Grader output
1 Incorrect 44 ms 2996 KB Wrong Answer.
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 42 ms 7624 KB Wrong Answer.
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 40 ms 8308 KB Wrong Answer.
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 44 ms 14028 KB Wrong Answer.
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 45 ms 7884 KB Wrong Answer.
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 41 ms 8524 KB Wrong Answer.
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 45 ms 8276 KB Wrong Answer.
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 47 ms 8424 KB Wrong Answer.
2 Halted 0 ms 0 KB -