#include "rail.h"
#include <bits/stdc++.h>
using namespace std;
void findLocation(int n, int first, int ans[], int type[]) {
ans[0] = first;
vector<int> a(n), b(n);
type[0] = 1;
int mn = 1e9;
for (int i = 1; i < n; i++) {
a[i] = getDistance(0, i);
b[i] = getDistance(i, 0);
if (a[i] == b[i]) {
type[i] = 2;
ans[i] = first + a[i];
mn = min(mn, a[i]);
} else {
type[i] = 1;
}
}
for (int i = 1; i < n; i++) {
if (type[i] == 1) {
if (a[i] > b[i]) {
ans[i] = first - b[i];
} else {
ans[i] = first + a[i];
}
}
}
}
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
0 ms |
348 KB |
Output is correct |
2 |
Correct |
0 ms |
348 KB |
Output is correct |
3 |
Correct |
0 ms |
348 KB |
Output is correct |
4 |
Correct |
0 ms |
348 KB |
Output is correct |
5 |
Correct |
0 ms |
348 KB |
Output is correct |
6 |
Correct |
1 ms |
504 KB |
Output is correct |
7 |
Correct |
0 ms |
348 KB |
Output is correct |
8 |
Correct |
0 ms |
348 KB |
Output is correct |
9 |
Correct |
0 ms |
500 KB |
Output is correct |
10 |
Correct |
0 ms |
348 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
0 ms |
348 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
43 ms |
604 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
42 ms |
604 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |