# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
1274588 | SmuggingSpun | Aron (COCI17_aron) | C++20 | 1 ms | 576 KiB |
#include<bits/stdc++.h>
#define taskname "A"
using namespace std;
int main(){
ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);
if(fopen(taskname".inp", "r")){
freopen(taskname".inp", "r", stdin);
}
int n, ans = 2;
cin >> n;
vector<char>a(n);
for(char& x : a){
cin >> x;
}
for(int i = 1; i < n; i++){
if(a[i] != a[i - 1]){
ans++;
}
}
cout << ans;
}
Compilation message (stderr)
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |