結果
| 問題 | No.816 Beautiful tuples |
| コンテスト | |
| ユーザー |
pasoconhoshii
|
| 提出日時 | 2019-04-20 01:11:34 |
| 言語 | Python3 (3.13.1 + numpy 2.2.1 + scipy 1.14.1) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 418 bytes |
| 記録 | |
| コンパイル時間 | 105 ms |
| コンパイル使用メモリ | 12,544 KB |
| 実行使用メモリ | 10,880 KB |
| 最終ジャッジ日時 | 2024-09-24 17:57:30 |
| 合計ジャッジ時間 | 1,079 ms |
|
ジャッジサーバーID (参考情報) |
judge5 / judge4 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| 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 and (A+i)%B == 0 and B+i >= A and (B+i)%A==0:
C = i
break
if C == -1:
i = A+B
if A != i and B != i:
if A+i >= B and (A+i)%B == 0 and B+i>=A and (B+i)%A==0:
C = i
print(C)
pasoconhoshii