# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
348471 | tengiz05 | Rail (IOI14_rail) | C++17 | 3085 ms | 49388 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include "rail.h"
#ifndef EVAL
#include "grader.cpp"
#endif
#include <bits/stdc++.h>
using namespace std;
const int MAXN = 5005;
int dist[MAXN][MAXN], n;
void findLocation(int N, int first, int location[], int stype[]){
n = N;
int cnt = 0;
for(int i=0;i<n;i++){
for(int j=0;j<n;j++){
dist[i][j] = getDistance(i,j);
cnt++;
if(cnt >= (4999*(4999-1))/2){i=0;break;}
}
}
for(int i=0;i<n;i++){
for(int j=0;j<n;j++){
assert(dist[i][j] == dist[j][i]);
}
}
stype[0]=1;
location[0]=first;
if(n == 1)return;
int cherez, mn = 1e9;
for(int i=1;i<n;i++){
if(mn > dist[0][i]){
mn = dist[0][i];
cherez = i;
}
}
//~ for(int i=0;i<n;i++){
//~ for(int j=0;j<n;j++){
//~ cout << dist[i][j] << ' ';
//~ }cout << '\n';
//~ }
for(int i=1;i<n;i++)stype[i]=2,location[i]=dist[0][i]+first;
for(int i=1;i<n;i++)
if(dist[0][i] == dist[0][cherez] + dist[cherez][i] && i!=cherez)
stype[i]=1,location[i]=location[cherez]-dist[cherez][i];
//~ for(int i=0;i<n;i++){
//~ cout << stype[i] << ' ' << location[i] << '\n';
//~ }
return;
}
컴파일 시 표준 에러 (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... |