Submission #80910

#TimeUsernameProblemLanguageResultExecution timeMemory
80910ngot23Aron (COCI17_aron)C++11
50 / 50
3 ms828 KiB
#include<bits/stdc++.h> #define rep(i, a, b) for(int i=(a) ; i<=(b) ; ++i) #define Task "" using namespace std; int main() { ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0); //freopen(Task".inp", "r", stdin); //freopen(Task".out", "w", stdout); int ans=0, n; cin >> n; char tr='a'; rep(i, 1, n) { char c; cin >> c; if(c!=tr&&i!=1) ++ans; tr=c; } ans+=2; cout << ans; return 0; }
#Verdict Execution timeMemoryGrader output
Fetching results...