# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
101564 | ShaneOng | 섬 항해 (CEOI13_adriatic) | C++14 | 2037 ms | 197216 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include<bits/stdc++.h>
#define INF 100000009
using namespace std;
int adjMat[5009][5009],n,col[5009],row[5009];
int main(){
scanf("%d",&n);
for(int x=0,a,b;x<n;x++){
scanf("%d%d",&a,&b);
row[x]=a;
col[x]=b;
for(int y=0;y<x;y++){
if(((row[x]>row[y])&&(col[x]>col[y]))||((row[x]<row[y])&&(col[x]<col[y]))){
adjMat[x][y]=1;
adjMat[y][x]=1;
}else{
adjMat[x][y]=INF;
adjMat[y][x]=INF;
}
}
}
for(int k=0;k<n;k++) for(int i=0;i<n;i++) for(int j=0;j<n;j++) adjMat[i][j]=min(adjMat[i][j],adjMat[i][k]+adjMat[k][j]);
for(int x=0;x<n;x++){
int sum=0;
for(int y=0;y<n;y++)
sum+=adjMat[x][y];
printf("%d\n",sum);
}
}
컴파일 시 표준 에러 (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... |