結果
問題 |
No.2894 Monotonic Intervals
|
ユーザー |
|
提出日時 | 2024-10-24 13:43:09 |
言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 21 ms / 2,000 ms |
コード長 | 304 bytes |
コンパイル時間 | 523 ms |
コンパイル使用メモリ | 67,768 KB |
最終ジャッジ日時 | 2025-02-24 22:37:42 |
ジャッジサーバーID (参考情報) |
judge3 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
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; }