結果

問題 No.921 ずんだアロー
ユーザー deideirodeideiro
提出日時 2019-11-25 22:29:21
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 69 ms / 2,000 ms
コード長 271 bytes
コンパイル時間 168 ms
コンパイル使用メモリ 10,608 KB
実行使用メモリ 19,756 KB
最終ジャッジ日時 2023-08-04 19:41:49
合計ジャッジ時間 2,531 ms
ジャッジサーバーID
(参考情報)
judge14 / judge11
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 14 ms
7,812 KB
testcase_01 AC 14 ms
7,940 KB
testcase_02 AC 14 ms
7,824 KB
testcase_03 AC 14 ms
7,972 KB
testcase_04 AC 14 ms
7,816 KB
testcase_05 AC 14 ms
7,936 KB
testcase_06 AC 15 ms
7,936 KB
testcase_07 AC 14 ms
7,832 KB
testcase_08 AC 14 ms
7,856 KB
testcase_09 AC 13 ms
7,992 KB
testcase_10 AC 56 ms
18,720 KB
testcase_11 AC 62 ms
19,516 KB
testcase_12 AC 24 ms
10,564 KB
testcase_13 AC 48 ms
15,628 KB
testcase_14 AC 50 ms
17,216 KB
testcase_15 AC 36 ms
13,440 KB
testcase_16 AC 17 ms
8,852 KB
testcase_17 AC 52 ms
17,568 KB
testcase_18 AC 67 ms
19,624 KB
testcase_19 AC 69 ms
19,636 KB
testcase_20 AC 67 ms
19,756 KB
testcase_21 AC 67 ms
19,720 KB
testcase_22 AC 68 ms
19,636 KB
testcase_23 AC 62 ms
19,688 KB
testcase_24 AC 69 ms
19,716 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#yukicoder 921 ずんだアロー
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