Số phong phú

View as PDF

Submit solution


Points: 0.06 (partial)
Time limit: 0.38s
Memory limit: 256M
Input: stdin
Output: stdout

Problem source:
PTNK 10 Final Exam - Semester I, 2008
Problem type
Allowed languages
C, C++, Go, Java, Kotlin, Pascal, PyPy, Python, Rust, Scratch

Trong số học, số phong phú là các số mà tổng các ước số của số đó (không kể chính nó) lớn hơn số đó. Ví dụ, số ~12~ có tổng các ước số (không kể ~12)~ là ~1 + 2 + 3 + 4 + 6 = 16 > 12~. Do đó ~12~ là một số phong phú.

Bạn hãy lập trình đếm xem có bao nhiêu số phong phú trong đoạn ~[L~, ~R]~.

Input

  • Gồm ~2~ số ~L~, ~R~ ~(1 \le L \le R \le 10^{5})~

Output

  • Gồm ~1~ số nguyên duy nhất là số số phong phú trong đoạn ~[L~, ~R]~.

Giới hạn

  • Có ~50\%~ số test có ~1 \le L \le R \le 10^{3}~

Sample Input

1 50

Sample Output

9

Note

  • Từ ~1~ đến ~50~ có ~9~ số phong phú là: ~12~, ~18~, ~20~, ~24~, ~30~, ~36~, ~40~, ~42~, ~48~

Comments

Please read the guidelines before commenting.



  • -12
    zatarainbow  commented on July 27, 2024, 3:13 p.m.

    This comment is hidden due to too much negative feedback. Show it anyway.


  • -5
    khnguyen21th06  commented on May 16, 2024, 9:39 a.m.

    This comment is hidden due to too much negative feedback. Show it anyway.


  • -27
    trunn  commented on Oct. 16, 2023, 2:23 a.m.

    This comment is hidden due to too much negative feedback. Show it anyway.


  • 3
    tuattsx3  commented on Sept. 24, 2023, 2:01 p.m.

    mọi người dùng sàng ước nhá:D def sub(n): result = [1] * (n + 1)
    for i in range(2, n//2 + 1): for j in range(i * 2, n + 1, i):result[j] += i return result


  • -16
    nova  commented on Sept. 21, 2023, 8:44 a.m.

    This comment is hidden due to too much negative feedback. Show it anyway.


    • -11
      nova  commented on Sept. 21, 2023, 9:30 a.m.

      This comment is hidden due to too much negative feedback. Show it anyway.


      • -11
        duybinh_cbl  commented on Sept. 21, 2023, 1:13 p.m.

        This comment is hidden due to too much negative feedback. Show it anyway.


        • -1
          huyleee  commented on Oct. 21, 2023, 8:20 a.m.

          em hỏi :))


  • -11
    nogo007akapkn  commented on Aug. 31, 2023, 3:13 p.m. edit 3

    This comment is hidden due to too much negative feedback. Show it anyway.


  • -34
    dhduong04  commented on Jan. 25, 2022, 8:24 a.m. edited

    This comment is hidden due to too much negative feedback. Show it anyway.