답안 #101529

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
101529 2019-03-19T03:45:44 Z errorgorn 섬 항해 (CEOI13_adriatic) C++14
0 / 100
11 ms 9216 KB
#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);
    }
}

Compilation message

adriatic.cpp: In function 'int main()':
adriatic.cpp:18:12: warning: ignoring return value of 'FILE* freopen(const char*, const char*, FILE*)', declared with attribute warn_unused_result [-Wunused-result]
     freopen("input.txt","r",stdin);
     ~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~
adriatic.cpp:21:10: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
     scanf("%d",&n);
     ~~~~~^~~~~~~~~
adriatic.cpp:23:14: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
         scanf("%d%d",&a,&b);
         ~~~~~^~~~~~~~~~~~~~
# 결과 실행 시간 메모리 Grader output
1 Incorrect 11 ms 9216 KB Output isn't correct
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 9 ms 9216 KB Output isn't correct
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 10 ms 9088 KB Output isn't correct
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 11 ms 9216 KB Output isn't correct
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 10 ms 9216 KB Output isn't correct
2 Halted 0 ms 0 KB -