結果

問題 No.722 100×100=1000
コンテスト
ユーザー 学ぶマン
提出日時 2025-10-29 20:46:54
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 37 ms / 2,000 ms
コード長 525 bytes
コンパイル時間 398 ms
コンパイル使用メモリ 82,736 KB
実行使用メモリ 53,828 KB
最終ジャッジ日時 2025-10-29 20:46:57
合計ジャッジ時間 2,974 ms
ジャッジサーバーID
(参考情報)
judge3 / judge4
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 4
other AC * 27
権限があれば一括ダウンロードができます

ソースコード

diff #

A, B = map(int, input().split())
minus = False
if A*B < 0:
    minus = True

A = abs(A)
B = abs(B)

def check(n):

    if n == 0:
        return False

    l = len(str(n))
    cnt = 0
    while n%10 == 0:
        n //= 10
        cnt += 1
    return cnt >= 2 and cnt == l - 1

# 暗算する場合
if check(A) and check(B):
    ans = A*B
    ans //= 10
    if minus:
        ans *= -1

# 電卓使う
else:
    ans = A*B
    if minus:
        ans *= -1
    if not -99999999 <= ans <= 99999999:
        ans = 'E'

print(ans)

0