結果
問題 |
No.816 Beautiful tuples
|
ユーザー |
![]() |
提出日時 | 2019-04-20 01:10:27 |
言語 | Python3 (3.13.1 + numpy 2.2.1 + scipy 1.14.1) |
結果 |
WA
|
実行時間 | - |
コード長 | 368 bytes |
コンパイル時間 | 320 ms |
コンパイル使用メモリ | 12,544 KB |
実行使用メモリ | 10,880 KB |
最終ジャッジ日時 | 2024-09-24 17:56:20 |
合計ジャッジ時間 | 1,097 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 11 WA * 4 |
ソースコード
A,B = map(int, input().split()) C = -1 for i in range(1, int((A+B)**(1/2)) + 1): if (A+B) % i == 0: if A != i and B != i: if (A+i)%B == 0 and (B+i)%A==0: C = i break if C == -1: i = A+B if A != i and B != i: if (A+i)%B == 0 and (B+i)%A==0: C = i print(C)