結果
問題 | No.1505 Zero-Product Ranges |
ユーザー |
|
提出日時 | 2021-05-15 01:41:11 |
言語 | PyPy3 (7.3.15) |
結果 |
AC
|
実行時間 | 79 ms / 2,000 ms |
コード長 | 245 bytes |
コンパイル時間 | 167 ms |
コンパイル使用メモリ | 82,144 KB |
実行使用メモリ | 97,792 KB |
最終ジャッジ日時 | 2024-10-02 08:21:34 |
合計ジャッジ時間 | 4,691 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
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)