結果

問題 No.1505 Zero-Product Ranges
ユーザー googol_S0googol_S0
提出日時 2021-05-14 22:05:52
言語 PyPy3
(7.3.8)
結果
AC  
実行時間 112 ms / 2,000 ms
コード長 143 bytes
コンパイル時間 280 ms
使用メモリ 109,136 KB
最終ジャッジ日時 2022-11-25 18:26:12
合計ジャッジ時間 8,201 ms
ジャッジサーバーID
(参考情報)
judge14 / judge11
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
使用メモリ
testcase_00 AC 74 ms
75,772 KB
testcase_01 AC 72 ms
75,552 KB
testcase_02 AC 76 ms
75,444 KB
testcase_03 AC 106 ms
108,936 KB
testcase_04 AC 105 ms
108,700 KB
testcase_05 AC 89 ms
90,292 KB
testcase_06 AC 87 ms
90,436 KB
testcase_07 AC 86 ms
87,720 KB
testcase_08 AC 87 ms
88,868 KB
testcase_09 AC 87 ms
87,452 KB
testcase_10 AC 88 ms
88,524 KB
testcase_11 AC 88 ms
90,476 KB
testcase_12 AC 84 ms
86,548 KB
testcase_13 AC 95 ms
97,440 KB
testcase_14 AC 92 ms
95,060 KB
testcase_15 AC 103 ms
108,564 KB
testcase_16 AC 107 ms
108,948 KB
testcase_17 AC 107 ms
109,012 KB
testcase_18 AC 107 ms
109,136 KB
testcase_19 AC 78 ms
75,504 KB
testcase_20 AC 73 ms
75,740 KB
testcase_21 AC 74 ms
75,848 KB
testcase_22 AC 108 ms
108,988 KB
testcase_23 AC 108 ms
108,948 KB
testcase_24 AC 110 ms
108,816 KB
testcase_25 AC 105 ms
105,784 KB
testcase_26 AC 108 ms
108,656 KB
testcase_27 AC 105 ms
105,624 KB
testcase_28 AC 108 ms
105,716 KB
testcase_29 AC 112 ms
108,936 KB
testcase_30 AC 108 ms
109,128 KB
testcase_31 AC 106 ms
108,828 KB
testcase_32 AC 95 ms
93,324 KB
testcase_33 AC 92 ms
93,676 KB
testcase_34 AC 95 ms
95,520 KB
testcase_35 AC 91 ms
90,292 KB
testcase_36 AC 97 ms
91,868 KB
testcase_37 AC 92 ms
93,652 KB
testcase_38 AC 93 ms
93,616 KB
testcase_39 AC 95 ms
93,560 KB
testcase_40 AC 94 ms
93,288 KB
testcase_41 AC 98 ms
95,504 KB
testcase_42 AC 81 ms
80,936 KB
testcase_43 AC 82 ms
81,436 KB
testcase_44 AC 81 ms
80,956 KB
testcase_45 AC 81 ms
81,204 KB
testcase_46 AC 78 ms
80,740 KB
testcase_47 AC 81 ms
81,612 KB
testcase_48 AC 80 ms
80,944 KB
testcase_49 AC 77 ms
80,900 KB
testcase_50 AC 79 ms
80,856 KB
testcase_51 AC 79 ms
81,312 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

N=int(input())
A=list(map(int,input().split()))
ANS=N*(N+1)//2
X=0
for i in range(N):
  if A[i]:
    X+=1
    ANS-=X
  else:
    X=0
print(ANS)
0