結果
| 問題 | No.1505 Zero-Product Ranges |
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2023-08-07 18:52:08 |
| 言語 | F# (F# 10.0) |
| 結果 |
RE
|
| 実行時間 | - |
| コード長 | 328 bytes |
| 記録 | |
| コンパイル時間 | 8,603 ms |
| コンパイル使用メモリ | 208,704 KB |
| 実行使用メモリ | 51,584 KB |
| 最終ジャッジ日時 | 2026-05-08 07:12:51 |
| 合計ジャッジ時間 | 32,452 ms |
|
ジャッジサーバーID (参考情報) |
judge2_1 / judge1_1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 18 RE * 31 |
コンパイルメッセージ
復元対象のプロジェクトを決定しています... /home/judge/data/code/main.fsproj を復元しました (260 ミリ秒)。 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 = (i - lastZero) * (a.Length-i)
lastZero <- i
count
else
0
|] |> Array.sum |> printfn "%d"