/ SeriousOJ /

Record Detail

Accepted


  
# Status Time Cost Memory Cost
#1 Accepted 15ms 2.949 MiB
#2 Accepted 15ms 3.129 MiB
#3 Accepted 15ms 3.02 MiB
#4 Accepted 15ms 2.879 MiB
#5 Accepted 16ms 3.039 MiB
#6 Accepted 16ms 3.133 MiB
#7 Accepted 16ms 3.102 MiB
#8 Accepted 16ms 2.992 MiB
#9 Accepted 15ms 3.027 MiB
#10 Accepted 15ms 3.109 MiB
#11 Accepted 15ms 3.117 MiB
#12 Accepted 15ms 3.047 MiB
#13 Accepted 15ms 3.023 MiB
#14 Accepted 15ms 3.109 MiB
#15 Accepted 15ms 3.113 MiB

Code

def count_ways_to_distribute_candies(N):
    ways = 0
    
    for i in range(1, int(N**0.5) + 1):
        if N % i == 0:
            ways += 2 if i != N // i else 1
    
    return ways

def main():
    N = int(input())
    result = count_ways_to_distribute_candies(N)
    print(result)

if __name__ == "__main__":
    main()

Information

Submit By
Type
Submission
Problem
P1037 Generous CR
Contest
Brain booster #2
Language
Python 3 (Python 3.12.3)
Submit At
2024-03-06 14:05:39
Judged At
2024-11-11 03:42:06
Judged By
Score
100
Total Time
16ms
Peak Memory
3.133 MiB