結果

問題 No.722 100×100=1000
ユーザー lam6er
提出日時 2025-03-20 18:57:26
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 56 ms / 2,000 ms
コード長 769 bytes
コンパイル時間 180 ms
コンパイル使用メモリ 82,384 KB
実行使用メモリ 53,832 KB
最終ジャッジ日時 2025-03-20 18:58:28
合計ジャッジ時間 2,501 ms
ジャッジサーバーID
(参考情報)
judge1 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 4
other AC * 27
権限があれば一括ダウンロードができます

ソースコード

diff #

A, B = map(int, input().split())

def decompose(x):
    if x == 0:
        return None
    temp = abs(x)
    t = 0
    while temp % 10 == 0:
        t += 1
        temp //= 10
    if t < 2:
        return None
    divisor = 10 ** t
    if x % divisor != 0:
        return None
    a = x // divisor
    if 1 <= abs(a) <= 9:
        return (a, t)
    else:
        return None

a_decomp = decompose(A)
b_decomp = decompose(B)

if a_decomp is not None and b_decomp is not None:
    a, n = a_decomp
    b, m = b_decomp
    product_part = a * b
    power = 10 ** (n + m - 1)
    final_product = product_part * power
    print(final_product)
else:
    real_product = A * B
    if -99999999 <= real_product <= 99999999:
        print(real_product)
    else:
        print("E")
0