// hola soy Dember :D
// 31/03/2024
#include "closing.h"
#include <bits/stdc++.h>
#define ll long long
#define pll pair<ll,ll>
#define f first
#define s second
#define Z size()
#define pb push_back
#define bp pop_back
#define fo(x,y,z) for(ll x=y; x<=z; x++)
#define of(x,y,z) for(ll x=y; x>=z; x--)
#define all(n) n.begin(), n.end()
#define arr(x,y,z) x+y, x+y+z
using namespace std;
ll n, x, y, k;
ll ans;
vector<vector<pll>> a(n);
vector<map<ll,ll>> vis(n+1), dis(n+1);
void q1(){
queue<int> q;
q.push(x);
while(!q.empty()){
auto u = q.front(); q.pop();
for(auto &e:a[u]){
ll v=e.f, w=e.s;
if(dis[x].count(v))continue;
dis[x][v]=dis[x][u]+w;
q.push(v);
}
}
return;
}
set<pair<int,pll>> q;
vector<ll> c(n);
vector<map<ll,pair<ll,pll>>> l(n);
vector<map<ll,ll>> in(n);
int max_score(int N, int X, int Y, ll K, vector<int>U, vector<int>V, vector<int>W) {
n=N;x=X;y=Y;k=K;
fo(i,0,n-1)a[U[i]].pb({V[i],W[i]}), a[V[i]].pb({U[i],W[i]});
dis[x][x]=dis[y][y]=0;
q1();
swap(x,y);
q1();
swap(x,y);
q.insert({0,{x,x}});
q.insert({0,{y,y}});
l[x][x]={0,{x,x}};
l[y][y]={0,{y,y}};
in[x][x]=1;
in[y][y]=1;
return ans;
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Runtime error |
1 ms |
348 KB |
Execution killed with signal 11 |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Runtime error |
46 ms |
10068 KB |
Execution killed with signal 11 |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Runtime error |
1 ms |
348 KB |
Execution killed with signal 11 |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Runtime error |
1 ms |
348 KB |
Execution killed with signal 11 |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Runtime error |
1 ms |
348 KB |
Execution killed with signal 11 |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Runtime error |
1 ms |
348 KB |
Execution killed with signal 11 |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Runtime error |
1 ms |
348 KB |
Execution killed with signal 11 |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Runtime error |
1 ms |
348 KB |
Execution killed with signal 11 |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Runtime error |
1 ms |
348 KB |
Execution killed with signal 11 |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Runtime error |
1 ms |
348 KB |
Execution killed with signal 11 |
2 |
Halted |
0 ms |
0 KB |
- |