結果
| 問題 |
No.442 和と積
|
| コンテスト | |
| ユーザー |
syunsuke
|
| 提出日時 | 2018-10-07 10:48:28 |
| 言語 | Python3 (3.13.1 + numpy 2.2.1 + scipy 1.14.1) |
| 結果 |
TLE
|
| 実行時間 | - |
| コード長 | 385 bytes |
| コンパイル時間 | 104 ms |
| コンパイル使用メモリ | 12,544 KB |
| 実行使用メモリ | 24,400 KB |
| 最終ジャッジ日時 | 2024-10-12 14:09:18 |
| 合計ジャッジ時間 | 4,730 ms |
|
ジャッジサーバーID (参考情報) |
judge2 / judge3 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | -- * 3 |
| other | TLE * 1 -- * 17 |
ソースコード
A,B=map(int,input().split())
T=A+B
K=A*B
for i in range(10):
if K>T:
if K%T==0:
print(T)
exit()
else:
K=K%T
else:
if T%K==0:
print(K)
exit()
else:
T=T%K
for i in range(min(T,K)):
if T%(min(T,K)-i)==0 and K%(min(T,K)-i)==0:
print(min(T,K)-i)
break
syunsuke