結果

問題 No.988 N×Mマス計算(総和)
ユーザー ikdikd
提出日時 2020-06-06 22:09:06
言語 F#
(F# 4.0)
結果
AC  
実行時間 206 ms / 2,000 ms
コード長 579 bytes
コンパイル時間 4,681 ms
コンパイル使用メモリ 166,788 KB
実行使用メモリ 44,288 KB
最終ジャッジ日時 2023-09-20 12:26:36
合計ジャッジ時間 8,413 ms
ジャッジサーバーID
(参考情報)
judge12 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 88 ms
22,968 KB
testcase_01 AC 89 ms
25,068 KB
testcase_02 AC 87 ms
23,032 KB
testcase_03 AC 88 ms
23,204 KB
testcase_04 AC 88 ms
22,976 KB
testcase_05 AC 88 ms
23,044 KB
testcase_06 AC 89 ms
22,932 KB
testcase_07 AC 89 ms
25,168 KB
testcase_08 AC 88 ms
22,944 KB
testcase_09 AC 88 ms
23,072 KB
testcase_10 AC 125 ms
27,804 KB
testcase_11 AC 139 ms
33,672 KB
testcase_12 AC 180 ms
41,188 KB
testcase_13 AC 130 ms
29,260 KB
testcase_14 AC 128 ms
27,064 KB
testcase_15 AC 127 ms
26,500 KB
testcase_16 AC 163 ms
37,388 KB
testcase_17 AC 181 ms
42,232 KB
testcase_18 AC 136 ms
33,052 KB
testcase_19 AC 173 ms
36,180 KB
testcase_20 AC 206 ms
44,288 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
Microsoft (R) F# Compiler version 11.0.0.0 for F# 5.0
Copyright (c) Microsoft Corporation. All Rights Reserved.

/home/judge/data/code/Main.fs(9,9): warning FS0025: Incomplete pattern matches on this expression. For example, the value '[|_; _; _; _|]' may indicate a case not covered by the pattern(s).

ソースコード

diff #

open System

let mutable mo = 1000000007L
let inline (+%) x y = (x + y) % mo
let inline ( *% ) x y = x * y % mo

[<EntryPoint>]
let main _ =
    let [| n; m; k |] = stdin.ReadLine().Split(' ') |> Array.map int64
    let line = stdin.ReadLine().Split(' ')
    let op = Array.head line |> Seq.head
    let b = Array.tail line |> Array.map int64

    let a =
        [| for _ in 1L .. n -> stdin.ReadLine() |> int64 |]

    mo <- k
    let sa = a |> Array.fold (+%) 0L
    let sb = b |> Array.fold (+%) 0L
    printfn "%d" <| if op = '+' then m *% sa +% n *% sb else sa *% sb
    0
0