# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
467006 | LucaIlie | Maxcomp (info1cup18_maxcomp) | C11 | 1 ms | 332 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include <stdio.h>
#define MAX_N 1000
int a[MAX_N][MAX_N];
int abs( int a ) {
return a > 0 ? a : -a;
}
int main() {
FILE *fin, *fout;
int n, m, maxW, w, l, c, l1, c1, l2, c2;
fin = fopen( "maxcomp.in", "r" );
fscanf( fin, "%d%d", &n, &m );
for ( l = 0; l < n; l++ ) {
for ( c = 0; c < m; c++ )
fscanf( fin, "%d", &a[l][c] );
}
maxW = -1;
for ( l1 = 0; l1 < n; l1++ ) {
for ( c1 = 0; c1 < m; c1++ ) {
for ( l2 = 0; l2 < n; l2++ ) {
for ( c2 = 0; c2 < m; c2++ ) {
w = abs( a[l1][c1] - a[l2][c2] ) - abs( l1 - l2 ) - abs( c1 - c2 ) - 1;
if ( w > maxW )
maxW = w;
}
}
}
}
fout = fopen( "maxcomp.out", "w" );
fprintf( fout, "%d", maxW );
return 0;
}
컴파일 시 표준 에러 (stderr) 메시지
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |