結果

問題 No.921 ずんだアロー
ユーザー popketlepopketle
提出日時 2020-02-05 11:51:07
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
WA  
実行時間 -
コード長 266 bytes
コンパイル時間 254 ms
コンパイル使用メモリ 11,908 KB
実行使用メモリ 21,616 KB
最終ジャッジ日時 2023-10-22 06:33:39
合計ジャッジ時間 3,481 ms
ジャッジサーバーID
(参考情報)
judge11 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 29 ms
10,108 KB
testcase_01 AC 29 ms
10,108 KB
testcase_02 AC 29 ms
10,108 KB
testcase_03 AC 29 ms
10,108 KB
testcase_04 WA -
testcase_05 WA -
testcase_06 AC 29 ms
10,136 KB
testcase_07 AC 28 ms
10,116 KB
testcase_08 AC 29 ms
10,108 KB
testcase_09 AC 28 ms
10,112 KB
testcase_10 WA -
testcase_11 WA -
testcase_12 WA -
testcase_13 AC 65 ms
18,084 KB
testcase_14 WA -
testcase_15 AC 54 ms
15,256 KB
testcase_16 AC 33 ms
10,776 KB
testcase_17 AC 71 ms
19,728 KB
testcase_18 WA -
testcase_19 WA -
testcase_20 WA -
testcase_21 WA -
testcase_22 WA -
testcase_23 AC 81 ms
21,600 KB
testcase_24 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

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

before=A[0]
ans=0 if n%2==0 else 1
flag=True
for i in range(1,n):
    if before!=A[i]:
        if flag:
            ans+=1
            flag=False
        else:
            flag=True
    else:
        ans+=1
print(ans)
0