rajkumar62506's blog

By rajkumar62506, history, 20 months ago, In English

Hello, Can anyone explain idea to solve E. Lucky Array problem. I tried to understand from editorial but I'm finding difficult to understand. Problem Link:E. Lucky Array

Problem Description: Petya loves lucky numbers. Everybody knows that lucky numbers are positive integers whose decimal representation contains only the lucky digits 4 and 7. For example, numbers 47, 744, 4 are lucky and 5, 17, 467 are not.

Petya has an array consisting of n numbers. He wants to perform m operations of two types:

add l r d — add an integer d to all elements whose indexes belong to the interval from l to r, inclusive (1 ≤ l ≤ r ≤ n, 1 ≤ d ≤ 10^4);

count l r — find and print on the screen how many lucky numbers there are among elements with indexes that belong to the interval from l to r inclusive (1 ≤ l ≤ r ≤ n).

Each lucky number should be counted as many times as it appears in the interval. Petya has a list of all operations. The operations are such that after all additions the array won't have numbers that would exceed 10^4. Help Petya write a program that would perform these operations.

 
 
 
 
  • Vote: I like it
  • +11
  • Vote: I do not like it

»
20 months ago, # |
  Vote: I like it -24 Vote: I do not like it

It's beyond your scope. Don't be over smart by solving such difficult problems. Solve problem of your level.

  • »
    »
    20 months ago, # ^ |
      Vote: I like it +6 Vote: I do not like it

    At least I'm using real account, not a fake account like you to comment.

»
20 months ago, # |
  Vote: I like it +11 Vote: I do not like it

I agree that the editorial is poorly written, I will try to solve it today and describe my solution here, potentially better.

»
20 months ago, # |
  Vote: I like it 0 Vote: I do not like it

Auto comment: topic has been updated by rajkumar62506 (previous revision, new revision, compare).