結果

問題 No.2275 →↑↓
ユーザー natoriusannatoriusan
提出日時 2023-07-31 17:25:30
言語 F#
(F# 4.0)
結果
WA  
実行時間 -
コード長 573 bytes
コンパイル時間 10,720 ms
コンパイル使用メモリ 191,992 KB
実行使用メモリ 63,104 KB
最終ジャッジ日時 2024-04-18 17:27:36
合計ジャッジ時間 12,297 ms
ジャッジサーバーID
(参考情報)
judge2 / judge4
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 301 ms
34,948 KB
testcase_01 AC 292 ms
35,088 KB
testcase_02 AC 292 ms
34,364 KB
testcase_03 AC 294 ms
35,332 KB
testcase_04 WA -
testcase_05 AC 294 ms
34,368 KB
testcase_06 AC 341 ms
60,536 KB
testcase_07 AC 326 ms
55,424 KB
testcase_08 AC 343 ms
62,592 KB
testcase_09 AC 342 ms
62,700 KB
testcase_10 AC 345 ms
62,848 KB
testcase_11 AC 342 ms
63,104 KB
testcase_12 AC 342 ms
62,704 KB
testcase_13 AC 342 ms
62,336 KB
testcase_14 AC 358 ms
62,628 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
  復元対象のプロジェクトを決定しています...
  /home/judge/data/code/main.fsproj を復元しました (357 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


if a.Length > 2 then
    [|
        for i in 0..a.Length-2 ->
            min a.[i] a.[i+1] |> int64
    |] |> Array.reduce (fun prev x -> prev * x % 998244353L)
else
    Array.min a |> int64
|> 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