結果

問題 No.722 100×100=1000
ユーザー ichibanshiboriichibanshibori
提出日時 2018-09-08 18:57:27
言語 F#
(.NET 7)
結果
AC  
実行時間 91 ms / 2,000 ms
コード長 709 bytes
コンパイル時間 3,299 ms
コンパイル使用メモリ 167,784 KB
実行使用メモリ 25,116 KB
最終ジャッジ日時 2023-08-28 15:54:21
合計ジャッジ時間 7,126 ms
ジャッジサーバーID
(参考情報)
judge13 / judge12
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 88 ms
22,892 KB
testcase_01 AC 91 ms
25,116 KB
testcase_02 AC 80 ms
24,788 KB
testcase_03 AC 90 ms
22,976 KB
testcase_04 AC 88 ms
22,984 KB
testcase_05 AC 88 ms
22,964 KB
testcase_06 AC 88 ms
24,980 KB
testcase_07 AC 79 ms
22,812 KB
testcase_08 AC 88 ms
22,936 KB
testcase_09 AC 88 ms
24,988 KB
testcase_10 AC 88 ms
22,824 KB
testcase_11 AC 89 ms
25,012 KB
testcase_12 AC 88 ms
22,900 KB
testcase_13 AC 90 ms
22,912 KB
testcase_14 AC 81 ms
22,808 KB
testcase_15 AC 88 ms
22,996 KB
testcase_16 AC 87 ms
20,912 KB
testcase_17 AC 79 ms
22,840 KB
testcase_18 AC 88 ms
22,864 KB
testcase_19 AC 89 ms
23,064 KB
testcase_20 AC 90 ms
22,932 KB
testcase_21 AC 88 ms
23,020 KB
testcase_22 AC 79 ms
22,772 KB
testcase_23 AC 87 ms
23,052 KB
testcase_24 AC 88 ms
23,096 KB
testcase_25 AC 91 ms
22,972 KB
testcase_26 AC 89 ms
23,156 KB
testcase_27 AC 80 ms
24,796 KB
testcase_28 AC 89 ms
24,916 KB
testcase_29 AC 88 ms
25,032 KB
testcase_30 AC 88 ms
22,832 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
Microsoft (R) F# Compiler version 11.0.0.0 for F# 5.0
Copyright (c) Microsoft Corporation. All Rights Reserved.

ソースコード

diff #

open System

let isIt x =
    let rec isIt' (x' : int) =
        if Math.Abs(x') < 10 then true
        elif x' % 10 <> 0 then false
        else isIt' (x' / 10)

    if x % 100 <> 0 then false
    else isIt' x

let solve a b =
    if isIt a && isIt b then
        Some(decimal a * decimal b / 10m)
    else
        let ab = decimal a * decimal b
        if Math.Abs(ab) > 99999999m then
            None
        else
            Some(ab)

let () =
    let a, b =
        Console.ReadLine()
        |> fun s -> s.Split()
        |> fun abArr -> int abArr.[0], int abArr.[1]
    
    let result =
        match solve a b with
        | Some(x) -> sprintf "%.0M" x
        | None -> "E"

    printfn "%s" result
0