Submission #7934

# Submission time Handle Problem Language Result Execution time Memory
7934 2014-08-26T10:09:43 Z cki86201 배열 탈출 (GA8_array) C++
Compilation error
0 ms 0 KB
#include<stdio.h>
int a[2225][2225], d[2225][2225];
int main(){
  int n,i,j;
  scanf("%d",&n);
  for(i=1;i<=n;i++)for(j=1;j<=n;j++)scanf("%d",a[i]+j);
  for(i=0;i<=n;i++)d[i][0] = d[0][i] = 22222;
  for(i=1;i<=n;i++)for(j=1;j<=n;j++){
    if(i+j==2)continue;
    d[i][j] = min(d[i-1][j] + ((a[i-1][j]>a[i][j]) ? 0 : a[i][j]-a[i-1][j]+1), d[i][j-1] + ((a[i][j-1]>a[i][j]) ? 0 : a[i][j]-a[i][j-1]+1));
  }
  printf("%d",d[n][n]);
  return 0;
}

Compilation message

array.cpp: In function 'int main()':
array.cpp:10:139: error: 'min' was not declared in this scope
array.cpp:5:17: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
array.cpp:6:55: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]