Submission #3024919
Source Code Expand
#include <bits/stdc++.h> #define FOR(i, begin, end) for(int i=(begin);i<(end);i++) #define REP(i, n) FOR(i,0,n) #define SORT(a) sort(a.begin(), a.end()) #define int long long using namespace std; typedef pair<int, int> Pii; template<typename T> void readvec(vector<T> &a); void readindex(vector<int> &a); signed main(){ int N; cin >> N; vector<int> a(N); readvec(a); int ans = 0; REP(i, N - 1){ if(a[i] == a[i + 1]){ ans++; a[i + 1] = 101; } } cout << ans; return 0; } template<typename T> void readvec(vector<T> &a){ REP(i, a.size()){ cin >> a[i]; } } void readindex(vector<int> &a){ REP(i, a.size()){ cin >> a[i]; a[i]--; } }
Submission Info
Submission Time | |
---|---|
Task | A - Colorful Slimes 2 |
User | sumitacchan |
Language | C++14 (GCC 5.4.1) |
Score | 200 |
Code Size | 801 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 |