結果
問題 |
No.816 Beautiful tuples
|
ユーザー |
|
提出日時 | 2024-05-12 18:40:54 |
言語 | PyPy3 (7.3.15) |
結果 |
WA
|
実行時間 | - |
コード長 | 368 bytes |
コンパイル時間 | 299 ms |
コンパイル使用メモリ | 82,376 KB |
実行使用メモリ | 58,892 KB |
最終ジャッジ日時 | 2024-12-20 09:12:18 |
合計ジャッジ時間 | 1,635 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 11 WA * 4 |
ソースコード
def divisors(N): res = [] for i in range(1, int(N ** 0.5) + 1): if N % i == 0: res.append(i) if i * i != N: res.append(N // i) res.sort() return res A, B = map(int, input().split()) D = divisors(A + B) for C in D: if (A + C) % B == 0 and (B + C) % A == 0: print(C) exit() print(-1)