이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include "rail.h"
#include <bits/stdc++.h>
using namespace std;
typedef pair<int, int> pi;
#define mp make_pair
#define f first
#define s second
const int MOD = 1000000007;
const int mx = 5005;
int pos1[mx];
int pos2[mx];
void findLocation(int N, int first, int location[], int stype[])
{
stype[0] = 1;
location[0] = first;
pi mn = mp(MOD, -1);
for(int i = 1; i < N; i++){
pos1[i] = getDistance(0, i);
mn = min(mn, mp(pos1[i], i));
}
stype[mn.s] = 2;
location[mn.s] = first+mn.f;
for(int i = 1; i < N; i++){
if(i == mn.s) continue;
pos2[i] = getDistance(mn.s, i);
}
for(int i = 1; i < N; i++){
if(i == mn.s) continue;
if(pos1[i] > pos2[i]){
stype[i] = 1;
location[i] = first-(pos1[i]-2*mn.f);
}
else{
stype[i] = 2;
location[i] = first+pos1[i];
}
}
// stype[0] = 1;
// location[0] = first;
// for(int i = 1; i < N; i++){
// stype[i] = 2;
// location[i] = location[0]+getDistance(0, i);
// }
}
| # | 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... |