Submission #8983034


Source Code Expand

#include <iostream>
#include <vector>
#include <algorithm>
#include <string>
#include <climits>
#include <iomanip>

using namespace std;


int main() {
	ios::sync_with_stdio(false);
	cin.tie(nullptr);

	int n;
	string s;
	cin >> n;
	cin >> s;

	int ans = 1;
	char now = s[0];
	for (int i = 1; i < n; i++) {
		if (s[i] != now) {
			ans++;
			now = s[i];
		}
	}
	cout << ans << endl;

	return 0;
}

Submission Info

Submission Time
Task C - Slimes
User makiba
Language C++14 (GCC 5.4.1)
Score 300
Code Size 425 Byte
Status AC
Exec Time 3 ms
Memory 512 KiB

Judge Result

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