Run ID 作者 问题 语言 测评结果 Time Memory 代码长度 提交时间
85155 胡海峰老师 猜数字 Python3 Time Limit Exceeded 3000 MS 3776 KB 528 2024-07-16 16:43:55

Tests(0/1):


Code:

def find_number(a, b, c): # 从最小的可能值开始遍历,即a*b*c for x in range(a * b * c, 10000 * 10000 + 1, a * b): if (x % a == 0) and ((x + 1) % b == 0) and ((x + 2) % c == 0): return x return "Impossible" # 读取输入的测试样例个数c c = int(input()) # 对每个测试样例进行处理 for _ in range(c): # 读取a, b, c的值 a, b, c = map(int, input().split()) # 调用函数并打印结果 result = find_number(a, b, c) print(result)