제출 #76560

#제출 시각아이디문제언어결과실행 시간메모리
76560VardanyanMaxcomp (info1cup18_maxcomp)C++14
60 / 100
1055 ms13400 KiB
#include <bits/stdc++.h>
using namespace std;
const int N = 1005;
int a[N][N];
int main(){
    long long ans = -1;
    int n,m;
    scanf("%d%d",&n,&m);
    for(int i = 1;i<=n;i++){
        for(int j = 1;j<=m;j++){
            scanf("%d",&a[i][j]);

        }
    }
    for(int i = 1;i<=n;i++){
        for(int j = 1;j<=m;j++){
            for(int ii = 1;ii<=n;ii++){
                for(int jj = 1;jj<=m;jj++){
                    long long d = abs(ii-i)+abs(jj-j)+1;
                    long long x = abs(a[i][j]-a[ii][jj]);
                    x-=d;
                    ans = max(ans,x);
                }
            }
        }
    }
    cout<<ans<<endl;
    return 0;
}

컴파일 시 표준 에러 (stderr) 메시지

maxcomp.cpp: In function 'int main()':
maxcomp.cpp:8:10: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
     scanf("%d%d",&n,&m);
     ~~~~~^~~~~~~~~~~~~~
maxcomp.cpp:11:18: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
             scanf("%d",&a[i][j]);
             ~~~~~^~~~~~~~~~~~~~~
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...