結果

問題 No.1505 Zero-Product Ranges
ユーザー googol_S0googol_S0
提出日時 2021-05-14 22:05:52
言語 PyPy3
(7.3.13)
結果
AC  
実行時間 117 ms / 2,000 ms
コード長 143 bytes
コンパイル時間 361 ms
コンパイル使用メモリ 87,184 KB
実行使用メモリ 104,472 KB
最終ジャッジ日時 2023-07-25 06:47:01
合計ジャッジ時間 9,030 ms
ジャッジサーバーID
(参考情報)
judge11 / judge12
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 74 ms
71,148 KB
testcase_01 AC 81 ms
71,024 KB
testcase_02 AC 75 ms
71,168 KB
testcase_03 AC 112 ms
103,040 KB
testcase_04 AC 114 ms
103,780 KB
testcase_05 AC 93 ms
85,404 KB
testcase_06 AC 92 ms
85,512 KB
testcase_07 AC 88 ms
83,040 KB
testcase_08 AC 90 ms
83,868 KB
testcase_09 AC 88 ms
82,920 KB
testcase_10 AC 90 ms
84,060 KB
testcase_11 AC 91 ms
85,560 KB
testcase_12 AC 87 ms
81,464 KB
testcase_13 AC 101 ms
92,316 KB
testcase_14 AC 98 ms
90,136 KB
testcase_15 AC 115 ms
103,528 KB
testcase_16 AC 115 ms
104,292 KB
testcase_17 AC 117 ms
104,248 KB
testcase_18 AC 117 ms
104,172 KB
testcase_19 AC 76 ms
71,352 KB
testcase_20 AC 76 ms
71,296 KB
testcase_21 AC 75 ms
71,244 KB
testcase_22 AC 113 ms
104,100 KB
testcase_23 AC 113 ms
104,472 KB
testcase_24 AC 113 ms
104,064 KB
testcase_25 AC 112 ms
100,756 KB
testcase_26 AC 113 ms
103,888 KB
testcase_27 AC 111 ms
100,824 KB
testcase_28 AC 110 ms
100,884 KB
testcase_29 AC 114 ms
104,316 KB
testcase_30 AC 114 ms
104,216 KB
testcase_31 AC 114 ms
104,088 KB
testcase_32 AC 95 ms
88,904 KB
testcase_33 AC 95 ms
89,148 KB
testcase_34 AC 98 ms
90,588 KB
testcase_35 AC 91 ms
85,872 KB
testcase_36 AC 95 ms
87,036 KB
testcase_37 AC 98 ms
88,812 KB
testcase_38 AC 100 ms
88,668 KB
testcase_39 AC 97 ms
88,832 KB
testcase_40 AC 95 ms
88,852 KB
testcase_41 AC 97 ms
90,684 KB
testcase_42 AC 80 ms
75,904 KB
testcase_43 AC 82 ms
76,728 KB
testcase_44 AC 83 ms
76,220 KB
testcase_45 AC 80 ms
76,448 KB
testcase_46 AC 81 ms
76,116 KB
testcase_47 AC 81 ms
76,732 KB
testcase_48 AC 81 ms
76,088 KB
testcase_49 AC 80 ms
75,968 KB
testcase_50 AC 81 ms
76,088 KB
testcase_51 AC 83 ms
76,508 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