# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
101605 | SomeoneUnknown | 섬 항해 (CEOI13_adriatic) | C++14 | 2047 ms | 263168 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include <bits/stdc++.h>
using namespace std;
typedef pair<int, int> ii;
typedef pair<int, ii> iii;
ii mii(int b, int c){
return make_pair(b,c);
}
int main(){
int n;
scanf("%d", &n);
ii ilands[n];
int dist[n][n];
for(int i = 0; i < n; i++){
int x, y;
scanf("%d %d", &x, &y);
ilands[i] = mii(x,y);
for(int j = 0; j < i; j++){
if((x > ilands[j].first && y > ilands[j].second) || (x < ilands[j].first && y < ilands[j].second)){
dist[i][j] = dist[j][i] = 1;
}else{
dist[i][j] = dist[j][i] = n+5;
}
}
dist[i][i] = 0;
}
for(int k = 0; k < n; k++)
for(int i = 0; i < n; i++)
for(int j = 0; j < n; j++)
dist[i][j] = min(dist[i][j], dist[i][k] + dist[k][j]);
for(int i = 0; i < n; i++){
int tal = 0;
for(int j = 0; j < n; j++){
tal += dist[i][j];
}
printf("%d\n", tal);
}
}
컴파일 시 표준 에러 (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... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |