# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
497087 | 2021-12-22T10:50:31 Z | kingline | Maxcomp (info1cup18_maxcomp) | C++17 | 500 ms | 15880 KB |
#include <bits/stdc++.h> #pragma GCC optimize ("unroll-loops,Ofast,O3") #pragma GCC target("avx,avx2,fma") #define pii pair < int, int > using namespace std; int n, m, c[1005][1005]; pair < int, pii > v[1000005]; main() { //file("pieaters"); /*ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);*/ //cin >> n >> m; scanf("%d%d", &n, &m); int num = 1; for(int i = 1; i <= n; i++) { for(int j = 1; j <= m; j++) { //cin >> c[i][j]; scanf("%d", &c[i][j]); v[num] = {c[i][j], {i, j}}; num++; } } sort(v + 1, v + n * m + 1); int ans = -1; for(int i = n * m; i > 0; i--) { for(int j = i - 1; j > 0; j--) { ans = max(ans, v[i].first - v[j].first - abs(v[i].second.first - v[j].second.first) - abs(v[i].second.second - v[j].second.second) - 1); } } printf("%d", ans); }
Compilation message
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Correct | 0 ms | 204 KB | Output is correct |
2 | Correct | 0 ms | 204 KB | Output is correct |
3 | Correct | 0 ms | 204 KB | Output is correct |
4 | Correct | 0 ms | 204 KB | Output is correct |
5 | Correct | 0 ms | 204 KB | Output is correct |
6 | Correct | 0 ms | 204 KB | Output is correct |
7 | Correct | 0 ms | 204 KB | Output is correct |
8 | Correct | 0 ms | 204 KB | Output is correct |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Correct | 1 ms | 204 KB | Output is correct |
2 | Correct | 1 ms | 204 KB | Output is correct |
3 | Correct | 1 ms | 204 KB | Output is correct |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Correct | 0 ms | 204 KB | Output is correct |
2 | Correct | 0 ms | 204 KB | Output is correct |
3 | Correct | 0 ms | 204 KB | Output is correct |
4 | Correct | 0 ms | 204 KB | Output is correct |
5 | Correct | 0 ms | 204 KB | Output is correct |
6 | Correct | 0 ms | 204 KB | Output is correct |
7 | Correct | 0 ms | 204 KB | Output is correct |
8 | Correct | 0 ms | 204 KB | Output is correct |
9 | Correct | 2 ms | 460 KB | Output is correct |
10 | Correct | 3 ms | 460 KB | Output is correct |
11 | Correct | 3 ms | 460 KB | Output is correct |
12 | Correct | 3 ms | 460 KB | Output is correct |
13 | Correct | 3 ms | 460 KB | Output is correct |
14 | Correct | 3 ms | 460 KB | Output is correct |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Correct | 0 ms | 204 KB | Output is correct |
2 | Correct | 0 ms | 204 KB | Output is correct |
3 | Correct | 0 ms | 204 KB | Output is correct |
4 | Correct | 0 ms | 204 KB | Output is correct |
5 | Correct | 0 ms | 204 KB | Output is correct |
6 | Correct | 0 ms | 204 KB | Output is correct |
7 | Correct | 0 ms | 204 KB | Output is correct |
8 | Correct | 0 ms | 204 KB | Output is correct |
9 | Correct | 1 ms | 204 KB | Output is correct |
10 | Correct | 1 ms | 204 KB | Output is correct |
11 | Correct | 1 ms | 204 KB | Output is correct |
12 | Correct | 2 ms | 460 KB | Output is correct |
13 | Correct | 3 ms | 460 KB | Output is correct |
14 | Correct | 3 ms | 460 KB | Output is correct |
15 | Correct | 3 ms | 460 KB | Output is correct |
16 | Correct | 3 ms | 460 KB | Output is correct |
17 | Correct | 3 ms | 460 KB | Output is correct |
18 | Execution timed out | 1093 ms | 15880 KB | Time limit exceeded |
19 | Halted | 0 ms | 0 KB | - |