답안 #76530

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
76530 2018-09-14T13:39:11 Z Vardanyan Maxcomp (info1cup18_maxcomp) C++14
15 / 100
4 ms 940 KB
#include <bits/stdc++.h>
using namespace std;
const int N = 1005;
int a[N][N];
int main(){
    int ans = -1*1000*1000*1000-5;
    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 ii = 1;ii<=i;ii++){
                for(int jj = 1;jj<=j;jj++){
                    ans = max(ans,abs(a[i][j]-a[ii][jj])-(i-ii)-(j-jj)-1);
                }
            }
        }
    }
    cout<<ans<<endl;
    return 0;
}

Compilation message

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]);
             ~~~~~^~~~~~~~~~~~~~~
# 결과 실행 시간 메모리 Grader output
1 Correct 2 ms 504 KB Output is correct
2 Correct 2 ms 516 KB Output is correct
3 Correct 2 ms 628 KB Output is correct
4 Correct 2 ms 708 KB Output is correct
5 Correct 2 ms 756 KB Output is correct
6 Incorrect 2 ms 760 KB Output isn't correct
7 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 4 ms 784 KB Output is correct
2 Correct 3 ms 788 KB Output is correct
3 Correct 3 ms 940 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 2 ms 504 KB Output is correct
2 Correct 2 ms 516 KB Output is correct
3 Correct 2 ms 628 KB Output is correct
4 Correct 2 ms 708 KB Output is correct
5 Correct 2 ms 756 KB Output is correct
6 Incorrect 2 ms 760 KB Output isn't correct
7 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 2 ms 504 KB Output is correct
2 Correct 2 ms 516 KB Output is correct
3 Correct 2 ms 628 KB Output is correct
4 Correct 2 ms 708 KB Output is correct
5 Correct 2 ms 756 KB Output is correct
6 Incorrect 2 ms 760 KB Output isn't correct
7 Halted 0 ms 0 KB -