結果

問題 No.2894 Monotonic Intervals
ユーザー Theta
提出日時 2024-11-21 13:44:33
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 61 ms / 2,000 ms
コード長 239 bytes
コンパイル時間 207 ms
コンパイル使用メモリ 82,108 KB
実行使用メモリ 76,464 KB
最終ジャッジ日時 2024-11-21 13:44:36
合計ジャッジ時間 2,197 ms
ジャッジサーバーID
(参考情報)
judge5 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 14
権限があれば一括ダウンロードができます

ソースコード

diff #

def main():
    N = int(input())
    S = input()
    ctr = 1

    cur = S[0]
    for next_ in S[1:]:
        if cur == next_:
            continue
        ctr += 1
        cur = next_
    print(ctr)


if __name__ == "__main__":
    main()
0