제출 #421783

#제출 시각아이디문제언어결과실행 시간메모리
421783Andyvanh1철로 (IOI14_rail)C++14
30 / 100
104 ms968 KiB
#include <bits/stdc++.h> #include "rail.h" using namespace std; #define vt vector #define pb push_back #define all(x) (x).begin(),(x).end() #define rep(i,x) for(int (i) = 0; (i) < (x); (i)++) #define INF 0x3f3f3f3f #define MOD 1000000007 typedef long long ll; typedef long double ld; typedef vt<int> vi; typedef pair<int,int> pii; int dist[102][102]; void findLocation(int n,int first, int location[], int stype[]){ for(int i = 0; i < n; i++){ for(int j = 0; j < n; j++){ dist[i][j] = getDistance(i,j); } } location[0] = first; stype[0] = 1; int c = -1; int MinDist = INF; for(int i =1; i < n; i++){ if(dist[0][i]<MinDist){ MinDist = dist[0][i]; c = i; } } location[c] = first+dist[0][c]; stype[c] = 2; for(int i = 1; i < n; i++){ if(i==c)continue; if(dist[0][i]-dist[c][i]==dist[0][c]){ location[i] = location[c]-dist[c][i]; stype[i] = 1; }else{ location[i] = first + dist[0][i]; stype[i] = 2; } } }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...