Submission #3392495
Source Code Expand
#include "bits/stdc++.h" using namespace std; using ll = long long; using ull = unsigned long long; typedef pair< long long, long long > P; typedef pair< long long, P > PP; typedef pair< P, P > PPP; const double DINF = 5e14, eps = 1e-10; const long long MOD = 1e9 + 7, INF = 5e18; const int di[4] = { 1,0,-1,0 }, dj[4] = { 0,1,0,-1 }; #define fr first #define sc second #define pb push_back #define eb emplace_back #define ALL(x) (x).begin(),(x).end() int n, a[1001], ans; int main() { cin >> n; for (int i = 0;i < n;i++)cin >> a[i]; for (int i = 0;i < n-1;i++) { if (a[i] == a[i + 1])ans++, a[i + 1] = 10000; } cout << ans << endl; return 0; }
Submission Info
Submission Time | |
---|---|
Task | A - Colorful Slimes 2 |
User | kakakakaneko |
Language | C++14 (GCC 5.4.1) |
Score | 200 |
Code Size | 690 Byte |
Status | AC |
Exec Time | 1 ms |
Memory | 256 KB |
Judge Result
Set Name | Sample | All | ||||
---|---|---|---|---|---|---|
Score / Max Score | 0 / 0 | 200 / 200 | ||||
Status |
|
|
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 KB |
example_1 | AC | 1 ms | 256 KB |
example_2 | AC | 1 ms | 256 KB |
example_3 | AC | 1 ms | 256 KB |
handmade_0 | AC | 1 ms | 256 KB |
handmade_1 | AC | 1 ms | 256 KB |
rand_0 | AC | 1 ms | 256 KB |
rand_1 | AC | 1 ms | 256 KB |
smallcolor_0 | AC | 1 ms | 256 KB |
smallcolor_1 | AC | 1 ms | 256 KB |
smallcolor_2 | AC | 1 ms | 256 KB |
smallcolor_3 | AC | 1 ms | 256 KB |
smallcolor_4 | AC | 1 ms | 256 KB |