結果
| 問題 |
No.722 100×100=1000
|
| コンテスト | |
| ユーザー |
lam6er
|
| 提出日時 | 2025-03-20 21:19:09 |
| 言語 | PyPy3 (7.3.15) |
| 結果 |
AC
|
| 実行時間 | 39 ms / 2,000 ms |
| コード長 | 769 bytes |
| コンパイル時間 | 188 ms |
| コンパイル使用メモリ | 82,756 KB |
| 実行使用メモリ | 53,524 KB |
| 最終ジャッジ日時 | 2025-03-20 21:20:23 |
| 合計ジャッジ時間 | 2,485 ms |
|
ジャッジサーバーID (参考情報) |
judge2 / judge1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 4 |
| other | AC * 27 |
ソースコード
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")
lam6er