結果
問題 |
No.2275 →↑↓
|
ユーザー |
|
提出日時 | 2023-07-31 17:26:31 |
言語 | F# (F# 4.0) |
結果 |
AC
|
実行時間 | 400 ms / 2,000 ms |
コード長 | 588 bytes |
コンパイル時間 | 6,724 ms |
コンパイル使用メモリ | 185,872 KB |
実行使用メモリ | 62,960 KB |
最終ジャッジ日時 | 2024-10-10 10:47:47 |
合計ジャッジ時間 | 13,794 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 2 |
other | AC * 13 |
コンパイルメッセージ
復元対象のプロジェクトを決定しています... /home/judge/data/code/main.fsproj を復元しました (226 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/
ソースコード
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) % 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"