結果
| 問題 |
No.816 Beautiful tuples
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2022-05-01 22:02:04 |
| 言語 | Python3 (3.13.1 + numpy 2.2.1 + scipy 1.14.1) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 279 bytes |
| コンパイル時間 | 85 ms |
| コンパイル使用メモリ | 12,672 KB |
| 実行使用メモリ | 10,880 KB |
| 最終ジャッジ日時 | 2024-06-30 23:30:24 |
| 合計ジャッジ時間 | 1,183 ms |
|
ジャッジサーバーID (参考情報) |
judge1 / judge3 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 11 WA * 4 |
ソースコード
a, b = map(int, input().split())
s = a + b
f = 1
ans = 10**18 + 1
while f * f <= s:
if s % f == 0:
for c in (f, s // f):
if (b + c) % a == 0 and (c + a) % b == 0:
ans = min(ans, c)
f += 1
if ans == 10**18 + 1:
ans = -1
print(ans)