結果

問題 No.1505 Zero-Product Ranges
ユーザー googol_S0googol_S0
提出日時 2021-05-14 22:05:52
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 73 ms / 2,000 ms
コード長 143 bytes
コンパイル時間 277 ms
コンパイル使用メモリ 82,216 KB
実行使用メモリ 98,368 KB
最終ジャッジ日時 2024-04-10 00:20:10
合計ジャッジ時間 5,179 ms
ジャッジサーバーID
(参考情報)
judge5 / judge4
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 35 ms
52,672 KB
testcase_01 AC 35 ms
51,684 KB
testcase_02 AC 36 ms
52,376 KB
testcase_03 AC 69 ms
98,368 KB
testcase_04 AC 69 ms
96,732 KB
testcase_05 AC 50 ms
75,724 KB
testcase_06 AC 52 ms
74,700 KB
testcase_07 AC 47 ms
71,356 KB
testcase_08 AC 47 ms
73,588 KB
testcase_09 AC 45 ms
70,588 KB
testcase_10 AC 46 ms
72,200 KB
testcase_11 AC 50 ms
74,504 KB
testcase_12 AC 47 ms
69,640 KB
testcase_13 AC 58 ms
83,684 KB
testcase_14 AC 55 ms
80,896 KB
testcase_15 AC 67 ms
96,200 KB
testcase_16 AC 73 ms
97,224 KB
testcase_17 AC 72 ms
98,176 KB
testcase_18 AC 70 ms
97,420 KB
testcase_19 AC 34 ms
51,880 KB
testcase_20 AC 33 ms
52,188 KB
testcase_21 AC 33 ms
53,100 KB
testcase_22 AC 71 ms
96,792 KB
testcase_23 AC 70 ms
97,120 KB
testcase_24 AC 70 ms
96,892 KB
testcase_25 AC 67 ms
94,768 KB
testcase_26 AC 69 ms
97,256 KB
testcase_27 AC 70 ms
93,380 KB
testcase_28 AC 69 ms
94,960 KB
testcase_29 AC 73 ms
97,472 KB
testcase_30 AC 72 ms
98,240 KB
testcase_31 AC 72 ms
96,600 KB
testcase_32 AC 56 ms
78,504 KB
testcase_33 AC 56 ms
78,628 KB
testcase_34 AC 57 ms
80,240 KB
testcase_35 AC 52 ms
73,952 KB
testcase_36 AC 52 ms
75,984 KB
testcase_37 AC 54 ms
78,884 KB
testcase_38 AC 55 ms
78,300 KB
testcase_39 AC 53 ms
78,436 KB
testcase_40 AC 54 ms
79,476 KB
testcase_41 AC 57 ms
80,720 KB
testcase_42 AC 41 ms
63,072 KB
testcase_43 AC 43 ms
64,848 KB
testcase_44 AC 41 ms
62,428 KB
testcase_45 AC 41 ms
63,524 KB
testcase_46 AC 40 ms
61,300 KB
testcase_47 AC 41 ms
63,228 KB
testcase_48 AC 39 ms
61,112 KB
testcase_49 AC 41 ms
61,092 KB
testcase_50 AC 42 ms
62,440 KB
testcase_51 AC 39 ms
63,556 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