i_will_love_you_forever's blog

By i_will_love_you_forever, history, 4 years ago, In English

Hi guy, I was trying to solve this problem (vietnameses) : https://mirror.codeforces.com/group/FLVn1Sc504/contest/274522/problem/Q

Translate : Given an integer n. Write all number from 1 to n and calculate sum of digit of all number.

For ex :

n = 5:   1 + 2 + 3 + 4 + 5 = 15

I found a solution for problem above : https://vnoi.info/problems/show_solution/SPSUM/1387592/

But i don't understand f10[] array in that code (after 5 hours thinking and still don't get it). Can somebody explain for me?

| Write comment?
»
4 years ago, # |
  Vote: I like it 0 Vote: I do not like it

maybe you should use DP digit for this problem