結果
| 問題 | No.2894 Monotonic Intervals |
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2024-10-24 13:43:09 |
| 言語 | C++17 (gcc 15.2.0 + boost 1.90.0) |
| 結果 |
AC
|
| 実行時間 | 3 ms / 2,000 ms |
| コード長 | 304 bytes |
| 記録 | |
| コンパイル時間 | 314 ms |
| コンパイル使用メモリ | 80,380 KB |
| 実行使用メモリ | 9,264 KB |
| 最終ジャッジ日時 | 2026-07-06 01:15:17 |
| 合計ジャッジ時間 | 2,034 ms |
|
ジャッジサーバーID (参考情報) |
judge3_0 / judge2_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 14 |
ソースコード
#include <iostream>
#include <cstdint>
using namespace std;
int main()
{
cin.tie(nullptr);
ios::sync_with_stdio(false);
uint32_t N, i;
cin >> N;
string S;
S.reserve(N), cin >> S;
uint32_t ans = 1;
for (i = 1; i != N; ++i)
if (S[i] != S[i - 1])
++ans;
cout << ans << '\n';
return 0;
}