結果

問題 No.1505 Zero-Product Ranges
ユーザー miya145592miya145592
提出日時 2023-05-07 16:22:05
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 121 ms / 2,000 ms
コード長 227 bytes
コンパイル時間 456 ms
コンパイル使用メモリ 86,608 KB
実行使用メモリ 104,704 KB
最終ジャッジ日時 2023-08-16 05:41:19
合計ジャッジ時間 9,000 ms
ジャッジサーバーID
(参考情報)
judge12 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 76 ms
71,016 KB
testcase_01 AC 70 ms
71,024 KB
testcase_02 AC 70 ms
71,044 KB
testcase_03 AC 121 ms
104,148 KB
testcase_04 AC 106 ms
104,448 KB
testcase_05 AC 90 ms
85,744 KB
testcase_06 AC 90 ms
85,816 KB
testcase_07 AC 89 ms
83,128 KB
testcase_08 AC 89 ms
83,988 KB
testcase_09 AC 88 ms
82,940 KB
testcase_10 AC 86 ms
84,112 KB
testcase_11 AC 86 ms
85,584 KB
testcase_12 AC 85 ms
81,980 KB
testcase_13 AC 93 ms
92,820 KB
testcase_14 AC 89 ms
90,548 KB
testcase_15 AC 104 ms
104,020 KB
testcase_16 AC 113 ms
104,216 KB
testcase_17 AC 110 ms
104,252 KB
testcase_18 AC 115 ms
104,704 KB
testcase_19 AC 69 ms
71,000 KB
testcase_20 AC 70 ms
71,332 KB
testcase_21 AC 69 ms
71,320 KB
testcase_22 AC 110 ms
104,372 KB
testcase_23 AC 117 ms
104,480 KB
testcase_24 AC 111 ms
104,044 KB
testcase_25 AC 109 ms
100,944 KB
testcase_26 AC 117 ms
104,208 KB
testcase_27 AC 107 ms
101,096 KB
testcase_28 AC 109 ms
101,128 KB
testcase_29 AC 111 ms
104,176 KB
testcase_30 AC 116 ms
104,540 KB
testcase_31 AC 112 ms
103,960 KB
testcase_32 AC 99 ms
88,836 KB
testcase_33 AC 95 ms
88,720 KB
testcase_34 AC 98 ms
90,744 KB
testcase_35 AC 92 ms
85,684 KB
testcase_36 AC 92 ms
87,016 KB
testcase_37 AC 96 ms
89,036 KB
testcase_38 AC 94 ms
88,956 KB
testcase_39 AC 94 ms
88,948 KB
testcase_40 AC 95 ms
89,048 KB
testcase_41 AC 98 ms
90,792 KB
testcase_42 AC 84 ms
76,216 KB
testcase_43 AC 79 ms
76,556 KB
testcase_44 AC 80 ms
76,112 KB
testcase_45 AC 81 ms
76,396 KB
testcase_46 AC 80 ms
76,008 KB
testcase_47 AC 81 ms
76,752 KB
testcase_48 AC 81 ms
76,040 KB
testcase_49 AC 80 ms
76,304 KB
testcase_50 AC 81 ms
76,000 KB
testcase_51 AC 80 ms
76,356 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

N = int(input())
A = list(map(int, input().split()))
l, r = 0, 0
cnt = 0
while l<N:
    while r<N and A[r]!=0:
        r+=1
    if r<N:
        cnt += N-r
    if l==r:
        l+=1
        r+=1
    else:
        l+=1
print(cnt)
0