結果

問題 No.921 ずんだアロー
ユーザー pluto77pluto77
提出日時 2019-11-09 11:53:06
言語 Python2
(2.7.18)
結果
AC  
実行時間 85 ms / 2,000 ms
コード長 194 bytes
コンパイル時間 1,022 ms
コンパイル使用メモリ 6,512 KB
実行使用メモリ 14,616 KB
最終ジャッジ日時 2023-10-13 07:04:41
合計ジャッジ時間 3,288 ms
ジャッジサーバーID
(参考情報)
judge11 / judge12
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 11 ms
5,944 KB
testcase_01 AC 11 ms
6,052 KB
testcase_02 AC 11 ms
5,868 KB
testcase_03 AC 11 ms
5,888 KB
testcase_04 AC 11 ms
6,088 KB
testcase_05 AC 11 ms
6,076 KB
testcase_06 AC 11 ms
6,096 KB
testcase_07 AC 11 ms
5,856 KB
testcase_08 AC 11 ms
5,940 KB
testcase_09 AC 11 ms
5,884 KB
testcase_10 AC 77 ms
13,576 KB
testcase_11 AC 82 ms
14,216 KB
testcase_12 AC 26 ms
7,568 KB
testcase_13 AC 62 ms
11,852 KB
testcase_14 AC 69 ms
12,752 KB
testcase_15 AC 45 ms
9,932 KB
testcase_16 AC 16 ms
6,316 KB
testcase_17 AC 71 ms
12,848 KB
testcase_18 AC 82 ms
14,432 KB
testcase_19 AC 83 ms
14,508 KB
testcase_20 AC 82 ms
14,532 KB
testcase_21 AC 82 ms
14,616 KB
testcase_22 AC 82 ms
14,436 KB
testcase_23 AC 85 ms
14,504 KB
testcase_24 AC 82 ms
14,512 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#yuki921

n=int(raw_input())
a=map(int,raw_input().split())
res=1
f=True
for i in range(1,n):
 if a[i]!=a[i-1]:
  if f:
   f=False
  else:
   res+=1
   f=True
 else:
  res+=1
  f=True
print res
0