結果

問題 No.988 N×Mマス計算(総和)
ユーザー natoriusannatoriusan
提出日時 2023-08-01 17:32:34
言語 F#
(F# 4.0)
結果
WA  
実行時間 -
コード長 463 bytes
コンパイル時間 6,630 ms
コンパイル使用メモリ 207,192 KB
実行使用メモリ 64,120 KB
最終ジャッジ日時 2024-04-19 16:45:41
合計ジャッジ時間 14,662 ms
ジャッジサーバーID
(参考情報)
judge3 / judge4
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 297 ms
34,328 KB
testcase_01 AC 306 ms
34,844 KB
testcase_02 AC 305 ms
35,496 KB
testcase_03 AC 307 ms
34,720 KB
testcase_04 AC 302 ms
35,328 KB
testcase_05 AC 309 ms
35,624 KB
testcase_06 AC 302 ms
34,848 KB
testcase_07 AC 304 ms
35,612 KB
testcase_08 AC 306 ms
34,928 KB
testcase_09 AC 300 ms
35,204 KB
testcase_10 AC 318 ms
41,404 KB
testcase_11 AC 328 ms
48,896 KB
testcase_12 AC 348 ms
53,120 KB
testcase_13 AC 315 ms
45,816 KB
testcase_14 AC 325 ms
45,544 KB
testcase_15 AC 330 ms
39,828 KB
testcase_16 AC 339 ms
49,772 KB
testcase_17 AC 343 ms
52,736 KB
testcase_18 AC 335 ms
48,116 KB
testcase_19 AC 349 ms
51,968 KB
testcase_20 WA -
権限があれば一括ダウンロードができます
コンパイルメッセージ
  復元対象のプロジェクトを決定しています...
  /home/judge/data/code/main.fsproj を復元しました (199 ms)。
MSBuild のバージョン 17.9.6+a4ecab324 (.NET)
/home/judge/data/code/Main.fs(1,5): warning FS0025: この式のパターン マッチが不完全です たとえば、値 '[|_; _; _; _|]' はパターンに含まれないケースを示す可能性があります。 [/home/judge/data/code/main.fsproj]
  main -> /home/judge/data/code/bin/Release/net8.0/main.dll
  main -> /home/judge/data/code/bin/Release/net8.0/publish/

ソースコード

diff #

let [|n; m; k|] = stdin.ReadLine().Split " " |> Array.map int64

let x = stdin.ReadLine().Split " "

let op = x.[0]
let b = x.[1..] |> Array.map int64
let a =
    [|
        for _ in 0..(n-1L |> int) ->
            stdin.ReadLine () |> int64
    |]
    
if op = "+" then
    let f a = Array.sum >> (fun x -> (x * a) % k)
    ((a |> f m) + (b |> f n)) % k
else
    let f = Array.reduce (fun x y -> (x + y) % k)
    ((a |> f) * (b |> f)) % (int64 k)
|> printfn "%d"
0