結果
問題 | No.1505 Zero-Product Ranges |
ユーザー |
![]() |
提出日時 | 2021-05-14 22:16:12 |
言語 | Python3 (3.13.1 + numpy 2.2.1 + scipy 1.14.1) |
結果 |
AC
|
実行時間 | 147 ms / 2,000 ms |
コード長 | 230 bytes |
コンパイル時間 | 849 ms |
コンパイル使用メモリ | 12,416 KB |
実行使用メモリ | 14,336 KB |
最終ジャッジ日時 | 2024-10-02 01:40:05 |
合計ジャッジ時間 | 6,396 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 49 |
ソースコード
N, *A = map(int, open(0).read().split())c = 0l = 0for i in range(N):if A[i] == 1:continuet = i - l + 1c += t * (t - 1) // 2l = i + 1t = N - l + 1c += t * (t - 1) // 2print((N + 1) * N // 2 - c)