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