結果
| 問題 | No.1505 Zero-Product Ranges |
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2022-01-02 17:53:17 |
| 言語 | PyPy3 (7.3.23 + ACL) |
| 結果 |
TLE
不安定
|
| 実行時間 | - |
| コード長 | 254 bytes |
| 記録 | |
| コンパイル時間 | 73 ms |
| コンパイル使用メモリ | 80,640 KB |
| 実行使用メモリ | 303,744 KB |
| 最終ジャッジ日時 | 2026-09-14 06:29:46 |
| 合計ジャッジ時間 | 7,577 ms |
|
ジャッジサーバーID (参考情報) |
judge3_0 / judge2_1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 1 TLE * 1 -- * 47 |
ソースコード
N = int(input())
A = input().replace(' ', '')
all = N * (N + 1) // 2
i = 0
onecnt = 0
for i in range(N + 1, 0, -1):
o = A.count('1' * i)
if o > 0:
onecnt += (i * (i + 1) // 2) * o
A = A.replace('1' * i, '')
print(all - onecnt)