QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#745948#8250. Magnesium Supplementationt-aswathWA 15ms10904kbPython3635b2024-11-14 12:35:142024-11-14 12:35:22

Judging History

你现在查看的是最新测评结果

  • [2024-11-14 12:35:22]
  • 评测
  • 测评结果:WA
  • 用时:15ms
  • 内存:10904kb
  • [2024-11-14 12:35:14]
  • 提交

answer

import math


def solve():
    n, k, p = map(int, input().strip().split())
    l, r = 1, k
    while l < r:
        m = (l + r) // 2
        if (m * p) > n:
            r = m
        else:
            l = m + 1
    divisors = set()
    for i in range(1, int(math.sqrt(n)) + 2):
        if n % i == 0:
            divisors.add(i)
            divisors.add(n // i)
    ans = []
    for i in divisors:
        if i >= l and i <= min(n, k):
            ans.append(i)
    print(len(ans))
    for i in ans:
        print(i, end="\n")


if __name__ == "__main__":
    t = 1
    for i in range(t):
        solve()

Details

Tip: Click on the bar to expand more detailed information

Test #1:

score: 100
Accepted
time: 12ms
memory: 10840kb

input:

6 6 4

output:

3
2
3
6

result:

ok 4 lines

Test #2:

score: 0
Accepted
time: 15ms
memory: 10768kb

input:

6 2 3

output:

1
2

result:

ok 2 lines

Test #3:

score: -100
Wrong Answer
time: 13ms
memory: 10904kb

input:

735134400 425176838 584949686

output:

1342
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
20
21
22
24
25
26
27
28
30
33415200
32
33
34
35
36
237600
39
40
42
44
45
48
50
51
52
54
55
56
60
63
66830400
64
65
66
68
475200
70
24640
72
75
77
78
80
188496
84
85
88
90
91
96
99
100
65637
102
104
105
108
110
112
117
119
120
8316
126
130
132
135
136
1...

result:

wrong answer 28th lines differ - expected: '32', found: '33415200'