Submission #8037631


Source Code Expand

Copy
#include <bits/stdc++.h>

using namespace std;

int main() {
    ios::sync_with_stdio(false);
    cin.tie(0);
    int n;
    cin >> n;
    string s;
    cin >> s;
    int num = 1;
    for (int i = 1; i < n; ++i){
        num += s[i] != s[i-1];
    }
    cout << num << endl;
    return 0;
}

Submission Info

Submission Time
Task C - Slimes
User Tejs
Language C++14 (GCC 5.4.1)
Score 300
Code Size 307 Byte
Status
Exec Time 2 ms
Memory 512 KB

Test Cases

Set Name Score / Max Score Test Cases
Sample 0 / 0 sample00, sample01, sample02
All 300 / 300 handmade03, handmade04, handmade05, handmade06, handmade07, random08, random09, random10, random11, random12, random13, random14, sample00, sample01, sample02
Case Name Status Exec Time Memory
handmade03 2 ms 512 KB
handmade04 2 ms 512 KB
handmade05 2 ms 512 KB
handmade06 1 ms 256 KB
handmade07 2 ms 512 KB
random08 1 ms 384 KB
random09 1 ms 384 KB
random10 1 ms 384 KB
random11 1 ms 384 KB
random12 1 ms 384 KB
random13 1 ms 384 KB
random14 2 ms 512 KB
sample00 1 ms 256 KB
sample01 1 ms 256 KB
sample02 1 ms 256 KB