Submission #654971

# Submission time Handle Problem Language Result Execution time Memory
654971 2022-11-02T09:45:00 Z berr Aron (COCI17_aron) C++17
50 / 50
1 ms 212 KB
#include <bits/stdc++.h>
using namespace std;
#define int long long

int32_t main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(0);

    int n; cin>>n;

    vector<char> a;


    for(int i=0; i<n; i++)
    {
        char x; cin>>x;
        if(!a.size()||a.back()!=x) a.push_back(x);
    }

    cout<<a.size()+1;

  
}
# Verdict Execution time Memory Grader output
1 Correct 0 ms 212 KB Output is correct
2 Correct 0 ms 212 KB Output is correct
3 Correct 0 ms 212 KB Output is correct
4 Correct 0 ms 212 KB Output is correct
5 Correct 0 ms 212 KB Output is correct
6 Correct 0 ms 212 KB Output is correct
7 Correct 0 ms 212 KB Output is correct
8 Correct 1 ms 212 KB Output is correct
9 Correct 0 ms 212 KB Output is correct
10 Correct 0 ms 212 KB Output is correct