Submission #781695

#TimeUsernameProblemLanguageResultExecution timeMemory
781695vjudge1Growing Vegetable is Fun 3 (JOI19_ho_t3)C++17
0 / 100
1 ms212 KiB
#include <bits/stdc++.h> using namespace std; #define int long long #define faster ios_base::sync_with_stdio(false);cin.tie(NULL); #define OYY 1000000005 #define mod 998244353 #define mid (start+end)/2 int32_t main(){ faster int n;cin>>n; int r=0,g=0; string s;cin>>s; for(int i=1;i<n;i++){ if(s[i]=='R' && s[i-1]=='R'){ r++; } else if(s[i]=='G' && s[i-1]=='G'){ g++; } } cout<<max(r,g)<<'\n'; return 0; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...