Elite 2009 December Competition contes, Bronze division
题目比较简单,给一串数按照下面的方法求最后的值,是到模拟基础题
1 2 3 4 5 6 | 7 8 9 10 11
1 2 3 | 4 5 6
1 2 | 3
1 2 => 1*2=2 added to sum -> sum=2
3 => sent home with rose
4 5 | 6
4 5 => 4*5=20 added to sum -> sum=22
6 => sent home with rose
7 8 9 | 10 11
7 8 | 9
7 8 => 7*8=56 added to sum -> sum=78
9 => sent home with rose
10 11 => 10*11=110 added to sum -> sum=188
So the sum for this dance would be 188.
rookie的代码: