結果

問題 No.987 N×Mマス計算(基本)
ユーザー ichibanshibori
提出日時 2020-06-19 23:34:08
言語 F#
(F# 4.0)
結果
AC  
実行時間 87 ms / 2,000 ms
コード長 654 bytes
コンパイル時間 7,901 ms
コンパイル使用メモリ 194,844 KB
実行使用メモリ 34,396 KB
最終ジャッジ日時 2024-07-03 15:55:27
合計ジャッジ時間 10,704 ms
ジャッジサーバーID
(参考情報)
judge5 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 2
other AC * 18
権限があれば一括ダウンロードができます
コンパイルメッセージ
  復元対象のプロジェクトを決定しています...
  /home/judge/data/code/main.fsproj を復元しました (264 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 () =
    let n, m = stdin.ReadLine().Split() |> fun arr -> (int arr.[0], int arr.[1])
    let opBarr = stdin.ReadLine().Split()
    let op = match opBarr.[0] with
             | "+" -> ( + )
             | "*" -> ( * )
             | _ -> failwith "illegal op"
    let bArr = opBarr.[1..] |> Array.map int64
    let aArr =
        seq {
            for i in 1..n -> stdin.ReadLine() |> int64
        }
        |> Seq.toArray
    seq {
        for i in 1..n ->
                seq {
                    for j in 1..m -> op aArr.[i - 1] bArr.[j - 1] |> string
                }
                |> String.concat " "

    }
    |> Seq.iter (printfn "%s")
0