genzou #7216(2008/08/19 12:59 GMT) [ Groovy ] Rating0/0=0.00
wikipediaの数式を元に作成しました。 変数v、sもそのままです。
http://ja.wikipedia.org/wiki/%E3%83%89%E3%83%B3%E3%83%88%E5%BC%8F
1 2 3 4 5 6 7 8 9 10 11 12
println dont([ 123, 4, 56, 78 ], 100) def dont( vlist, countOfSheet ){ def groups = vlist.collect{ [ v:it, s:0 ] } countOfSheet.times{ def map = groups.max{ it.v/(it.s + 1) } map.s++ } groups.collect{ it.s } }
Rating0/0=0.00-0+
[ reply ]
genzou
#7216()
[
Groovy
]
Rating0/0=0.00
wikipediaの数式を元に作成しました。 変数v、sもそのままです。
http://ja.wikipedia.org/wiki/%E3%83%89%E3%83%B3%E3%83%88%E5%BC%8F
println dont([ 123, 4, 56, 78 ], 100) def dont( vlist, countOfSheet ){ def groups = vlist.collect{ [ v:it, s:0 ] } countOfSheet.times{ def map = groups.max{ it.v/(it.s + 1) } map.s++ } groups.collect{ it.s } }Rating0/0=0.00-0+
[ reply ]