結果

問題 No.1505 Zero-Product Ranges
ユーザー GER_chenGER_chen
提出日時 2021-05-14 22:08:24
言語 PyPy3
(7.3.13)
結果
AC  
実行時間 116 ms / 2,000 ms
コード長 174 bytes
コンパイル時間 441 ms
コンパイル使用メモリ 87,172 KB
実行使用メモリ 104,508 KB
最終ジャッジ日時 2023-07-25 06:52:06
合計ジャッジ時間 7,408 ms
ジャッジサーバーID
(参考情報)
judge14 / judge12
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 78 ms
71,388 KB
testcase_01 AC 79 ms
70,988 KB
testcase_02 AC 80 ms
71,264 KB
testcase_03 AC 109 ms
104,144 KB
testcase_04 AC 110 ms
104,184 KB
testcase_05 AC 91 ms
85,704 KB
testcase_06 AC 90 ms
85,584 KB
testcase_07 AC 86 ms
82,976 KB
testcase_08 AC 89 ms
84,072 KB
testcase_09 AC 87 ms
83,276 KB
testcase_10 AC 88 ms
84,200 KB
testcase_11 AC 91 ms
85,760 KB
testcase_12 AC 86 ms
82,176 KB
testcase_13 AC 95 ms
93,096 KB
testcase_14 AC 94 ms
91,000 KB
testcase_15 AC 108 ms
104,048 KB
testcase_16 AC 109 ms
104,444 KB
testcase_17 AC 111 ms
104,452 KB
testcase_18 AC 110 ms
104,052 KB
testcase_19 AC 75 ms
71,344 KB
testcase_20 AC 74 ms
71,448 KB
testcase_21 AC 78 ms
71,348 KB
testcase_22 AC 113 ms
104,508 KB
testcase_23 AC 112 ms
104,444 KB
testcase_24 AC 109 ms
104,176 KB
testcase_25 AC 108 ms
100,916 KB
testcase_26 AC 116 ms
104,192 KB
testcase_27 AC 112 ms
100,968 KB
testcase_28 AC 109 ms
101,252 KB
testcase_29 AC 113 ms
104,488 KB
testcase_30 AC 114 ms
104,188 KB
testcase_31 AC 111 ms
104,132 KB
testcase_32 AC 96 ms
88,960 KB
testcase_33 AC 93 ms
88,892 KB
testcase_34 AC 96 ms
90,412 KB
testcase_35 AC 93 ms
85,800 KB
testcase_36 AC 95 ms
87,404 KB
testcase_37 AC 99 ms
88,736 KB
testcase_38 AC 94 ms
88,604 KB
testcase_39 AC 94 ms
89,104 KB
testcase_40 AC 94 ms
88,924 KB
testcase_41 AC 99 ms
90,880 KB
testcase_42 AC 84 ms
76,488 KB
testcase_43 AC 84 ms
77,048 KB
testcase_44 AC 83 ms
76,496 KB
testcase_45 AC 83 ms
76,400 KB
testcase_46 AC 81 ms
76,208 KB
testcase_47 AC 82 ms
76,648 KB
testcase_48 AC 82 ms
76,468 KB
testcase_49 AC 83 ms
76,208 KB
testcase_50 AC 78 ms
76,216 KB
testcase_51 AC 82 ms
76,480 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