Felix Halim .NET  
University Experience
IOI 2002 Yong In, Korea
ACM ICPC Regional Manila 2003
ACM ICPC Regional Manila 2004
ACM ICPC Regional Manila 2005
ACM ICPC Regional Kaohsiung 2006
ACM ICPC Regional Singapore 2007
ACM ICPC Regional Jakarta 2008 (ext)
ACM ICPC Regional Jakarta 2009 (ext)
ACM ICPC Regional Jakarta 2010
ACM ICPC Regional Jakarta 2012  Problem H
ACM ICPC Regional Jakarta 2013  Problem J (new!)
ACM ICPC World Final Tokyo 2007
Google India Code Jam 2005
Google India Code Jam 2006
Indonesia National Contest 2007
Indonesia National Contest 2008
Indonesia National Contest 2010
Facebook Hacker Cup 2011


ACM/ICPC Indonesia National Contest 2007Problem EThe Adventure in Panda Land Part I: Panda NumberTime Limit: 1sIn Panda Land, pandas have their own numeral system to represent a number. Surprisingly, this numeral system is similar to the famous Roman Numerals in our ancient civilization. Although pandas are aware about numeral system, they can not write (imagine how can a panda write!). Instead, they cut and arrange bamboos to form a number.
The aforementioned rules imply that there is exactly one representation in Panda Number for each number in decimal system. Unlike those Roman Numerals, pandas do recognize zero and negative number (which prove pandas are more advanced than our ancient Romans). To represent a negative number, they add one bamboo as a negative sign in front of the letters. Zero is a special number which doesn't fall into any rules above. To form a zero, pandas need five bamboos. The number of bamboos needed to form a number is the sum of required bamboos for each letter that appears in that number. For Example: 4108 = 4000+100+8 = (50001000)+100+5+1+1+1 = MECVIII (16 bamboos). 4109 = 4000+100+9 = (50001000)+100+(101) = MECIX (14 bamboos). 205 = [], 200+5 = 100+100+ 5 = CCV (9 bamboos) Given two numbers A and B, find out how many bamboos needed by panda to form (remember, they can't write) all number between A and B inclusively. InputThe input begins with a single positive integer T in a line indicating the number of test cases. Each case contains two numbers A and B (25,000,000 <= A <= B <= 25,000,000) in a line.OutputFor each case, print in a single line the number of needed bamboos to form all numbers between A and B (inclusive).Sample Input7 1 1 4018 4019 25000000 25000000 100 57 100 0 0 100 43 100 Sample Output8 28 2121000021 399 778 678 434 Problem Setter: Evan Leonardi Kembali ke pembahasan soal ini Lihat problem lain: 