QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#745941#8250. Magnesium Supplementationt-aswathWA 6ms10868kbPython3604b2024-11-14 12:33:352024-11-14 12:33:36

Judging History

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

  • [2024-11-14 12:33:36]
  • 评测
  • 测评结果:WA
  • 用时:6ms
  • 内存:10868kb
  • [2024-11-14 12:33:35]
  • 提交

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))
    print(ans)


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: 0
Wrong Answer
time: 6ms
memory: 10868kb

input:

6 6 4

output:

3
[2, 3, 6]

result:

wrong answer 2nd lines differ - expected: '2', found: '[2, 3, 6]'