ddinhminhhair's blog

By ddinhminhhair, history, 4 years ago, In English

Hello, Codeforces!

I have solved the problem 110A — Nearly Lucky Number. Then, I start find more optimal solution by referring to the others' one. What I found is

print('NYOE S'[sum(i in'47'for i in input())in(4,7)::2])

But this short code return the wrong answer NO for the input 47474747474747474747474747474747474747474747474 — there are 47 lucky digits. Unfortunately, it was an accepted solution.

Please help me for check it!!! Thanks everyone.

  • Vote: I like it
  • 0
  • Vote: I do not like it

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

Hm. The problem states:

The only line contains an integer $$$n$$$ ($$$1 \le n \le 10^{18}$$$).

So this input is wrong.