Submission #7236

# Submission time Handle Problem Language Result Execution time Memory
7236 2014-07-28T12:18:13 Z gs13068 배열 탈출 (GA8_array) C++
0 / 100
572 ms 39696 KB
#include<cstdio>
#include<algorithm>

int a[2223][2223];
int d[2223][2223];

int main()
{
	int i,j,n;
	scanf("%d",&n);
	for(i=1;i<=n;i++)for(j=1;j<=n;j++)scanf("%d",&a[n-i+1][n-j+1]);
	for(i=2;i<=n;i++)a[i][0]=111000;
	for(j=2;j<=n;j++)a[0][j]=111000;
	for(i=1;i<=n;i++)for(j=1;j<=n;j++)d[i][j]=std::min(d[i-1][j]+std::max(a[i-1][j]-a[i][j]+1,0),d[i][j-1]+std::max(a[i][j-1]-a[i][j]+1,0));
	printf("%d",d[n][n]+a[1][1]-1);
}
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 39696 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 39696 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 4 ms 39696 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 572 ms 39696 KB Output isn't correct
2 Halted 0 ms 0 KB -