# |
Submission time |
Handle |
Problem |
Language |
Result |
Execution time |
Memory |
7841 |
2014-08-19T11:18:22 Z |
whiteout |
배열 탈출 (GA8_array) |
C++ |
|
636 ms |
39696 KB |
#include <stdio.h>
int a[2223][2223],n,i,j,b[2223][2223];
int am(int a,int b){return a>b?a:b;}
int bm(int a,int b){return a>b?b:a;}
int main()
{
scanf("%d",&n);
for(i=1;i<=n;i++)
{
for(j=1;j<=n;j++)
{
scanf("%d",&a[i][j]);
}
}
for(i=1;i<=n;i++)
{
for(j=1;j<=n;j++)
{
if(i==1)
{
if(j==1)
{
continue;
}
b[1][j]=am(0,a[1][j]-a[1][j-1]+1)+b[1][j-1];
}
else if(j==1)
{
b[i][1]=am(0,a[i][1]-a[i-1][1]+1)+b[i-1][1];
}
else
{
b[i][j]=bm(am(0,a[i][j]-a[i][j-1]+1)+b[i][j-1],am(0,a[i][j]-a[i-1][j]+1)+b[i-1][j]);
}
}
}
printf("%d",b[n][n]);
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
0 ms |
39696 KB |
Output is correct |
2 |
Correct |
0 ms |
39696 KB |
Output is correct |
3 |
Correct |
0 ms |
39696 KB |
Output is correct |
4 |
Correct |
0 ms |
39696 KB |
Output is correct |
5 |
Correct |
0 ms |
39696 KB |
Output is correct |
6 |
Correct |
0 ms |
39696 KB |
Output is correct |
7 |
Correct |
0 ms |
39696 KB |
Output is correct |
8 |
Correct |
0 ms |
39696 KB |
Output is correct |
9 |
Correct |
0 ms |
39696 KB |
Output is correct |
10 |
Correct |
0 ms |
39696 KB |
Output is correct |
11 |
Correct |
0 ms |
39696 KB |
Output is correct |
12 |
Correct |
0 ms |
39696 KB |
Output is correct |
13 |
Correct |
0 ms |
39696 KB |
Output is correct |
14 |
Correct |
0 ms |
39696 KB |
Output is correct |
15 |
Correct |
0 ms |
39696 KB |
Output is correct |
16 |
Correct |
0 ms |
39696 KB |
Output is correct |
17 |
Correct |
0 ms |
39696 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
0 ms |
39696 KB |
Output is correct |
2 |
Correct |
0 ms |
39696 KB |
Output is correct |
3 |
Correct |
0 ms |
39696 KB |
Output is correct |
4 |
Correct |
0 ms |
39696 KB |
Output is correct |
5 |
Correct |
0 ms |
39696 KB |
Output is correct |
6 |
Correct |
0 ms |
39696 KB |
Output is correct |
7 |
Correct |
0 ms |
39696 KB |
Output is correct |
8 |
Correct |
0 ms |
39696 KB |
Output is correct |
9 |
Correct |
0 ms |
39696 KB |
Output is correct |
10 |
Correct |
0 ms |
39696 KB |
Output is correct |
11 |
Correct |
0 ms |
39696 KB |
Output is correct |
12 |
Correct |
0 ms |
39696 KB |
Output is correct |
13 |
Correct |
0 ms |
39696 KB |
Output is correct |
14 |
Correct |
0 ms |
39696 KB |
Output is correct |
15 |
Correct |
0 ms |
39696 KB |
Output is correct |
16 |
Correct |
0 ms |
39696 KB |
Output is correct |
17 |
Correct |
0 ms |
39696 KB |
Output is correct |
18 |
Correct |
0 ms |
39696 KB |
Output is correct |
19 |
Correct |
0 ms |
39696 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
8 ms |
39696 KB |
Output is correct |
2 |
Correct |
8 ms |
39696 KB |
Output is correct |
3 |
Correct |
4 ms |
39696 KB |
Output is correct |
4 |
Correct |
0 ms |
39696 KB |
Output is correct |
5 |
Correct |
8 ms |
39696 KB |
Output is correct |
6 |
Correct |
8 ms |
39696 KB |
Output is correct |
7 |
Correct |
4 ms |
39696 KB |
Output is correct |
8 |
Correct |
8 ms |
39696 KB |
Output is correct |
9 |
Correct |
4 ms |
39696 KB |
Output is correct |
10 |
Correct |
8 ms |
39696 KB |
Output is correct |
11 |
Correct |
8 ms |
39696 KB |
Output is correct |
12 |
Correct |
4 ms |
39696 KB |
Output is correct |
13 |
Correct |
0 ms |
39696 KB |
Output is correct |
14 |
Correct |
4 ms |
39696 KB |
Output is correct |
15 |
Correct |
4 ms |
39696 KB |
Output is correct |
16 |
Correct |
8 ms |
39696 KB |
Output is correct |
17 |
Correct |
0 ms |
39696 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
620 ms |
39696 KB |
Output is correct |
2 |
Correct |
636 ms |
39696 KB |
Output is correct |
3 |
Correct |
632 ms |
39696 KB |
Output is correct |
4 |
Correct |
608 ms |
39696 KB |
Output is correct |
5 |
Correct |
484 ms |
39696 KB |
Output is correct |
6 |
Correct |
544 ms |
39696 KB |
Output is correct |
7 |
Correct |
616 ms |
39696 KB |
Output is correct |
8 |
Correct |
596 ms |
39696 KB |
Output is correct |
9 |
Correct |
632 ms |
39696 KB |
Output is correct |
10 |
Correct |
592 ms |
39696 KB |
Output is correct |
11 |
Correct |
568 ms |
39696 KB |
Output is correct |
12 |
Correct |
608 ms |
39696 KB |
Output is correct |
13 |
Correct |
520 ms |
39696 KB |
Output is correct |
14 |
Correct |
564 ms |
39696 KB |
Output is correct |
15 |
Correct |
476 ms |
39696 KB |
Output is correct |
16 |
Correct |
616 ms |
39696 KB |
Output is correct |
17 |
Correct |
600 ms |
39696 KB |
Output is correct |
18 |
Correct |
528 ms |
39696 KB |
Output is correct |
19 |
Correct |
584 ms |
39696 KB |
Output is correct |
20 |
Correct |
580 ms |
39696 KB |
Output is correct |
21 |
Correct |
520 ms |
39696 KB |
Output is correct |