結果

問題 No.1505 Zero-Product Ranges
ユーザー aaaaaaaaaa2230aaaaaaaaaa2230
提出日時 2021-05-14 22:11:56
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 78 ms / 2,000 ms
コード長 228 bytes
コンパイル時間 174 ms
コンパイル使用メモリ 82,520 KB
実行使用メモリ 101,256 KB
最終ジャッジ日時 2024-04-10 00:29:30
合計ジャッジ時間 4,670 ms
ジャッジサーバーID
(参考情報)
judge3 / judge5
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 34 ms
52,560 KB
testcase_01 AC 38 ms
53,004 KB
testcase_02 AC 36 ms
52,612 KB
testcase_03 AC 73 ms
99,064 KB
testcase_04 AC 72 ms
99,048 KB
testcase_05 AC 54 ms
75,268 KB
testcase_06 AC 53 ms
76,576 KB
testcase_07 AC 51 ms
71,704 KB
testcase_08 AC 51 ms
74,248 KB
testcase_09 AC 49 ms
73,420 KB
testcase_10 AC 51 ms
73,956 KB
testcase_11 AC 53 ms
76,140 KB
testcase_12 AC 49 ms
71,548 KB
testcase_13 AC 59 ms
84,100 KB
testcase_14 AC 58 ms
81,780 KB
testcase_15 AC 72 ms
98,904 KB
testcase_16 AC 77 ms
99,676 KB
testcase_17 AC 78 ms
101,256 KB
testcase_18 AC 75 ms
99,948 KB
testcase_19 AC 34 ms
52,084 KB
testcase_20 AC 33 ms
51,940 KB
testcase_21 AC 34 ms
52,136 KB
testcase_22 AC 72 ms
99,608 KB
testcase_23 AC 74 ms
99,312 KB
testcase_24 AC 72 ms
98,424 KB
testcase_25 AC 70 ms
96,476 KB
testcase_26 AC 74 ms
99,308 KB
testcase_27 AC 71 ms
95,492 KB
testcase_28 AC 70 ms
96,512 KB
testcase_29 AC 73 ms
99,120 KB
testcase_30 AC 76 ms
100,092 KB
testcase_31 AC 76 ms
100,460 KB
testcase_32 AC 60 ms
80,340 KB
testcase_33 AC 58 ms
79,460 KB
testcase_34 AC 61 ms
83,168 KB
testcase_35 AC 53 ms
75,280 KB
testcase_36 AC 57 ms
77,260 KB
testcase_37 AC 57 ms
79,740 KB
testcase_38 AC 59 ms
80,320 KB
testcase_39 AC 57 ms
79,304 KB
testcase_40 AC 59 ms
79,784 KB
testcase_41 AC 59 ms
82,484 KB
testcase_42 AC 42 ms
62,520 KB
testcase_43 AC 44 ms
64,284 KB
testcase_44 AC 44 ms
63,452 KB
testcase_45 AC 44 ms
63,668 KB
testcase_46 AC 42 ms
62,228 KB
testcase_47 AC 43 ms
64,060 KB
testcase_48 AC 42 ms
62,696 KB
testcase_49 AC 41 ms
61,536 KB
testcase_50 AC 45 ms
63,320 KB
testcase_51 AC 46 ms
63,184 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