Help for this page

Select Code to Download


  1. or download this
    ruby -we '@a = (0 .. 10).map { (0 .. 667).map { (0 .. 101).map { (); }
    +; }; }; def res c = 10, t = 667, m = 101; if t < 0; 0; else @a[c][t][
    +m] ||= if 0 == c && 0 == t; 1; elsif 0 == c; 0; elsif 0 == t; 0; else
    + (1 ... m).inject(0) {|r, x| r + res(c - 1, t - x, x); } end; end; en
    +d; (1 .. 10).each {|c| res c; warn "[c=#{c}]"; }; p res;'
    
  2. or download this
     ruby -we '@a = (0 .. 10).map { (0 .. 667).map { (0 .. 101).map { (); 
    +}; }; }; def res c = 10, t = 667, m = 101; if t < 0; 0; else @a[c][t]
    +[m] ||= if 0 == c && 0 == t; 1; elsif 0 == c; 0; elsif 0 == t; 0; els
    +e (1 ... m).inject(0) {|r, x| r + res(c - 1, t - x, x); } end; end; e
    +nd; p res;'
    14479062752