結果

問題 No.2275 →↑↓
ユーザー natoriusannatoriusan
提出日時 2023-07-31 17:22:23
言語 F#
(F# 4.0)
結果
WA  
実行時間 -
コード長 506 bytes
コンパイル時間 9,095 ms
コンパイル使用メモリ 184,980 KB
実行使用メモリ 62,644 KB
最終ジャッジ日時 2024-04-18 17:24:06
合計ジャッジ時間 15,882 ms
ジャッジサーバーID
(参考情報)
judge4 / judge5
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 323 ms
35,020 KB
testcase_01 AC 311 ms
35,284 KB
testcase_02 AC 301 ms
35,148 KB
testcase_03 AC 303 ms
35,156 KB
testcase_04 WA -
testcase_05 AC 302 ms
35,156 KB
testcase_06 AC 354 ms
59,752 KB
testcase_07 AC 335 ms
55,268 KB
testcase_08 AC 354 ms
62,272 KB
testcase_09 AC 363 ms
62,176 KB
testcase_10 AC 352 ms
62,644 KB
testcase_11 AC 342 ms
62,508 KB
testcase_12 AC 341 ms
62,308 KB
testcase_13 AC 341 ms
62,292 KB
testcase_14 AC 344 ms
62,404 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
  復元対象のプロジェクトを決定しています...
  /home/judge/data/code/main.fsproj を復元しました (593 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 n = stdin.ReadLine () |> int
let a = stdin.ReadLine().Split " " |> Array.map int


[|
    for i in 0..a.Length-2 ->
        min a.[i] a.[i+1] |> int64
|] |> Array.reduce (fun prev x -> prev * x % 998244353L) |> printfn "%d"

// let mutable arr = Array.replicate n [||]
// arr.[0] <- Array.replicate a.[0] 1L
// for i in 1..n-1 do
//     arr.[i] <- Array.replicate a.[i] ((Array.sum arr.[i-1].[0..a.[i]-1]) % 998244353L)
//     // printfn "%A" arr
//     
// Array.last arr |> Array.head |> printfn "%d"
0