21을 예로들면
1 = 1
1 + 10 = 11
1 + 10 + 100 = 105 + 6
1 + 10 + 100 + 1000 = 105 + 21 + 966 + 19
1 + 10 + 100 + 1000 + 10000 = 105 + 21 + 966 + 21 + 9996 + 2
1 + 10 + 100 + 1000 + 10000 + 100000 = 105 + 21 + 966 + 9996 + 21 + 99981
오버플로우를 생각 못했네요
'Solutions > Fanta's Solution' 카테고리의 다른 글
PKU 2390. Bank Interest. AC (0) | 2010.05.16 |
---|---|
PKU 2551. Ones. AC (0) | 2010.05.10 |
PKU 3372. Candy Distribution. AC (1) | 2010.02.14 |
PKU 3224. Go for Lab Cup! AC (0) | 2010.02.01 |
PKU 2845. 01000001. AC (0) | 2010.01.25 |