結果
| 問題 | No.1505 Zero-Product Ranges |
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2023-05-07 16:22:05 |
| 言語 | PyPy3 (8.0.0 + ACL) |
| 結果 |
AC
不安定
|
| 実行時間 | 54 ms / 2,000 ms |
| + 96µs | |
| コード長 | 227 bytes |
| 記録 | |
| コンパイル時間 | 489 ms |
| コンパイル使用メモリ | 82,208 KB |
| 実行使用メモリ | 104,652 KB |
| 最終ジャッジ日時 | 2026-09-29 08:24:16 |
| 合計ジャッジ時間 | 5,727 ms |
|
ジャッジサーバーID (参考情報) |
judge3_0 / judge4_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 49 |
ソースコード
N = int(input())
A = list(map(int, input().split()))
l, r = 0, 0
cnt = 0
while l<N:
while r<N and A[r]!=0:
r+=1
if r<N:
cnt += N-r
if l==r:
l+=1
r+=1
else:
l+=1
print(cnt)