Submission #3550677


Source Code Expand

Copy
#include <bits/stdc++.h>
using namespace std;

string s;
char now;
int cnt = 0;

int main() {
  cin >> s;
  now = s[0];
  for(int i = 1; i < s.size(); ++i)
    if(now != s[i]) {
      ++cnt;
      now = s[i];
    }
  cout << cnt << endl;
  return 0;
}

Submission Info

Submission Time
Task C - 1D Reversi
User m_tsubasa
Language C++14 (GCC 5.4.1)
Score 300
Code Size 268 Byte
Status
Exec Time 5 ms
Memory 512 KB

Judge Result

Set Name Score / Max Score Test Cases
sample 0 / 0 sample_01.txt, sample_02.txt, sample_03.txt
All 300 / 300 alternate_01.txt, alternate_02.txt, random_01.txt, random_02.txt, random_03.txt, random_04.txt, random_05.txt, same_01.txt, same_02.txt, sample_01.txt, sample_02.txt, sample_03.txt, small_01.txt, small_02.txt, small_03.txt
Case Name Status Exec Time Memory
alternate_01.txt 5 ms 512 KB
alternate_02.txt 5 ms 512 KB
random_01.txt 5 ms 512 KB
random_02.txt 5 ms 512 KB
random_03.txt 5 ms 512 KB
random_04.txt 5 ms 512 KB
random_05.txt 5 ms 512 KB
same_01.txt 4 ms 512 KB
same_02.txt 4 ms 512 KB
sample_01.txt 1 ms 256 KB
sample_02.txt 1 ms 256 KB
sample_03.txt 1 ms 256 KB
small_01.txt 1 ms 256 KB
small_02.txt 1 ms 256 KB
small_03.txt 1 ms 256 KB