Submission #3426409
Source Code Expand
#include <iostream> #include <string> #include <stack> #include <queue> #include <cstring> #include <algorithm> #include <vector> //#include <cstdio> #include <cmath> #include <cstdlib> #include <functional> #include <map> #include <numeric> using namespace std; #define fin << '\n' #define finl << '\n'; #define finn cout << '\n' #define unless(flg) if(!(flg)) #define alles(obj) obj.begin(), obj.end() // bashise #define elif else if #define echo cout << #define read cin >> // javaise #define bash push_back #define makePair make_pair #define isEmpty empty // germanise #define drucken(obj) cout << obj << '\n' #define lesen(obj) cin >> obj #define fur for #define wenn if #define sonst else #define Zahl int // type-define #define String string #define Stack stack #define Queue queue #define pQueue priority_queue #define Vector vector #define Pair pair #define Map map typedef long long llong; typedef bool boolean; typedef Pair<int,int> Pii; typedef Vector<int> Vi; // utils const int dx[] = {1, 0, -1, 0, 1, 1, -1, -1}; const int dy[] = {0, 1, 0, -1, 1, -1, 1, -1}; boolean isMovable(int x,int y,int w,int h){return (x>=0&&y>=0&&x<w&&y<h);}; const int INF = 1 << 29; int ans; signed main(){ cin.tie(0); ios::sync_with_stdio(false); String s; read s; int cnt = 0; for ( int i = 1; i < s.size(); i++ ) { if ( s[i-1] != s[i] ) cnt++; } echo cnt fin; return 0; }
Submission Info
Submission Time | |
---|---|
Task | C - 1D Reversi |
User | r1825 |
Language | C++14 (GCC 5.4.1) |
Score | 300 |
Code Size | 1482 Byte |
Status | AC |
Exec Time | 2 ms |
Memory | 512 KB |
Judge Result
Set Name | sample | All | ||||
---|---|---|---|---|---|---|
Score / Max Score | 0 / 0 | 300 / 300 | ||||
Status |
|
|
Set Name | Test Cases |
---|---|
sample | sample_01.txt, sample_02.txt, sample_03.txt |
All | 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 | AC | 1 ms | 512 KB |
alternate_02.txt | AC | 1 ms | 512 KB |
random_01.txt | AC | 1 ms | 512 KB |
random_02.txt | AC | 1 ms | 512 KB |
random_03.txt | AC | 1 ms | 512 KB |
random_04.txt | AC | 1 ms | 512 KB |
random_05.txt | AC | 1 ms | 512 KB |
same_01.txt | AC | 1 ms | 512 KB |
same_02.txt | AC | 2 ms | 512 KB |
sample_01.txt | AC | 1 ms | 256 KB |
sample_02.txt | AC | 1 ms | 256 KB |
sample_03.txt | AC | 1 ms | 256 KB |
small_01.txt | AC | 1 ms | 256 KB |
small_02.txt | AC | 1 ms | 256 KB |
small_03.txt | AC | 1 ms | 256 KB |