# |
제출 시각 |
아이디 |
문제 |
언어 |
결과 |
실행 시간 |
메모리 |
889031 |
2023-12-18T16:07:02 Z |
aguss |
철로 (IOI14_rail) |
C++14 |
|
44 ms |
604 KB |
#include "rail.h"
#include <bits/stdc++.h>
#define _USE_MATH_DEFINES
#define endl "\n"
#define sp " "
#define f1(i, x) for(auto &i : x)
#define f2(i, x) for(ll i = 0; i < x; i++)
#define raya() cout << endl << "====================================" << endl
using namespace std;
typedef long long ll;
void findLocation(int N, int first, int location[], int stype[]){
vector<pair<int, int>> a;
for(int i = 1; i < N; i++) a.push_back({getDistance(0, i), i});
sort(a.begin(), a.end());
int f = a[0].second;
set<int> b;
for(int i = 0; i < N; i++)
if(getDistance(0, i) != getDistance(i, 0))
b.insert(i);
for(int i = 0; i < N; i++){
if(b.count(i)){
location[i] = first - getDistance(i, f) - getDistance(0, f) ;
stype[i] = 1;
} else {
location[i] = first + getDistance(0, i);
stype[i] = i != 0 ? 2 : 1;
}
}
}
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
1 ms |
344 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 |
416 KB |
Output is correct |
6 |
Correct |
0 ms |
348 KB |
Output is correct |
7 |
Correct |
0 ms |
600 KB |
Output is correct |
8 |
Correct |
1 ms |
348 KB |
Output is correct |
9 |
Correct |
0 ms |
344 KB |
Output is correct |
10 |
Correct |
1 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 |
44 ms |
604 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
44 ms |
600 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |