답안 #89145

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
89145 2018-12-10T15:16:41 Z igzi Aron (COCI17_aron) C++17
50 / 50
3 ms 744 KB
#include <bits/stdc++.h>
#define maxN 1100005
 
using namespace std;

int n,ans,i;
char c,last='c';

 
int main() {
    std::ios_base::sync_with_stdio(false);
    cin>>n;
    for(i=0;i<n;i++){
       cin>>c;
       if(c!=last) ans++;
       last=c;
    }
    cout<<ans+1<<endl;
    return 0;
}
# 결과 실행 시간 메모리 Grader output
1 Correct 2 ms 420 KB Output is correct
2 Correct 2 ms 516 KB Output is correct
3 Correct 2 ms 608 KB Output is correct
4 Correct 2 ms 608 KB Output is correct
5 Correct 2 ms 608 KB Output is correct
6 Correct 2 ms 608 KB Output is correct
7 Correct 2 ms 608 KB Output is correct
8 Correct 3 ms 632 KB Output is correct
9 Correct 2 ms 632 KB Output is correct
10 Correct 2 ms 744 KB Output is correct