Submission #2850243


Source Code Expand

#include <iostream>
#include <string>
#include <algorithm>
#include <cmath>

using namespace std;



int main() {

  int N;
  cin >> N;

  int a[100];
  for(int i = 0; i < N; ++i) cin >> a[i];

  int cnt = 0;
  for(int i = 0; i < N-1; ++i) {
    if(a[i]==a[i+1]) {
      cnt += 1;
      i += 1;
    }
  }

  cout << cnt << endl;

}

Submission Info

Submission Time
Task A - Colorful Slimes 2
User k_opt
Language C++14 (GCC 5.4.1)
Score 200
Code Size 360 Byte
Status AC
Exec Time 1 ms
Memory 256 KiB

Judge Result

Set Name Sample All
Score / Max Score 0 / 0 200 / 200
Status
AC × 4
AC × 13
Set Name Test Cases
Sample example_0, example_1, example_2, example_3
All example_0, example_1, example_2, example_3, handmade_0, handmade_1, rand_0, rand_1, smallcolor_0, smallcolor_1, smallcolor_2, smallcolor_3, smallcolor_4
Case Name Status Exec Time Memory
example_0 AC 1 ms 256 KiB
example_1 AC 1 ms 256 KiB
example_2 AC 1 ms 256 KiB
example_3 AC 1 ms 256 KiB
handmade_0 AC 1 ms 256 KiB
handmade_1 AC 1 ms 256 KiB
rand_0 AC 1 ms 256 KiB
rand_1 AC 1 ms 256 KiB
smallcolor_0 AC 1 ms 256 KiB
smallcolor_1 AC 1 ms 256 KiB
smallcolor_2 AC 1 ms 256 KiB
smallcolor_3 AC 1 ms 256 KiB
smallcolor_4 AC 1 ms 256 KiB