結果

問題 No.722 100×100=1000
ユーザー tak
提出日時 2018-08-11 00:55:15
言語 F#
(F# 4.0)
結果
AC  
実行時間 67 ms / 2,000 ms
コード長 707 bytes
コンパイル時間 11,927 ms
コンパイル使用メモリ 187,880 KB
実行使用メモリ 30,336 KB
最終ジャッジ日時 2024-12-29 19:30:03
合計ジャッジ時間 15,022 ms
ジャッジサーバーID
(参考情報)
judge4 / judge5
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 4
other AC * 27
権限があれば一括ダウンロードができます
コンパイルメッセージ
  復元対象のプロジェクトを決定しています...
  /home/judge/data/code/main.fsproj を復元しました (368 ms)。
MSBuild のバージョン 17.9.6+a4ecab324 (.NET)
  main -> /home/judge/data/code/bin/Release/net8.0/main.dll
  main -> /home/judge/data/code/bin/Release/net8.0/publish/

ソースコード

diff #

let f (a:int64) (b:int64) =
    let mul = a * b
    let isAnzan =
        let trim = fun (x:string) -> x.TrimEnd '0'
        let getNonZero = abs >> string >> trim
        let isOver = abs >> fun x -> x >= 100L
        let a' = a |> getNonZero
        let b' = b |> getNonZero
        let dig = [1 .. 9] |> List.map string
        let isIn x = dig |> List.contains x
        isIn a' && isIn b' && isOver a && isOver b
    let isCalable = -99999999L <= mul && mul <= 99999999L
    
    if isAnzan then
        mul / 10L |> string
    elif isCalable then
        mul |> string
    else
        "E"

let A,B = 
    let t = stdin.ReadLine().Split() |> Array.map int64
    t.[0], t.[1]

f A B |> stdout.WriteLine
0