結果
| 問題 | No.1505 Zero-Product Ranges |
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2023-08-07 18:54:02 |
| 言語 | F# (F# 10.0) |
| 結果 |
AC
|
| 実行時間 | 98 ms / 2,000 ms |
| コード長 | 350 bytes |
| 記録 | |
| コンパイル時間 | 10,783 ms |
| コンパイル使用メモリ | 215,844 KB |
| 実行使用メモリ | 58,624 KB |
| 最終ジャッジ日時 | 2026-05-08 07:15:37 |
| 合計ジャッジ時間 | 15,808 ms |
|
ジャッジサーバーID (参考情報) |
judge2_0 / judge3_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 49 |
コンパイルメッセージ
復元対象のプロジェクトを決定しています... /home/judge/data/code/main.fsproj を復元しました (214 ミリ秒)。 main -> /home/judge/data/code/bin/Release/net10.0/main.dll main -> /home/judge/data/code/bin/Release/net10.0/publish/
ソースコード
let n = stdin.ReadLine () |> int
let a = stdin.ReadLine().Split " " |> Array.map int
let mutable lastZero = -1
[|
for i in 0..a.Length-1 ->
if a.[i] = 0 then
let count = bigint(i - lastZero) * bigint(a.Length-i)
lastZero <- i
count
else
0 |> bigint
|] |> Array.sum |> printfn "%A"