# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
1069015 | NemanjaSo2005 | Rail (IOI14_rail) | C++17 | 77 ms | 98668 KiB |
This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#include "rail.h"
#include<bits/stdc++.h>
#define ll long long
#define f first
#define s second
using namespace std;
const int maxn=5005;
int kesh[maxn][maxn],N,idxC,idxD,poz[maxn],tip[maxn],D,A,B;
vector<pair<int,int>> V;
queue<int> Q;
bool CjeA=false;
int dist(int a,int b){
if(a==b)
return 0;
if(kesh[a][b]==-2){
// cout<<a<<" - "<<b<<": ";
int x=getDistance(a,b);
// cout<<x<<endl;
kesh[a][b]=kesh[b][a]=x;
}
return kesh[a][b];
}
int distc(int x){
if(CjeA)
return dist(A,x);
return dist(A,x)-dist(A,B)+D;
}
set<int> PC,PD;
/*bool prov(int l,int r,int x){
if(stations[l].location>stations[r].location)
Compilation message (stderr)
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |