結果

問題 No.1505 Zero-Product Ranges
ユーザー otsunekootsuneko
提出日時 2021-05-14 23:40:33
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 79 ms / 2,000 ms
コード長 177 bytes
コンパイル時間 145 ms
コンパイル使用メモリ 82,592 KB
実行使用メモリ 98,928 KB
最終ジャッジ日時 2024-04-10 04:22:46
合計ジャッジ時間 4,636 ms
ジャッジサーバーID
(参考情報)
judge3 / judge2
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 36 ms
52,732 KB
testcase_01 AC 36 ms
51,804 KB
testcase_02 AC 36 ms
52,620 KB
testcase_03 AC 79 ms
96,200 KB
testcase_04 AC 75 ms
96,924 KB
testcase_05 AC 52 ms
74,324 KB
testcase_06 AC 52 ms
73,952 KB
testcase_07 AC 49 ms
71,416 KB
testcase_08 AC 51 ms
72,232 KB
testcase_09 AC 50 ms
72,284 KB
testcase_10 AC 51 ms
74,024 KB
testcase_11 AC 53 ms
75,240 KB
testcase_12 AC 49 ms
71,056 KB
testcase_13 AC 61 ms
82,872 KB
testcase_14 AC 57 ms
79,940 KB
testcase_15 AC 73 ms
97,240 KB
testcase_16 AC 76 ms
97,696 KB
testcase_17 AC 76 ms
98,928 KB
testcase_18 AC 76 ms
97,492 KB
testcase_19 AC 36 ms
52,064 KB
testcase_20 AC 37 ms
52,632 KB
testcase_21 AC 36 ms
52,068 KB
testcase_22 AC 78 ms
97,484 KB
testcase_23 AC 74 ms
98,136 KB
testcase_24 AC 76 ms
97,848 KB
testcase_25 AC 71 ms
94,516 KB
testcase_26 AC 75 ms
96,616 KB
testcase_27 AC 72 ms
94,740 KB
testcase_28 AC 72 ms
94,608 KB
testcase_29 AC 74 ms
97,656 KB
testcase_30 AC 76 ms
98,496 KB
testcase_31 AC 75 ms
97,272 KB
testcase_32 AC 58 ms
78,692 KB
testcase_33 AC 57 ms
78,164 KB
testcase_34 AC 58 ms
80,620 KB
testcase_35 AC 54 ms
75,392 KB
testcase_36 AC 55 ms
76,712 KB
testcase_37 AC 57 ms
79,208 KB
testcase_38 AC 60 ms
77,480 KB
testcase_39 AC 57 ms
78,812 KB
testcase_40 AC 61 ms
79,464 KB
testcase_41 AC 60 ms
81,488 KB
testcase_42 AC 43 ms
61,884 KB
testcase_43 AC 44 ms
64,576 KB
testcase_44 AC 43 ms
62,588 KB
testcase_45 AC 43 ms
63,460 KB
testcase_46 AC 42 ms
62,204 KB
testcase_47 AC 43 ms
63,892 KB
testcase_48 AC 42 ms
62,408 KB
testcase_49 AC 41 ms
60,884 KB
testcase_50 AC 43 ms
62,744 KB
testcase_51 AC 44 ms
63,988 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

N = int(input())
A = list(map(int,input().split()))

ans = 0
prev = 0
for i in range(N):
    if A[i] == 0:
        ans += (i-prev+1)*(N-i)
        prev = i+1
print(ans)
0