結果

問題 No.2894 Monotonic Intervals
ユーザー forest3
提出日時 2025-02-21 17:56:34
言語 C++14
(gcc 13.3.0 + boost 1.87.0)
結果
AC  
実行時間 14 ms / 2,000 ms
コード長 253 bytes
コンパイル時間 1,612 ms
コンパイル使用メモリ 161,784 KB
実行使用メモリ 6,820 KB
最終ジャッジ日時 2025-02-21 17:56:37
合計ジャッジ時間 2,836 ms
ジャッジサーバーID
(参考情報)
judge4 / judge5
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 14
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
using namespace std;

#define rep(i, n) for( int i = 0; i < n; i++ )
using ll = long long;

int main() {
	int N;
	string s;
	cin >> N >> s;
	int ans = 1;
	rep(i, N - 1) {
		if(s[i] != s[i + 1]) ans++;
	}
	cout << ans << endl;
}
0