結果
| 問題 | No.1505 Zero-Product Ranges |
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2021-05-15 01:41:11 |
| 言語 | PyPy3 (7.3.23 + ACL) |
| 結果 |
AC
不安定
|
| 実行時間 | 52 ms / 2,000 ms |
| + 184µs | |
| コード長 | 245 bytes |
| 記録 | |
| コンパイル時間 | 1,994 ms |
| コンパイル使用メモリ | 81,636 KB |
| 実行使用メモリ | 99,968 KB |
| 最終ジャッジ日時 | 2026-09-08 18:29:54 |
| 合計ジャッジ時間 | 5,833 ms |
|
ジャッジサーバーID (参考情報) |
judge1_0 / judge2_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 49 |
ソースコード
N = int(input())
A = list(map(int,input().split()))
ans = N*(N+1)//2
now = -1
flg = False
for i in range(N):
if A[i] == 1:
if flg == False:
now = i
flg = True
ans -= (i-now+1)
else:
flg = False
now = i
print(ans)