# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
101531 | errorgorn | 섬 항해 (CEOI13_adriatic) | C++14 | 2070 ms | 9240 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include <cstdio>
#include <utility>
#include <cstring>
#include <algorithm>
using namespace std;
typedef pair<int,int> ii;
int n;
ii arr[1505];
int asps[1505][1505];
void print(){
for (int x=0;x<n;x++){
for (int y=0;y<n;y++)
printf("%d ",asps[x][y]);
printf("\n");
}
}
int main(){
//freopen("input.txt","r",stdin);
memset(asps,63,sizeof(asps));
int a,b;
scanf("%d",&n);
for (int x=0;x<n;x++){
scanf("%d%d",&a,&b);
arr[x]=ii(a,b);
}
for (int x=0;x<n;x++)
for (int y=0;y<n;y++)
if ((arr[x].first<arr[y].first && arr[x].second<arr[y].second)||(arr[x].first>arr[y].first && arr[x].second>arr[y].second)) asps[x][y]=1;
for (int k=0;k<n;k++)
for (int x=0;x<n;x++)
for (int y=0;y<n;y++)
asps[x][y]=min(asps[x][y],asps[x][k]+asps[k][y]);
int _max;
for (int x=0;x<n;x++){
_max=0;
for (int y=0;y<n;y++){
if (x!=y) _max+=asps[x][y];
}
printf("%d\n",_max);
}
}
컴파일 시 표준 에러 (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... |