# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
289658 | Pichon5 | Rail (IOI14_rail) | C++17 | 85 ms | 504 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 pb push_back
using namespace std;
void findLocation(int N, int first, int location[], int stype[]){
stype[0]=1;
location[0]=first;
int aux=1000000000,ind;
for(int i=1;i<N;i++){
int x=getDistance(i,0);
if(x<aux){
aux=x;
ind=i;
}
}
if(N==1)return;
stype[ind]=2;
location[ind]=first+aux;
for(int i=1;i<N;i++){
if(i==ind){
continue;
}
int x=getDistance(0,i);
int y=getDistance(ind,i);
if(x<y){
stype[i]=2;
location[i]=first+x;
}else{
stype[i]=1;
location[i]=first+aux-y;
}
}
}
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... |