# | Submission time | Handle | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
67111 | 2018-08-13T10:47:25 Z | ege_eksi | Maxcomp (info1cup18_maxcomp) | C++14 | 8 ms | 672 KB |
#include<iostream> #include<cstdio> #include<cstdlib> #include<climits> #include<algorithm> using namespace std; long long int a[1000][1000]; int main() { int n , m; scanf("%d %d",&n,&m); for(int i = 0 ; i < n ; i++) { for(int j = 0 ; j < m ; j++) { scanf("%lli",&a[i][j]); } } int i1 , j1 , i2 , j2; long long int ans = 0; long long int x; for(i1 = 0 ; i1 < n ; i1++) { for(j1 = 0 ; j1 < m ; j1++) { for(i2 = 0 ; i2 < n ; i2++) { for(j2 = 0 ; j2 < m ; j2++) { x = max(a[i1][j1] , a[i2][j2]) - min(a[i1][j1] , a[i2][j2]) - (abs(i1-i2) + abs(j1-j2) + 1); ans = max(ans , x); } } } } printf("%lli",ans); return 0; }
Compilation message
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 3 ms | 376 KB | Output is correct |
2 | Correct | 3 ms | 376 KB | Output is correct |
3 | Incorrect | 4 ms | 436 KB | Output isn't correct |
4 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 8 ms | 488 KB | Output is correct |
2 | Correct | 8 ms | 672 KB | Output is correct |
3 | Correct | 7 ms | 672 KB | Output is correct |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 3 ms | 376 KB | Output is correct |
2 | Correct | 3 ms | 376 KB | Output is correct |
3 | Incorrect | 4 ms | 436 KB | Output isn't correct |
4 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 3 ms | 376 KB | Output is correct |
2 | Correct | 3 ms | 376 KB | Output is correct |
3 | Incorrect | 4 ms | 436 KB | Output isn't correct |
4 | Halted | 0 ms | 0 KB | - |