# |
Submission time |
Handle |
Problem |
Language |
Result |
Execution time |
Memory |
875978 |
2023-11-21T01:21:19 Z |
Darren0724 |
Rail (IOI14_rail) |
C++17 |
|
43 ms |
604 KB |
#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];
}
}
}
}
# |
Verdict |
Execution time |
Memory |
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 |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
0 ms |
348 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
43 ms |
604 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
42 ms |
604 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |