結果

問題 No.988 N×Mマス計算(総和)
ユーザー natoriusannatoriusan
提出日時 2023-08-01 17:28:13
言語 F#
(F# 4.0)
結果
WA  
実行時間 -
コード長 453 bytes
コンパイル時間 8,104 ms
コンパイル使用メモリ 197,620 KB
実行使用メモリ 61,884 KB
最終ジャッジ日時 2024-04-19 16:40:46
合計ジャッジ時間 15,910 ms
ジャッジサーバーID
(参考情報)
judge1 / judge5
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 302 ms
35,244 KB
testcase_01 AC 305 ms
35,412 KB
testcase_02 AC 306 ms
35,432 KB
testcase_03 AC 315 ms
35,156 KB
testcase_04 AC 307 ms
35,540 KB
testcase_05 AC 304 ms
35,308 KB
testcase_06 AC 308 ms
35,432 KB
testcase_07 AC 306 ms
35,428 KB
testcase_08 AC 305 ms
35,412 KB
testcase_09 AC 321 ms
35,164 KB
testcase_10 AC 324 ms
41,304 KB
testcase_11 AC 338 ms
48,512 KB
testcase_12 AC 347 ms
52,608 KB
testcase_13 AC 331 ms
45,568 KB
testcase_14 AC 332 ms
45,696 KB
testcase_15 AC 331 ms
39,632 KB
testcase_16 AC 338 ms
49,408 KB
testcase_17 AC 354 ms
52,472 KB
testcase_18 AC 322 ms
48,000 KB
testcase_19 AC 338 ms
51,584 KB
testcase_20 WA -
権限があれば一括ダウンロードができます
コンパイルメッセージ
  復元対象のプロジェクトを決定しています...
  /home/judge/data/code/main.fsproj を復元しました (220 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
    ((a |> Array.sum |> ((*)m)) + (b |> Array.sum |> ((*)n))) % k
else
    let f = Array.reduce (fun x y -> (x + y) % (int64 k))
    ((a |> f) * (b |> f)) % (int64 k)
|> printfn "%d"
0