結果

問題 No.722 100×100=1000
ユーザー finefine
提出日時 2018-08-03 22:32:10
言語 Ruby
(3.3.0)
結果
TLE  
実行時間 -
コード長 367 bytes
コンパイル時間 53 ms
コンパイル使用メモリ 7,680 KB
実行使用メモリ 19,104 KB
最終ジャッジ日時 2024-04-20 14:57:10
合計ジャッジ時間 5,105 ms
ジャッジサーバーID
(参考情報)
judge5 / judge2
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 93 ms
17,536 KB
testcase_01 AC 95 ms
12,160 KB
testcase_02 AC 92 ms
12,160 KB
testcase_03 AC 90 ms
12,160 KB
testcase_04 AC 91 ms
12,160 KB
testcase_05 AC 92 ms
12,160 KB
testcase_06 AC 93 ms
12,160 KB
testcase_07 AC 90 ms
12,160 KB
testcase_08 AC 92 ms
12,288 KB
testcase_09 AC 90 ms
12,160 KB
testcase_10 AC 92 ms
12,288 KB
testcase_11 AC 92 ms
12,160 KB
testcase_12 AC 90 ms
12,032 KB
testcase_13 TLE -
testcase_14 -- -
testcase_15 -- -
testcase_16 -- -
testcase_17 -- -
testcase_18 -- -
testcase_19 -- -
testcase_20 -- -
testcase_21 -- -
testcase_22 -- -
testcase_23 -- -
testcase_24 -- -
testcase_25 -- -
testcase_26 -- -
testcase_27 -- -
testcase_28 -- -
testcase_29 -- -
testcase_30 -- -
権限があれば一括ダウンロードができます
コンパイルメッセージ
Syntax OK

ソースコード

diff #

def judge(x)
    cnt = 0
    while x % 10 == 0
        x /= 10
        cnt += 1
    end
    if x / 10 > 0
        return false
    end
    if x == 0
        return false
    end
    return cnt >= 2
end

a, b = gets.split.map(&:to_i)
if judge(a.abs) && judge(b.abs)
    p a * b / 10
else
    ans = a * b
    puts (ans <= -100000000 || ans >= 100000000) ? "E" : ans
end
0