| Run ID | 作者 | 问题 | 语言 | 测评结果 | Time | Memory | 代码长度 | 提交时间 |
|---|---|---|---|---|---|---|---|---|
| 85272 | 彭士宝 | 生理周期 | Python3 | Compile Error | 0 MS | 0 KB | 731 | 2024-07-16 20:47:21 |
def gcd(a, b): while b: a, b = b, a % b return a def lcm(a, b): return a * b // gcd(a, b) def next_triple_peak(p, e, i, d): # 计算23, 28, 33的最小公倍数 lcm_1 = lcm(23, 28) lcm_2 = lcm(lcm_1, 33) # 计算从d起,p, e, i距离d的天数 dp = (p - d) % lcm_2 de = (e - d) % lcm_2 di = (i - d) % lcm_2 # 找到最小的余数 min_rem = min(dp, de, di) # 计算下一次三个高峰同一天的日子 next_peak = d + (lcm_2 - min_rem) return next_peak - d # 输入 p, e, i, d = map(int, input().split()) # 输出 days = next_triple_peak(p, e, i, d) print(f"the next triple peak occurs in {days} days.")
File "Main.py", line 32
print(f"the next triple peak occurs in {days} days.")
^
SyntaxError: invalid syntax