結果
問題 | No.1505 Zero-Product Ranges |
ユーザー |
|
提出日時 | 2022-06-18 11:47:13 |
言語 | PyPy3 (7.3.15) |
結果 |
AC
|
実行時間 | 94 ms / 2,000 ms |
コード長 | 235 bytes |
コンパイル時間 | 370 ms |
コンパイル使用メモリ | 82,176 KB |
実行使用メモリ | 97,024 KB |
最終ジャッジ日時 | 2024-10-09 23:15:51 |
合計ジャッジ時間 | 6,551 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 49 |
ソースコード
N = int(input())lsA = list(map(int,input().split()))cntall = N*(N+1)//2cnt = 0for i in range(N):if lsA[i] == 1:cnt += 1else:cntall -= cnt*(cnt+1)//2cnt = 0cntall -= cnt*(cnt+1)//2print(cntall)