QOJ.ac
QOJ
ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#745941 | #8250. Magnesium Supplementation | t-aswath | WA | 6ms | 10868kb | Python3 | 604b | 2024-11-14 12:33:35 | 2024-11-14 12:33:36 |
Judging History
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()
详细
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]'