結果
| 問題 | No.1505 Zero-Product Ranges |
| コンテスト | |
| ユーザー |
wolgnik
|
| 提出日時 | 2021-05-14 22:11:20 |
| 言語 | PyPy3 (7.3.17) |
| 結果 |
AC
|
| 実行時間 | 61 ms / 2,000 ms |
| コード長 | 238 bytes |
| 記録 | |
| コンパイル時間 | 296 ms |
| コンパイル使用メモリ | 85,120 KB |
| 実行使用メモリ | 100,608 KB |
| 最終ジャッジ日時 | 2026-04-18 10:33:34 |
| 合計ジャッジ時間 | 4,261 ms |
|
ジャッジサーバーID (参考情報) |
judge3_0 / judge1_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 49 |
ソースコード
import sys input = sys.stdin.readline N = int(input()) a = list(map(int, input().split())) res = N * (N + 1) // 2 r = 0 for l in range(N): if a[l] == 0: continue if r < l: r = l while r < N and a[r]: r += 1 res -= r - l print(res)
wolgnik