Submission #316992

# Submission time Handle Problem Language Result Execution time Memory
316992 2020-10-29T00:30:25 Z daniel920712 Maxcomp (info1cup18_maxcomp) C++14
15 / 100
3 ms 384 KB
#include <iostream>
#include <stdio.h>
#include <stdlib.h>

using namespace std;
int all[1005][1005];
int main()
{
    int N,M,ans=0,i,j,k,l;
    scanf("%d %d",&N,&M);
    for(i=0;i<N;i++) for(j=0;j<M;j++) scanf("%d",&all[i][j]);
    for(i=0;i<N;i++)
    {
        for(j=0;j<N;j++)
        {
            for(k=0;k<M;k++)
            {
                for(l=0;l<M;l++) ans=max(ans,abs(all[i][k]-all[j][l])-abs(i-j)-abs(k-l)-1);
            }
        }
    }
    printf("%d\n",ans);
    return 0;
}

Compilation message

maxcomp.cpp: In function 'int main()':
maxcomp.cpp:10:10: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
   10 |     scanf("%d %d",&N,&M);
      |     ~~~~~^~~~~~~~~~~~~~~
maxcomp.cpp:11:44: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
   11 |     for(i=0;i<N;i++) for(j=0;j<M;j++) scanf("%d",&all[i][j]);
      |                                       ~~~~~^~~~~~~~~~~~~~~~~
# Verdict Execution time Memory Grader output
1 Correct 1 ms 384 KB Output is correct
2 Correct 0 ms 384 KB Output is correct
3 Incorrect 0 ms 384 KB Output isn't correct
4 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 3 ms 384 KB Output is correct
2 Correct 3 ms 384 KB Output is correct
3 Correct 3 ms 384 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 1 ms 384 KB Output is correct
2 Correct 0 ms 384 KB Output is correct
3 Incorrect 0 ms 384 KB Output isn't correct
4 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 1 ms 384 KB Output is correct
2 Correct 0 ms 384 KB Output is correct
3 Incorrect 0 ms 384 KB Output isn't correct
4 Halted 0 ms 0 KB -