# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
96461 | dnass | Maxcomp (info1cup18_maxcomp) | C++14 | 1066 ms | 5084 KiB |
This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#include <cstdio>
#include <algorithm>
using namespace std;
int n, m;
int a[1005][1005];
int myabs(int x){
if(x<0) return (-1)*x;
return x;
}
int main(){
scanf("%d %d", &n, &m);
for(int i=0;i<n;i++){
for(int j=0;j<m;j++){
scanf("%d", &a[i][j]);
}
}
int mx = -1;
for(int i=0;i<n;i++){
for(int j=0;j<m;j++){
for(int k=0;k<n;k++){
for(int l=0;l<m;l++){
mx = max(mx, myabs(a[i][j]-a[k][l])-myabs(k-i)-myabs(l-j)-1);
}
}
}
}
printf("%d\n", mx);
return 0;
}
Compilation message (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... |