Блог пользователя o0o0o

Автор o0o0o, 10 лет назад, По-английски

I personally feel good to use Codeblocks, its interface so good and feel free to code !

Can I customize the keyboard shortcuts, shortcut like Vim ?

Полный текст и комментарии »

  • Проголосовать: нравится
  • +20
  • Проголосовать: не нравится

Автор o0o0o, 10 лет назад, По-английски

Problem : Mina gives an integer V with length N to John. Then Mina changes V by the following command: “i j d”. This means “Change the digits in V from position i to j to d”, where 0 is the position of the most significant digit of V and N-1 is the position of the least significant digit. After each of these commands, John needs to calculate the sum of digits for U, where U = 2V. For example, let V = 1234. If Mina’s command is “0 2 2”, V becomes 2224. U = 2V = 4448. So sum of digits of U = 4 + 4 + 4 + 8 = 20, which is the answer John should provide. N (N<100001) and Query (Q<50001)

I am trying to solve this problem with segment tree with lazy , but figure out the solution.

How to solve this problem ?

Полный текст и комментарии »

  • Проголосовать: нравится
  • 0
  • Проголосовать: не нравится