Submission #98021

#TimeUsernameProblemLanguageResultExecution timeMemory
98021dalgerokAron (COCI17_aron)C++17
50 / 50
3 ms428 KiB
#include<bits/stdc++.h>
using namespace std;




int main(){
    ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
    int n;
    cin >> n;
    char cur = '#', c;
    int ans = 1;
    for(int i = 1; i <= n; i++){
        cin >> c;
        ans += (c != cur);
        cur = c;
    }
    cout << ans;
}
#Verdict Execution timeMemoryGrader output
Fetching results...