답안 #45529

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
45529 2018-04-15T00:40:05 Z IvanC Maxcomp (info1cup18_maxcomp) C++17
60 / 100
500 ms 13464 KB
#include <bits/stdc++.h>
using namespace std;
const int MAXN = 1e3 + 10;
const int INF = 1e9 + 1e4;
int N,M,matriz[MAXN][MAXN],linear[MAXN],melhor;
int main(){
	scanf("%d %d",&N,&M);
	melhor = 0;
	for(int i = 1;i<=N;i++){
		for(int j = 1;j<=M;j++){
			scanf("%d",&matriz[i][j]);
		}
	}
	for(int i = 1;i<=N;i++){
		for(int j = 1;j<=M;j++){
			for(int r = 1;r<=N;r++){
				for(int c = 1;c<=M;c++){
					melhor = max(melhor, matriz[i][j] - matriz[r][c] - abs(i - r) - abs(j - c)  );
				}
			}
		}
	}
	printf("%d\n",melhor - 1);
	return 0;
}

Compilation message

maxcomp.cpp: In function 'int main()':
maxcomp.cpp:7:7: 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:9: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
    scanf("%d",&matriz[i][j]);
    ~~~~~^~~~~~~~~~~~~~~~~~~~
# 결과 실행 시간 메모리 Grader output
1 Correct 2 ms 376 KB Output is correct
2 Correct 2 ms 376 KB Output is correct
3 Correct 2 ms 556 KB Output is correct
4 Correct 2 ms 556 KB Output is correct
5 Correct 2 ms 556 KB Output is correct
6 Correct 2 ms 556 KB Output is correct
7 Correct 2 ms 564 KB Output is correct
8 Correct 2 ms 616 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 4 ms 692 KB Output is correct
2 Correct 3 ms 692 KB Output is correct
3 Correct 4 ms 724 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 2 ms 376 KB Output is correct
2 Correct 2 ms 376 KB Output is correct
3 Correct 2 ms 556 KB Output is correct
4 Correct 2 ms 556 KB Output is correct
5 Correct 2 ms 556 KB Output is correct
6 Correct 2 ms 556 KB Output is correct
7 Correct 2 ms 564 KB Output is correct
8 Correct 2 ms 616 KB Output is correct
9 Correct 15 ms 868 KB Output is correct
10 Correct 26 ms 904 KB Output is correct
11 Correct 15 ms 928 KB Output is correct
12 Correct 26 ms 968 KB Output is correct
13 Correct 16 ms 992 KB Output is correct
14 Correct 26 ms 1032 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 2 ms 376 KB Output is correct
2 Correct 2 ms 376 KB Output is correct
3 Correct 2 ms 556 KB Output is correct
4 Correct 2 ms 556 KB Output is correct
5 Correct 2 ms 556 KB Output is correct
6 Correct 2 ms 556 KB Output is correct
7 Correct 2 ms 564 KB Output is correct
8 Correct 2 ms 616 KB Output is correct
9 Correct 4 ms 692 KB Output is correct
10 Correct 3 ms 692 KB Output is correct
11 Correct 4 ms 724 KB Output is correct
12 Correct 15 ms 868 KB Output is correct
13 Correct 26 ms 904 KB Output is correct
14 Correct 15 ms 928 KB Output is correct
15 Correct 26 ms 968 KB Output is correct
16 Correct 16 ms 992 KB Output is correct
17 Correct 26 ms 1032 KB Output is correct
18 Execution timed out 1078 ms 13464 KB Time limit exceeded
19 Halted 0 ms 0 KB -