Skip to content

Instantly share code, notes, and snippets.

@graph226
Last active July 7, 2016 12:49
Show Gist options
  • Save graph226/edbf2490bf71b2780fb54b67cfebf5eb to your computer and use it in GitHub Desktop.
Save graph226/edbf2490bf71b2780fb54b67cfebf5eb to your computer and use it in GitHub Desktop.
WasedaU Exam for graduate scool

2014年度プログラミング課題

1-1

(1-1-1)

int Kaijo(int n){
  if(n < 1) {
    return 1;
  }else{
    return n * Kaijo(n-1);
  }
}

(1-1-2)

int Count1(int i, int j){
  return Kaijo(i+j)/(Kaijo(i)*Kaijo(j));
}

1-2

int Count2(int i, int j){
  if(i==0 || j==0){
    return 1;
  }else{
    return route(i-1, j) + route(i, j-1);
  }
}

1-3

20, 15, 35

1-4

int Count3(int I, int J, int i0, int j0, int i1, int j1){
  return Count1(I, J) - Count1(i0, j0) * Count1(i1 - i0, j1 - j0) * Count1(i1, j1);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment