結果

問題 No.1505 Zero-Product Ranges
ユーザー 👑 KazunKazun
提出日時 2021-05-14 22:09:16
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 178 bytes
コンパイル時間 239 ms
コンパイル使用メモリ 82,564 KB
実行使用メモリ 99,500 KB
最終ジャッジ日時 2024-04-10 00:25:36
合計ジャッジ時間 4,720 ms
ジャッジサーバーID
(参考情報)
judge5 / judge2
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 WA -
testcase_01 WA -
testcase_02 WA -
testcase_03 WA -
testcase_04 AC 73 ms
97,648 KB
testcase_05 WA -
testcase_06 WA -
testcase_07 WA -
testcase_08 WA -
testcase_09 WA -
testcase_10 AC 51 ms
72,572 KB
testcase_11 AC 52 ms
75,192 KB
testcase_12 AC 48 ms
70,740 KB
testcase_13 AC 59 ms
82,408 KB
testcase_14 AC 56 ms
80,772 KB
testcase_15 WA -
testcase_16 WA -
testcase_17 WA -
testcase_18 AC 76 ms
98,376 KB
testcase_19 AC 37 ms
52,344 KB
testcase_20 WA -
testcase_21 AC 34 ms
52,608 KB
testcase_22 AC 75 ms
98,156 KB
testcase_23 WA -
testcase_24 WA -
testcase_25 WA -
testcase_26 WA -
testcase_27 WA -
testcase_28 WA -
testcase_29 AC 75 ms
98,012 KB
testcase_30 WA -
testcase_31 AC 74 ms
97,116 KB
testcase_32 AC 57 ms
79,008 KB
testcase_33 AC 56 ms
79,156 KB
testcase_34 WA -
testcase_35 WA -
testcase_36 WA -
testcase_37 AC 57 ms
78,740 KB
testcase_38 AC 56 ms
78,364 KB
testcase_39 WA -
testcase_40 WA -
testcase_41 AC 59 ms
80,612 KB
testcase_42 AC 43 ms
63,164 KB
testcase_43 WA -
testcase_44 WA -
testcase_45 WA -
testcase_46 AC 42 ms
61,136 KB
testcase_47 AC 44 ms
63,576 KB
testcase_48 WA -
testcase_49 AC 41 ms
60,612 KB
testcase_50 WA -
testcase_51 AC 44 ms
63,776 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

N=int(input())
A=list(map(int,input().split()))

X=N*(N+1)//2
chain=0
for a in A:
    if a==1:
        chain+=1
    else:
        X-=chain*(chain+1)//2
        chain=0

print(X)
0