結果

問題 No.1505 Zero-Product Ranges
ユーザー aaaaaaaaaa2230aaaaaaaaaa2230
提出日時 2021-05-14 22:11:56
言語 PyPy3
(7.3.8)
結果
AC  
実行時間 98 ms / 2,000 ms
コード長 228 bytes
コンパイル時間 435 ms
使用メモリ 110,668 KB
最終ジャッジ日時 2022-11-25 18:40:25
合計ジャッジ時間 6,136 ms
ジャッジサーバーID
(参考情報)
judge11 / judge13
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
使用メモリ
testcase_00 AC 59 ms
75,732 KB
testcase_01 AC 59 ms
75,496 KB
testcase_02 AC 60 ms
75,484 KB
testcase_03 AC 91 ms
110,636 KB
testcase_04 AC 92 ms
110,268 KB
testcase_05 AC 76 ms
91,216 KB
testcase_06 AC 75 ms
91,036 KB
testcase_07 AC 72 ms
88,136 KB
testcase_08 AC 72 ms
89,060 KB
testcase_09 AC 71 ms
88,308 KB
testcase_10 AC 72 ms
89,048 KB
testcase_11 AC 77 ms
91,180 KB
testcase_12 AC 75 ms
87,180 KB
testcase_13 AC 81 ms
98,344 KB
testcase_14 AC 79 ms
96,404 KB
testcase_15 AC 90 ms
110,404 KB
testcase_16 AC 94 ms
110,504 KB
testcase_17 AC 94 ms
110,668 KB
testcase_18 AC 93 ms
110,656 KB
testcase_19 AC 60 ms
75,768 KB
testcase_20 AC 58 ms
75,484 KB
testcase_21 AC 59 ms
75,736 KB
testcase_22 AC 98 ms
110,224 KB
testcase_23 AC 93 ms
110,380 KB
testcase_24 AC 94 ms
110,376 KB
testcase_25 AC 95 ms
106,704 KB
testcase_26 AC 94 ms
110,024 KB
testcase_27 AC 90 ms
107,176 KB
testcase_28 AC 91 ms
107,192 KB
testcase_29 AC 94 ms
110,580 KB
testcase_30 AC 97 ms
110,636 KB
testcase_31 AC 93 ms
110,080 KB
testcase_32 AC 79 ms
94,460 KB
testcase_33 AC 78 ms
94,304 KB
testcase_34 AC 81 ms
96,304 KB
testcase_35 AC 76 ms
91,060 KB
testcase_36 AC 79 ms
92,504 KB
testcase_37 AC 79 ms
94,540 KB
testcase_38 AC 83 ms
94,392 KB
testcase_39 AC 79 ms
94,208 KB
testcase_40 AC 81 ms
94,388 KB
testcase_41 AC 81 ms
96,408 KB
testcase_42 AC 65 ms
80,892 KB
testcase_43 AC 66 ms
81,676 KB
testcase_44 AC 67 ms
81,000 KB
testcase_45 AC 65 ms
81,184 KB
testcase_46 AC 65 ms
80,984 KB
testcase_47 AC 66 ms
81,576 KB
testcase_48 AC 66 ms
80,892 KB
testcase_49 AC 65 ms
80,880 KB
testcase_50 AC 65 ms
80,628 KB
testcase_51 AC 66 ms
81,172 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

n = int(input())
A = list(map(int,input().split()))
zero = [n]*(n+1)
for i in range(n)[::-1]:
    if A[i] == 0:
        zero[i] = i
    else:
        zero[i] = zero[i+1]
ans = 0
for i in range(n):
    ans += n-zero[i]
print(ans)
0