結果

問題 No.1505 Zero-Product Ranges
ユーザー GER_chenGER_chen
提出日時 2021-05-14 22:08:24
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 74 ms / 2,000 ms
コード長 174 bytes
コンパイル時間 171 ms
コンパイル使用メモリ 82,596 KB
実行使用メモリ 98,168 KB
最終ジャッジ日時 2024-04-10 00:23:54
合計ジャッジ時間 4,429 ms
ジャッジサーバーID
(参考情報)
judge3 / judge2
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 36 ms
51,940 KB
testcase_01 AC 36 ms
52,084 KB
testcase_02 AC 32 ms
51,996 KB
testcase_03 AC 68 ms
96,928 KB
testcase_04 AC 68 ms
97,404 KB
testcase_05 AC 49 ms
74,452 KB
testcase_06 AC 52 ms
74,552 KB
testcase_07 AC 49 ms
71,816 KB
testcase_08 AC 54 ms
73,100 KB
testcase_09 AC 49 ms
71,360 KB
testcase_10 AC 49 ms
73,048 KB
testcase_11 AC 48 ms
74,140 KB
testcase_12 AC 44 ms
70,668 KB
testcase_13 AC 56 ms
83,524 KB
testcase_14 AC 54 ms
81,488 KB
testcase_15 AC 68 ms
96,972 KB
testcase_16 AC 71 ms
98,168 KB
testcase_17 AC 72 ms
97,960 KB
testcase_18 AC 70 ms
97,220 KB
testcase_19 AC 32 ms
52,880 KB
testcase_20 AC 32 ms
52,560 KB
testcase_21 AC 37 ms
52,508 KB
testcase_22 AC 73 ms
97,024 KB
testcase_23 AC 74 ms
98,008 KB
testcase_24 AC 74 ms
98,020 KB
testcase_25 AC 70 ms
93,896 KB
testcase_26 AC 67 ms
97,296 KB
testcase_27 AC 65 ms
94,832 KB
testcase_28 AC 66 ms
93,700 KB
testcase_29 AC 68 ms
97,788 KB
testcase_30 AC 70 ms
98,020 KB
testcase_31 AC 69 ms
96,928 KB
testcase_32 AC 51 ms
78,972 KB
testcase_33 AC 52 ms
78,244 KB
testcase_34 AC 56 ms
80,568 KB
testcase_35 AC 52 ms
74,844 KB
testcase_36 AC 54 ms
76,404 KB
testcase_37 AC 55 ms
78,556 KB
testcase_38 AC 58 ms
78,020 KB
testcase_39 AC 52 ms
79,020 KB
testcase_40 AC 56 ms
79,820 KB
testcase_41 AC 59 ms
80,612 KB
testcase_42 AC 43 ms
62,128 KB
testcase_43 AC 45 ms
63,508 KB
testcase_44 AC 44 ms
63,724 KB
testcase_45 AC 41 ms
63,192 KB
testcase_46 AC 42 ms
61,220 KB
testcase_47 AC 42 ms
64,344 KB
testcase_48 AC 41 ms
61,948 KB
testcase_49 AC 42 ms
61,400 KB
testcase_50 AC 43 ms
63,528 KB
testcase_51 AC 44 ms
63,304 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

n = int(input())
A = list(map(int, input().split()))
ans = 0
before = -1
for i, a in enumerate(A):
    if not a:
        ans += (i-before)*(n-i)
        before = i
print(ans)
0