結果

問題 No.921 ずんだアロー
ユーザー etale.K3etale.K3
提出日時 2021-05-09 22:59:47
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 86 ms / 2,000 ms
コード長 240 bytes
コンパイル時間 196 ms
コンパイル使用メモリ 11,676 KB
実行使用メモリ 21,536 KB
最終ジャッジ日時 2023-10-19 07:17:46
合計ジャッジ時間 2,682 ms
ジャッジサーバーID
(参考情報)
judge13 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 30 ms
10,012 KB
testcase_01 AC 30 ms
10,012 KB
testcase_02 AC 30 ms
10,012 KB
testcase_03 AC 30 ms
10,012 KB
testcase_04 AC 30 ms
10,012 KB
testcase_05 AC 29 ms
10,012 KB
testcase_06 AC 29 ms
10,044 KB
testcase_07 AC 29 ms
10,024 KB
testcase_08 AC 30 ms
10,012 KB
testcase_09 AC 29 ms
10,020 KB
testcase_10 AC 73 ms
20,620 KB
testcase_11 AC 77 ms
21,348 KB
testcase_12 AC 41 ms
12,284 KB
testcase_13 AC 63 ms
17,536 KB
testcase_14 AC 69 ms
19,112 KB
testcase_15 AC 53 ms
15,236 KB
testcase_16 AC 33 ms
10,712 KB
testcase_17 AC 71 ms
19,288 KB
testcase_18 AC 85 ms
21,532 KB
testcase_19 AC 85 ms
21,532 KB
testcase_20 AC 86 ms
21,532 KB
testcase_21 AC 85 ms
21,528 KB
testcase_22 AC 85 ms
21,532 KB
testcase_23 AC 80 ms
21,536 KB
testcase_24 AC 86 ms
21,532 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

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

flg = 1
ans = 1

for i in range(1,N):
    if flg:
        if A[i-1] == A[i]:
            ans += 1
        else:
            flg = 0
    else:
        ans += 1
        flg = 1

print(ans)
0