結果

問題 No.2894 Monotonic Intervals
ユーザー hiro1729hiro1729
提出日時 2024-09-11 06:31:53
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 126 ms / 2,000 ms
コード長 200 bytes
コンパイル時間 293 ms
コンパイル使用メモリ 82,368 KB
実行使用メモリ 110,400 KB
最終ジャッジ日時 2024-09-11 06:31:56
合計ジャッジ時間 2,494 ms
ジャッジサーバーID
(参考情報)
judge3 / judge5
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 40 ms
51,712 KB
testcase_01 AC 39 ms
51,456 KB
testcase_02 AC 38 ms
51,712 KB
testcase_03 AC 39 ms
51,456 KB
testcase_04 AC 48 ms
60,032 KB
testcase_05 AC 39 ms
51,712 KB
testcase_06 AC 39 ms
51,712 KB
testcase_07 AC 76 ms
89,856 KB
testcase_08 AC 76 ms
86,844 KB
testcase_09 AC 126 ms
110,072 KB
testcase_10 AC 73 ms
86,496 KB
testcase_11 AC 113 ms
110,292 KB
testcase_12 AC 115 ms
110,400 KB
testcase_13 AC 57 ms
76,928 KB
testcase_14 AC 59 ms
76,928 KB
testcase_15 AC 59 ms
76,656 KB
testcase_16 AC 58 ms
76,800 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

N = int(input())
S = input()
now=0
nowc='.'
rle = []
for i in S:
	if i==nowc:
		now+=1
	else:
		if now>0:
			rle.append((nowc, now))
		now=1
		nowc=i
if now>0:
	rle.append((nowc, now))
print(len(rle))
0