結果
| 問題 | No.442 和と積 |
| コンテスト | |
| ユーザー |
ebicochineal
|
| 提出日時 | 2016-11-11 22:33:30 |
| 言語 | Python3 (3.14.3 + numpy 2.4.4 + scipy 1.17.1) |
| 結果 |
TLE
|
| 実行時間 | - |
| コード長 | 420 bytes |
| 記録 | |
| コンパイル時間 | 840 ms |
| コンパイル使用メモリ | 20,700 KB |
| 実行使用メモリ | 28,416 KB |
| 最終ジャッジ日時 | 2026-05-19 21:19:02 |
| 合計ジャッジ時間 | 8,097 ms |
|
ジャッジサーバーID (参考情報) |
judge1_0 / judge2_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | -- * 3 |
| other | TLE * 1 -- * 17 |
ソースコード
#! /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)
ebicochineal