結果
| 問題 | No.1505 Zero-Product Ranges |
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2023-05-07 16:22:05 |
| 言語 | PyPy3 (7.3.17) |
| 結果 |
AC
|
| 実行時間 | 62 ms / 2,000 ms |
| コード長 | 227 bytes |
| 記録 | |
| コンパイル時間 | 175 ms |
| コンパイル使用メモリ | 85,248 KB |
| 実行使用メモリ | 101,248 KB |
| 最終ジャッジ日時 | 2026-05-18 17:14:38 |
| 合計ジャッジ時間 | 5,397 ms |
|
ジャッジサーバーID (参考情報) |
judge1_1 / judge2_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)