結果

問題 No.1505 Zero-Product Ranges
ユーザー GER_chenGER_chen
提出日時 2021-05-14 22:08:24
言語 PyPy3
(7.3.8)
結果
AC  
実行時間 116 ms / 2,000 ms
コード長 174 bytes
コンパイル時間 236 ms
使用メモリ 109,080 KB
最終ジャッジ日時 2022-11-25 18:32:17
合計ジャッジ時間 7,342 ms
ジャッジサーバーID
(参考情報)
judge12 / judge15
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
使用メモリ
testcase_00 AC 78 ms
75,548 KB
testcase_01 AC 80 ms
75,812 KB
testcase_02 AC 80 ms
75,688 KB
testcase_03 AC 110 ms
108,792 KB
testcase_04 AC 111 ms
108,984 KB
testcase_05 AC 93 ms
90,484 KB
testcase_06 AC 94 ms
90,404 KB
testcase_07 AC 90 ms
87,920 KB
testcase_08 AC 92 ms
88,684 KB
testcase_09 AC 89 ms
87,800 KB
testcase_10 AC 90 ms
88,716 KB
testcase_11 AC 93 ms
90,536 KB
testcase_12 AC 89 ms
86,744 KB
testcase_13 AC 99 ms
97,464 KB
testcase_14 AC 98 ms
95,116 KB
testcase_15 AC 110 ms
108,820 KB
testcase_16 AC 111 ms
109,064 KB
testcase_17 AC 115 ms
108,900 KB
testcase_18 AC 113 ms
109,080 KB
testcase_19 AC 79 ms
75,396 KB
testcase_20 AC 79 ms
75,596 KB
testcase_21 AC 80 ms
75,732 KB
testcase_22 AC 112 ms
108,732 KB
testcase_23 AC 112 ms
108,944 KB
testcase_24 AC 112 ms
108,580 KB
testcase_25 AC 108 ms
105,704 KB
testcase_26 AC 113 ms
108,892 KB
testcase_27 AC 112 ms
105,720 KB
testcase_28 AC 109 ms
105,576 KB
testcase_29 AC 113 ms
109,044 KB
testcase_30 AC 116 ms
108,888 KB
testcase_31 AC 114 ms
108,740 KB
testcase_32 AC 99 ms
93,828 KB
testcase_33 AC 97 ms
93,564 KB
testcase_34 AC 97 ms
95,476 KB
testcase_35 AC 96 ms
90,528 KB
testcase_36 AC 95 ms
91,764 KB
testcase_37 AC 100 ms
93,612 KB
testcase_38 AC 97 ms
93,552 KB
testcase_39 AC 98 ms
93,756 KB
testcase_40 AC 99 ms
93,620 KB
testcase_41 AC 102 ms
95,484 KB
testcase_42 AC 84 ms
80,944 KB
testcase_43 AC 87 ms
81,368 KB
testcase_44 AC 86 ms
80,816 KB
testcase_45 AC 87 ms
81,288 KB
testcase_46 AC 84 ms
80,936 KB
testcase_47 AC 86 ms
81,356 KB
testcase_48 AC 84 ms
80,972 KB
testcase_49 AC 83 ms
80,868 KB
testcase_50 AC 86 ms
80,960 KB
testcase_51 AC 87 ms
81,080 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