結果

問題 No.1765 While Shining
ユーザー Eki1009Eki1009
提出日時 2021-11-26 22:34:18
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 127 ms / 2,000 ms
コード長 171 bytes
コンパイル時間 470 ms
コンパイル使用メモリ 86,940 KB
実行使用メモリ 111,468 KB
最終ジャッジ日時 2023-09-12 05:12:16
合計ジャッジ時間 4,349 ms
ジャッジサーバーID
(参考情報)
judge13 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 77 ms
71,204 KB
testcase_01 AC 80 ms
71,460 KB
testcase_02 AC 76 ms
71,212 KB
testcase_03 AC 78 ms
71,176 KB
testcase_04 AC 77 ms
70,940 KB
testcase_05 AC 75 ms
71,244 KB
testcase_06 AC 76 ms
71,504 KB
testcase_07 AC 76 ms
71,320 KB
testcase_08 AC 76 ms
71,224 KB
testcase_09 AC 107 ms
97,392 KB
testcase_10 AC 122 ms
110,736 KB
testcase_11 AC 117 ms
103,664 KB
testcase_12 AC 120 ms
106,756 KB
testcase_13 AC 116 ms
103,436 KB
testcase_14 AC 127 ms
110,956 KB
testcase_15 AC 126 ms
111,216 KB
testcase_16 AC 125 ms
111,184 KB
testcase_17 AC 125 ms
111,188 KB
testcase_18 AC 125 ms
111,220 KB
testcase_19 AC 125 ms
111,468 KB
testcase_20 AC 125 ms
110,936 KB
testcase_21 AC 124 ms
111,072 KB
testcase_22 AC 125 ms
111,076 KB
testcase_23 AC 124 ms
111,072 KB
testcase_24 AC 123 ms
111,044 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

n,*A = map(int,open(0).read().split())
x = y = 0
ans = 0
A.pop()
for a in A[::-1]:
    if a == 1:
        x,y = 0,x+1
    else:
        x,y = y+1,0
    ans += y
print(ans)
0