結果

問題 No.1505 Zero-Product Ranges
ユーザー pluto77pluto77
提出日時 2021-06-25 11:52:49
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 98 ms / 2,000 ms
コード長 146 bytes
コンパイル時間 114 ms
コンパイル使用メモリ 10,588 KB
実行使用メモリ 11,568 KB
最終ジャッジ日時 2023-09-07 13:33:13
合計ジャッジ時間 6,322 ms
ジャッジサーバーID
(参考情報)
judge11 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 13 ms
7,900 KB
testcase_01 AC 16 ms
7,868 KB
testcase_02 AC 15 ms
7,804 KB
testcase_03 AC 98 ms
11,440 KB
testcase_04 AC 70 ms
11,268 KB
testcase_05 AC 45 ms
9,388 KB
testcase_06 AC 42 ms
9,340 KB
testcase_07 AC 40 ms
9,092 KB
testcase_08 AC 39 ms
9,056 KB
testcase_09 AC 37 ms
9,048 KB
testcase_10 AC 31 ms
9,168 KB
testcase_11 AC 35 ms
9,596 KB
testcase_12 AC 28 ms
9,048 KB
testcase_13 AC 45 ms
10,320 KB
testcase_14 AC 40 ms
10,168 KB
testcase_15 AC 64 ms
11,480 KB
testcase_16 AC 83 ms
11,432 KB
testcase_17 AC 82 ms
11,440 KB
testcase_18 AC 83 ms
11,288 KB
testcase_19 AC 15 ms
7,992 KB
testcase_20 AC 14 ms
7,800 KB
testcase_21 AC 14 ms
7,928 KB
testcase_22 AC 83 ms
11,348 KB
testcase_23 AC 78 ms
11,404 KB
testcase_24 AC 76 ms
11,344 KB
testcase_25 AC 74 ms
11,392 KB
testcase_26 AC 77 ms
11,424 KB
testcase_27 AC 75 ms
11,308 KB
testcase_28 AC 78 ms
11,320 KB
testcase_29 AC 82 ms
11,568 KB
testcase_30 AC 85 ms
11,336 KB
testcase_31 AC 76 ms
11,444 KB
testcase_32 AC 47 ms
10,164 KB
testcase_33 AC 47 ms
9,800 KB
testcase_34 AC 50 ms
10,228 KB
testcase_35 AC 40 ms
9,524 KB
testcase_36 AC 41 ms
9,572 KB
testcase_37 AC 50 ms
9,948 KB
testcase_38 AC 44 ms
9,792 KB
testcase_39 AC 47 ms
9,628 KB
testcase_40 AC 49 ms
9,904 KB
testcase_41 AC 53 ms
10,208 KB
testcase_42 AC 18 ms
8,412 KB
testcase_43 AC 21 ms
8,364 KB
testcase_44 AC 22 ms
8,392 KB
testcase_45 AC 20 ms
8,332 KB
testcase_46 AC 20 ms
8,248 KB
testcase_47 AC 21 ms
8,360 KB
testcase_48 AC 20 ms
8,328 KB
testcase_49 AC 17 ms
8,228 KB
testcase_50 AC 19 ms
8,488 KB
testcase_51 AC 19 ms
8,512 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#yuki1505
n=int(input())
a=list(map(int,input().split()))
res=n*(n+1)//2
x=0
for i in range(n):
 if a[i]:
  x+=1
  res-=x
 else:
  x=0
print(res)
0