제출 #316993

#제출 시각아이디문제언어결과실행 시간메모리
316993daniel920712Maxcomp (info1cup18_maxcomp)C++14
60 / 100
1096 ms12792 KiB
#include <iostream> #include <stdio.h> #include <stdlib.h> using namespace std; int all[1005][1005]; int main() { int N,M,ans=-2e9,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++) { if(i==j&&k==l) continue; ans=max(ans,abs(all[i][k]-all[j][l])-abs(i-j)-abs(k-l)-1); } } } } printf("%d\n",ans); return 0; }

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

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 timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...