結果
問題 |
No.442 和と積
|
ユーザー |
![]() |
提出日時 | 2016-11-11 22:33:30 |
言語 | Python3 (3.13.1 + numpy 2.2.1 + scipy 1.14.1) |
結果 |
TLE
|
実行時間 | - |
コード長 | 420 bytes |
コンパイル時間 | 134 ms |
コンパイル使用メモリ | 12,416 KB |
実行使用メモリ | 24,264 KB |
最終ジャッジ日時 | 2024-11-25 08:30:26 |
合計ジャッジ時間 | 7,657 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 15 WA * 1 TLE * 2 |
ソースコード
#! /usr/bin/env python3 def f(n): l = [] a, b = 0, 2 while b * b <= n: if n % b == 0: n //= b l += [b] else: b += 1 + a a = 1 if n > 1 : l += [n] return [1] + l A, B = map(int, input().split()) s = f(A + B) p = f(A * B) l = [] ans = 1 for i in s: if i in p : l += [i] for i in l: ans *= i print(0 if A == 0 or B == 0 else ans)