結果

問題 No.2275 →↑↓
コンテスト
ユーザー natoriusan
提出日時 2023-07-31 17:25:30
言語 F#
(F# 10.0)
コンパイル:
fsharp_c _filename_
実行:
/usr/bin/dotnet_wrap
結果
WA  
実行時間 -
コード長 573 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 9,840 ms
コンパイル使用メモリ 211,012 KB
実行使用メモリ 64,256 KB
最終ジャッジ日時 2026-04-26 12:25:26
合計ジャッジ時間 16,330 ms
ジャッジサーバーID
(参考情報)
judge1_1 / judge3_0
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 2
other AC * 12 WA * 1
権限があれば一括ダウンロードができます
コンパイルメッセージ
  復元対象のプロジェクトを決定しています...
  /home/judge/data/code/main.fsproj を復元しました (198 ミリ秒)。
  main -> /home/judge/data/code/bin/Release/net10.0/main.dll
  main -> /home/judge/data/code/bin/Release/net10.0/publish/

ソースコード

diff #
raw source code

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