結果
問題 |
No.816 Beautiful tuples
|
ユーザー |
|
提出日時 | 2019-08-18 17:30:37 |
言語 | Python3 (3.13.1 + numpy 2.2.1 + scipy 1.14.1) |
結果 |
AC
|
実行時間 | 31 ms / 1,500 ms |
コード長 | 353 bytes |
コンパイル時間 | 261 ms |
コンパイル使用メモリ | 12,416 KB |
実行使用メモリ | 10,880 KB |
最終ジャッジ日時 | 2024-10-01 14:08:28 |
合計ジャッジ時間 | 1,354 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 15 |
ソースコード
def d(n): divisors = [] for i in range(1, int(n**0.5)+1): if n % i == 0: divisors.append(i) if i != n // i: divisors.append(n//i) divisors.sort() return divisors a, b = map(int, input().split()) div = d(a+b) for c in div: if a != c and b != c and (a+c) % b == 0 and (b+c) % a == 0: print(c) exit() print(-1)