buggy_code
stringlengths
11
625k
fixed_code
stringlengths
17
625k
bug_type
stringlengths
2
4.45k
language
int64
0
8
token_count
int64
5
200k
a,b,c = input() count = 0 if a == "R" and b == "R" and c == "R": count = 3 elif (a == "R" and b == "R") or(b == "R" and c == "R"): count = 2 elif a == "R"or b =="R" or C == "R": count = 1 else: count = 0 print(count)
a,b,c = input() count = 0 if a == "R" and b == "R" and c == "R": count = 3 elif (a == "R" and b == "R") or(b == "R" and c == "R"): count = 2 elif a == "R"or b =="R" or c == "R": count = 1 else: count = 0 print(count)
[["-", 0, 57, 75, 665, 15, 679, 12, 666, 0, 22], ["+", 0, 57, 75, 665, 15, 679, 12, 666, 0, 22]]
5
97
#include <bits/stdc++.h> using namespace std; int main() { ios::sync_with_stdio(0); cin.tie(0); cout.tie(0); string sh; cin >> sh; int S = 0, R = 0; int ocuur = 0; for (int i = 0; i < 3; ++i) { if (sh[i] == 'S') { S++; ocuur = i; } else { R++; } } if (S == 3) cou...
#include <bits/stdc++.h> using namespace std; int main() { ios::sync_with_stdio(0); cin.tie(0); cout.tie(0); string sh; cin >> sh; int S = 0, R = 0; int ocuur = 0; for (int i = 0; i < 3; ++i) { if (sh[i] == 'S') { S++; ocuur = i; } else { R++; } } if (S == 3) cou...
[["-", 0, 9, 0, 57, 15, 339, 51, 11, 17, 32], ["+", 0, 9, 0, 57, 15, 339, 51, 16, 17, 60]]
1
159
import sys import math def get_array(): return list(map(int, sys.stdin.readline().strip().split())) def get_ints(): return map(int, sys.stdin.readline().strip().split()) def input(): return sys.stdin.readline().strip() s=input() ans=0 if s[0]=="R" and s[1]=="R" and s[2]=="R": print(3) elif s[0]=="R" and s[1]=="R" a...
import sys import math def get_array(): return list(map(int, sys.stdin.readline().strip().split())) def get_ints(): return map(int, sys.stdin.readline().strip().split()) def input(): return sys.stdin.readline().strip() s=input() ans=0 if s[0]=="R" and s[1]=="R" and s[2]=="R": print(3) elif s[0]=="R" and s[1]=="R" a...
[["-", 75, 665, 15, 679, 12, 666, 0, 206, 206, 612], ["+", 75, 665, 15, 679, 12, 666, 0, 206, 206, 612]]
5
213
#include <bits/stdc++.h> using namespace std; int main() { string weather; cin >> weather; vector<char> w(3); for (int i = 0; i < 3; i++) { w[i] = weather[i]; } int days = 0; for (int i = 0; i < 3; i++) { if (w[i] == 'S') { days++; break; } } for (int i = 1; i < 3; i++) { ...
#include <bits/stdc++.h> using namespace std; int main() { string weather; cin >> weather; vector<char> w(3); for (int i = 0; i < 3; i++) { w[i] = weather[i]; } int days = 0; for (int i = 0; i < 3; i++) { if (w[i] == 'R') { days++; break; } } for (int i = 1; i < 3; i++) { ...
[["-", 0, 57, 15, 339, 51, 16, 12, 103, 0, 125], ["+", 0, 57, 15, 339, 51, 16, 12, 103, 0, 125], ["-", 15, 339, 51, 16, 31, 16, 12, 103, 0, 125], ["+", 15, 339, 51, 16, 31, 16, 12, 103, 0, 125], ["-", 15, 339, 51, 16, 12, 16, 12, 103, 0, 125], ["+", 15, 339, 51, 16, 12, 16, 12, 103, 0, 125]]
1
138
S = input() count = 0 for i in range(0, 3): if S[i] == 'R': count += 1 if S[1] == 'S' and count > 0: count -= 1 print(str(count))
S = input() count = 0 for i in range(0, 3): if S[i] == 'R': count += 1 if S[1] == 'S' and count > 1: count -= 1 print(str(count))
[["-", 0, 656, 0, 57, 15, 679, 12, 666, 0, 612], ["+", 0, 656, 0, 57, 15, 679, 12, 666, 0, 612]]
5
55
#include <algorithm> #include <iostream> #include <string> using namespace std; int main() { string s; cin >> s; int n; n = s.size(); int cnt = 0; int ans = 0; for (int i = 0; i < n; i++) { if (s[i] == 'R') cnt++; else cnt = 0; ans = max(ans, cnt); } cout << cnt << endl; retu...
#include <algorithm> #include <iostream> #include <string> using namespace std; int main() { string s; cin >> s; int n; n = s.size(); int cnt = 0; int ans = 0; for (int i = 0; i < n; i++) { if (s[i] == 'R') cnt++; else cnt = 0; ans = max(ans, cnt); } cout << ans << endl; retu...
[["-", 8, 9, 0, 1, 0, 16, 31, 16, 12, 22], ["+", 8, 9, 0, 1, 0, 16, 31, 16, 12, 22]]
1
97
S=str(input()) if S[1]=="R": if S[2]=="R" and S[0]=="R": print(3) else: if S[0]=="R": print(2) if S[2]=="R": print(2) else: print(1) else: if S[2]=="R" or S[0]=="R": print(1) else: print(0)
S=str(input()) if S[1]=="R": if S[2]=="R" and S[0]=="R": print(3) else: if S[0]=="R": print(2) elif S[2]=="R": print(2) else: print(1) else: if S[2]=="R" or S[0]=="R": print(1) else: print(0)
[["-", 0, 57, 75, 76, 8, 196, 0, 57, 0, 121], ["+", 75, 76, 8, 196, 0, 57, 75, 665, 0, 683]]
5
108
#include <bits/stdc++.h> using namespace std; int main() { string S; cin >> S; int answer = 0; if (S.at(0) == 'R' && S.at(1) == 'R' && S.at(2) == 'R') { answer = 3; } else if (S.at(1) == 'S') { if (S.at(0) == 'R' || S.at(2) == 'R') { answer = 1; } else answer = 0; } else if (S.at(0...
#include <bits/stdc++.h> using namespace std; int main() { string S; cin >> S; int answer = 0; if (S.at(0) == 'R' && S.at(1) == 'R' && S.at(2) == 'R') { answer = 3; } else if (S.at(1) == 'S') { if (S.at(0) == 'R' || S.at(2) == 'R') { answer = 1; } else answer = 0; } else if (S.at(0...
[["+", 0, 57, 75, 76, 0, 57, 75, 76, 0, 95], ["+", 0, 57, 75, 76, 0, 1, 0, 11, 31, 22], ["+", 0, 57, 75, 76, 0, 1, 0, 11, 17, 32], ["+", 0, 57, 75, 76, 0, 1, 0, 11, 12, 13], ["+", 75, 76, 0, 57, 75, 76, 0, 1, 0, 35]]
1
153
#include <iostream> #include <string> using namespace std; int main() { string s; int c = 0, max = 0, b = 0; cin >> s; for (int i = 0; i < 3; i++) { if (s[i] == 'R') { b = 0; c++; } else { max = c; c = 0; b = 1; } } if (b == 0) { if (max < c) max = c; ...
#include <iostream> #include <string> using namespace std; int main() { string s; int c = 0, max = 0, b = 0; cin >> s; for (int i = 0; i < 3; i++) { if (s[i] == 'R') { b = 0; c++; } else { if (max < c) max = c; c = 0; b = 1; } } if (b == 0) { if (max <...
[["+", 0, 57, 75, 76, 0, 9, 0, 57, 0, 121], ["+", 75, 76, 0, 9, 0, 57, 15, 339, 0, 24], ["+", 0, 9, 0, 57, 15, 339, 51, 16, 31, 22], ["+", 0, 9, 0, 57, 15, 339, 51, 16, 17, 18], ["+", 0, 9, 0, 57, 15, 339, 51, 16, 12, 22], ["+", 75, 76, 0, 9, 0, 57, 15, 339, 0, 25]]
1
110
#include <bits/stdc++.h> using namespace std; #define rep(i, n) for (int i = 0; i < N; i++) int main() { string N; int ans = 0; cin >> N; for (int i = 0; i < 2; i++) { if (N[i] == 'R') { ans++; } } if (N == "RSR") { ans = 1; } cout << ans << endl; }
#include <bits/stdc++.h> using namespace std; #define rep(i, n) for (int i = 0; i < N; i++) int main() { string N; int ans = 0; cin >> N; for (int i = 0; i < 3; i++) { if (N[i] == 'R') { ans++; } } if (N == "RSR") { ans = 1; } cout << ans << endl; }
[["-", 0, 14, 8, 9, 0, 7, 15, 16, 12, 13], ["+", 0, 14, 8, 9, 0, 7, 15, 16, 12, 13]]
1
84
#include <bits/stdc++.h> using namespace std; int main() { string s; int cnt = 0; cin >> s; for (int i = 0; i < 3; i++) { if (s[i] == 'R') { cnt++; } } if (cnt <= 1) { cout << "0" << endl; return 0; } if (s[1] == 'S') { cout << "1" << endl; return 0; } cout << cnt << ...
#include <bits/stdc++.h> using namespace std; int main() { string s; int cnt = 0; cin >> s; for (int i = 0; i < 3; i++) { if (s[i] == 'R') { cnt++; } } if (cnt < 1) { cout << "0" << endl; return 0; } if (s[1] == 'S') { cout << "1" << endl; return 0; } cout << cnt << e...
[["-", 8, 9, 0, 57, 15, 339, 51, 16, 17, 19], ["+", 8, 9, 0, 57, 15, 339, 51, 16, 17, 18]]
1
108
// Hey u r too far away to know this // CHIRAGA196 #include <bits/stdc++.h> using namespace std; #define ff first #define pb push_back #define ss second #define IOS \ ios_base::sync_with_stdio(false); \ cin...
// Hey u r too far away to know this // CHIRAGA196 #include <bits/stdc++.h> using namespace std; #define ff first #define pb push_back #define ss second #define IOS \ ios_base::sync_with_stdio(false); \ cin...
[["+", 0, 57, 64, 9, 0, 1, 0, 11, 31, 22], ["+", 0, 57, 64, 9, 0, 1, 0, 11, 17, 32], ["+", 0, 57, 64, 9, 0, 1, 0, 11, 12, 13], ["+", 8, 9, 0, 57, 64, 9, 0, 1, 0, 35]]
1
125
S = input('>>>') num = 0 num_rev = [0,0,0] for i in range(3): if S[i] == 'R': num += 1 elif S[i] == 'S': num_rev[i] = num num = 0 print(max(num,num_rev[0],num_rev[1],num_rev[2]))
S = input('') num = 0 num_rev = [0,0,0] for i in range(3): if S[i] == 'R': num += 1 elif S[i] == 'S': num_rev[i] = num num = 0 print(max(num,num_rev[0],num_rev[1],num_rev[2]))
[["-", 0, 662, 12, 652, 3, 4, 0, 557, 0, 6]]
5
82
// Biscuit_Generator // https://atcoder.jp/contests/abc125/tasks/abc125_a // date: 2020-08-15T19:20:35.753917 #include <bits/stdc++.h> using namespace std; typedef long long ll; #define _overload3(_1, _2, _3, name, ...) name #define _rep(i, n) repi(i, 0, n) #define repi(i, a, b) for (ll i = (ll)a; i < (ll)b; i++) #de...
// Biscuit_Generator // https://atcoder.jp/contests/abc125/tasks/abc125_a // date: 2020-08-15T19:20:35.753917 #include <bits/stdc++.h> using namespace std; typedef long long ll; #define _overload3(_1, _2, _3, name, ...) name #define _rep(i, n) repi(i, 0, n) #define repi(i, a, b) for (ll i = (ll)a; i < (ll)b; i++) #de...
[["-", 8, 9, 0, 1, 0, 2, 3, 4, 0, 22], ["+", 8, 9, 0, 1, 0, 2, 3, 4, 0, 22]]
1
465
#include <bits/stdc++.h> using namespace std; typedef long long int ll; int main() { string s; cin >> s; ll ans = 0; if (s[0] == 'R' && s[1] == 'R' && s[2] == 'R') { ans = 3; } else if (s[0] == 'R' && s[1] == 'R' || s[1] == 'R' && s[2] == 'R') { ans = 2; } else if (s[0] == 0 || s[1] == 'R' || s[2...
#include <bits/stdc++.h> using namespace std; typedef long long int ll; int main() { string s; cin >> s; ll ans = 0; if (s[0] == 'R' && s[1] == 'R' && s[2] == 'R') { ans = 3; } else if (s[0] == 'R' && s[1] == 'R' || s[1] == 'R' && s[2] == 'R') { ans = 2; } else if (s[0] == 'R' || s[1] == 'R' || s...
[["-", 15, 339, 51, 16, 31, 16, 31, 16, 12, 13], ["+", 51, 16, 31, 16, 31, 16, 12, 103, 0, 104], ["+", 51, 16, 31, 16, 31, 16, 12, 103, 0, 125]]
1
158
#include <bits/stdc++.h> using namespace std; int main() { int c = 0, ans = 0; string s; cin >> s; for (int i = 0; i < s.size(); ++i) { if (s[i] == 'R') { c++; ans = max(ans, c); } else c = 0; } cout << c; }
#include <bits/stdc++.h> using namespace std; int main() { int c = 0, ans = 0; string s; cin >> s; for (int i = 0; i < s.size(); ++i) { if (s[i] == 'R') c++, ans = max(ans, c); else c = 0; } cout << ans; }
[["-", 0, 7, 8, 9, 0, 57, 64, 9, 0, 45], ["-", 8, 9, 0, 57, 64, 9, 0, 1, 0, 35], ["+", 8, 9, 0, 57, 64, 1, 0, 34, 0, 21], ["-", 0, 7, 8, 9, 0, 57, 64, 9, 0, 46], ["-", 0, 14, 8, 9, 0, 1, 0, 16, 12, 22], ["+", 0, 14, 8, 9, 0, 1, 0, 16, 12, 22]]
1
82
#include <bits/stdc++.h> #define Int long long #define all(x) begin(x), end(x) #define endl "\n" #define cy cout << "YES" << endl #define cn cout << "NO" << endl #define elif else if using namespace std; int main() { string s; cin >> s; int count{}; int real{}; for (size_t i{}; i < 3; i++) { if (s[i] ==...
#include <bits/stdc++.h> #define Int long long #define all(x) begin(x), end(x) #define endl "\n" #define cy cout << "YES" << endl #define cn cout << "NO" << endl #define elif else if using namespace std; int main() { string s; cin >> s; int count{}; int real{1}; for (size_t i{}; i < 3; i++) { if (s[i] =...
[["+", 8, 9, 0, 43, 49, 50, 51, 83, 0, 13]]
1
128
S = input() Scnt = S.count('S') result = 0 result2 = 0 for i in range(3): if S[i] == 'R': result = result + 1 else: result2 = result result = 0 if result > result2: print(result) else: print(result2)
S = input() Scnt = S.count('S') result = 0 result2 = 0 for i in range(3): if S[i] == 'R': result = result + 1 else: if result2 < result: result2 = result result = 0 if result > result2: print(result) else: print(result2)
[["+", 0, 57, 75, 76, 8, 196, 0, 57, 0, 121], ["+", 75, 76, 8, 196, 0, 57, 15, 666, 667, 18], ["+", 75, 76, 8, 196, 0, 57, 15, 666, 0, 22], ["+", 0, 57, 75, 76, 8, 196, 0, 57, 0, 102], ["+", 0, 57, 64, 196, 0, 1, 0, 662, 31, 22]]
5
67
#include <cstdio> #include <iostream> using namespace std; int w[10]; int main(void) { string s; int mx = 0; cin >> s; if (s[0] == 'R') w[0] = 1; mx = 1; for (int i = 1; i < 3; i++) { if (s[i] == 'R') { w[i] = w[i - 1] + 1; mx = max(mx, w[i]); } else w[i] = 0; } prin...
#include <cstdio> #include <iostream> using namespace std; int w[10]; int main(void) { string s; int mx = 0; cin >> s; if (s[0] == 'R') { w[0] = 1; mx = 1; } for (int i = 1; i < 3; i++) { if (s[i] == 'R') { w[i] = w[i - 1] + 1; mx = max(mx, w[i]); } else w[i] = 0; }...
[["+", 0, 14, 8, 9, 0, 57, 64, 9, 0, 45], ["+", 0, 14, 8, 9, 0, 57, 64, 9, 0, 46]]
1
130
#include <bits/stdc++.h> using namespace std; int main() { string s; cin >> s; int ans = 0, i, c = 1, sum = 0; for (i = 0; i < 3; i++) { if (s[i] == 'R' && c == 1) { sum++; ans++; } if (s[i] == 'S') { c = 0; ans = 0; } if (s[i] == 'R' && c == 0) { c = 1; s...
#include <bits/stdc++.h> using namespace std; int main() { string s; cin >> s; int ans = 0, i, c = 1, sum = 0; for (i = 0; i < 3; i++) { if (s[i] == 'R' && c == 1) { sum++; ans++; } if (s[i] == 'S' && i != 2) { c = 0; ans = 0; } if (s[i] == 'R' && c == 0) { c = ...
[["+", 8, 9, 0, 57, 15, 339, 51, 16, 17, 98], ["+", 0, 57, 15, 339, 51, 16, 12, 16, 31, 22], ["+", 0, 57, 15, 339, 51, 16, 12, 16, 17, 79], ["+", 0, 57, 15, 339, 51, 16, 12, 16, 12, 13]]
1
139
import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner scan = new Scanner(System.in); String S = scan.next(); int total = 0; String S1 = S.substring(0, 1); String S2 = S.substring(1, 2); String S3 = S.substring(2, 3); int count = 0; while ...
import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner scan = new Scanner(System.in); String S = scan.next(); int total = 0; String S1 = S.substring(0, 1); String S2 = S.substring(1, 2); String S3 = S.substring(2, 3); int count = 0; while ...
[["-", 0, 16, 12, 492, 3, 4, 0, 5, 0, 491], ["+", 0, 16, 12, 492, 3, 4, 0, 5, 0, 491]]
3
214
#include <bits/stdc++.h> using namespace std; int main() { string s; cin >> s; int count = 0; for (char i : s) { if (i == 'R') { count++; } else if (i == 'S' && count > 0) { count--; } } cout << count << "\n"; }
#include <bits/stdc++.h> using namespace std; int main() { string s; cin >> s; int count = 0; for (char i : s) { if (i == 'R') { count++; } else if (i == 'S' && count > 0) { break; } } cout << count << "\n"; }
[["-", 0, 57, 64, 9, 0, 1, 0, 27, 28, 22], ["-", 0, 57, 64, 9, 0, 1, 0, 27, 17, 68], ["+", 75, 76, 0, 57, 64, 9, 0, 93, 0, 94]]
1
72
#include <iostream> #include <string> using namespace std; int main() { string S; int count = 0; cin >> S; if (S[0] == 'R' && S[1] == 'R' && S[2] == 'R') { count = 3; } else if (S[0] == 'R' && S[1] == 'R' || S[1] == 'R' && S[2] == 'R') { count = 2; } else if (S[0] == 'R' || S[1] == 'R' && S[2] == ...
#include <iostream> #include <string> using namespace std; int main() { string S; int count = 0; cin >> S; if (S[0] == 'R' && S[1] == 'R' && S[2] == 'R') { count = 3; } else if (S[0] == 'R' && S[1] == 'R' || S[1] == 'R' && S[2] == 'R') { count = 2; } else if (S[0] == 'R' || S[1] == 'R' || S[2] == ...
[["-", 0, 57, 15, 339, 51, 16, 12, 16, 17, 98], ["+", 75, 76, 0, 57, 15, 339, 51, 16, 17, 106]]
1
153
line = gets.split('') count = 0 maxCount = 0 line.each{|var| if var == ("S") count +=1 if maxCount < count maxCount = count end elsif var == ("R") count = 0 end } p maxCount
line = gets.split('') count = 0 maxCount = 0 line.each{|var| if var == ("R") count +=1 if maxCount < count maxCount = count end elsif var == ("S") count = 0 end } p maxCount
[["-", 0, 121, 15, 738, 12, 739, 0, 557, 0, 6], ["+", 0, 121, 15, 738, 12, 739, 0, 557, 0, 6], ["-", 75, 759, 15, 738, 12, 739, 0, 557, 0, 6], ["+", 75, 759, 15, 738, 12, 739, 0, 557, 0, 6]]
4
56
s = input() counts = [] count = 1 if s.find('R') == -1: count = 0 else: for a, b in zip(s, s[1:]): if a == b and a == 'R': count += 1 else: counts.append((a, count)) count = 1 print(str(count))
s = input() counts = [] count = 1 if s.find('R') == -1: count = 0 else: for a, b in zip(s, s[1:]): if a == b and a == 'R': count += 1 else: counts.append((a, count)) print(str(count))
[["-", 75, 76, 8, 196, 0, 1, 0, 662, 31, 22], ["-", 75, 76, 8, 196, 0, 1, 0, 662, 0, 32], ["-", 75, 76, 8, 196, 0, 1, 0, 662, 12, 612]]
5
82
///******* In the name of Allah *******/// #include <bits/stdc++.h> using namespace std; long int ar[10013]; // long int gcd(long int a, long int b) //{ // if(b==0) // return a; // return gcd(b,a%b); //} // void sieve() //{ // long long int i,j,k = 0; // memset(ar,0,sizeof(ar));+ // ar[1] = 1; /...
///******* In the name of Allah *******/// #include <bits/stdc++.h> using namespace std; long int ar[10013]; // long int gcd(long int a, long int b) //{ // if(b==0) // return a; // return gcd(b,a%b); //} // void sieve() //{ // long long int i,j,k = 0; // memset(ar,0,sizeof(ar));+ // ar[1] = 1; /...
[["-", 0, 14, 8, 9, 0, 7, 15, 16, 17, 18], ["+", 0, 14, 8, 9, 0, 7, 15, 16, 17, 19]]
1
248
#include <iostream> #include <string> using namespace std; int main() { char s[3]; for (int i = 0; i < 3; i++) cin >> s[i]; int num = 0; if (s[0] == 'R') num++; if (s[1] == 'R') num++; if (s[2] == 'R') { if (s[1] == 'R') num++; } cout << num << "\n"; return 0; }
#include <iostream> #include <string> using namespace std; int main() { char s[3]; for (int i = 0; i < 3; i++) cin >> s[i]; int num = 0; if (s[0] == 'R') num++; if (s[1] == 'R') num++; if (s[2] == 'R') { if (s[1] == 'R') num++; else num = 1; } cout << num << "\n"; retu...
[["+", 0, 57, 64, 9, 0, 57, 75, 76, 0, 95], ["+", 0, 57, 75, 76, 0, 1, 0, 11, 31, 22], ["+", 0, 57, 75, 76, 0, 1, 0, 11, 17, 32], ["+", 0, 57, 75, 76, 0, 1, 0, 11, 12, 13], ["+", 64, 9, 0, 57, 75, 76, 0, 1, 0, 35]]
1
112
function Main(input) { const s = input.trim(); if (s.indexOf("RRR")) { console.log(3); } else if (s.indexOf("RR")) { console.log(2); } else if (s.indexOf("R")) { console.log(1); } else { console.log(0); } } Main(require("fs").readFileSync("/dev/stdin", "utf8"));
function Main(input) { const s = input.trim(); if (s.includes("RRR")) { console.log(3); } else if (s.includes("RR")) { console.log(2); } else if (s.includes("R")) { console.log(1); } else { console.log(0); } } Main(require("fs").readFileSync("/dev/stdin", "utf8"));
[["-", 0, 57, 15, 23, 0, 2, 63, 558, 559, 560], ["+", 0, 57, 15, 23, 0, 2, 63, 558, 559, 560]]
2
109
a, b, c = input() if b == "R": d = 1 if a == "R": d += 1 if c == "R": d += 1 else: d = 0 if a == "R" or c == "R": d += 1 print(c)
a, b, c = input() if b == "R": d = 1 if a == "R": d += 1 if c == "R": d += 1 else: d = 0 if a == "R" or c == "R": d += 1 print(d)
[["-", 0, 656, 0, 1, 0, 652, 3, 4, 0, 22], ["+", 0, 656, 0, 1, 0, 652, 3, 4, 0, 22]]
5
64
#include <bits/stdc++.h> using namespace std; #define fast \ ios_base::sync_with_stdio(false); \ cin.tie(NULL); int main() { fast; int h = 0, m = 0; string s; cin >> s; for (int i = 0; i < 2; i++) ...
#include <bits/stdc++.h> using namespace std; #define fast \ ios_base::sync_with_stdio(false); \ cin.tie(NULL); int main() { fast; int h = 0, m = 0; string s; cin >> s; for (int i = 0; i < 3; i++) ...
[["-", 0, 14, 8, 9, 0, 7, 15, 16, 12, 13], ["+", 0, 14, 8, 9, 0, 7, 15, 16, 12, 13]]
1
129
#include <cstdio> const int S = 3; char W[S]; void solve(); int main() { scanf("%s", W); solve(); return 0; } void solve() { int ans = 0; if (W[0] == 'R') { if (W[1] == 'R') { if (W[2] == 'R') { ans = 3; } else { ans = 2; } } else { ans = 1; } } e...
#include <cstdio> const int S = 3; char W[S]; void solve(); int main() { scanf("%s", W); solve(); return 0; } void solve() { int ans = 0; if (W[0] == 'R') { if (W[1] == 'R') { if (W[2] == 'R') { ans = 3; } else { ans = 2; } } else { ans = 1; } } e...
[["-", 0, 57, 15, 339, 51, 16, 12, 103, 0, 125]]
1
187
import java.math.*; import java.time.Year; import java.util.Random; import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); String a = sc.next(); int R = 0; if (a.charAt(0) == 'R') { R++; } if (a.charAt(1) == 'R') { ...
import java.math.*; import java.time.Year; import java.util.Random; import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); String a = sc.next(); int R = 0; if (a.charAt(0) == 'R') { R++; } if (a.charAt(1) == 'R') { ...
[["+", 8, 196, 0, 57, 15, 15, 0, 16, 17, 106], ["+", 0, 57, 15, 15, 0, 16, 12, 16, 31, 22], ["+", 0, 57, 15, 15, 0, 16, 12, 16, 17, 60], ["+", 0, 57, 15, 15, 0, 16, 12, 16, 12, 499], ["-", 75, 196, 0, 1, 0, 492, 3, 4, 0, 499], ["+", 75, 196, 0, 1, 0, 492, 3, 4, 0, 499]]
3
201
#include <bits/stdc++.h> using namespace std; int main() { string s; cin >> s; int res, counter = 0; if (s[0] == 'R' && s[1] == 'R' && s[2] == 'R') res = 3; else if (s[0] == 'S' && s[1] == 'S' && s[2] == 'S') res = 0; else if (s[0] == 'R' && s[1] == 'R' && s[2] == 'S') res = 2; else if (s[0]...
#include <bits/stdc++.h> using namespace std; int main() { string s; cin >> s; int res, counter = 0; if (s[0] == 'R' && s[1] == 'R' && s[2] == 'R') res = 3; else if (s[0] == 'S' && s[1] == 'S' && s[2] == 'S') res = 0; else if (s[0] == 'R' && s[1] == 'R' && s[2] == 'S') res = 2; else if (s[0]...
[["-", 51, 16, 12, 16, 31, 69, 341, 342, 0, 13], ["+", 51, 16, 12, 16, 31, 69, 341, 342, 0, 13]]
1
175
s = input() ans=0 if "SSS" in s: print(3) elif "SS" in s: print(2) elif "S" in s: print(1) else: print(0)
s = input() ans=0 if "RRR" in s: print(3) elif "RR" in s: print(2) elif "R" in s: print(1) else: print(0)
[["-", 0, 656, 0, 57, 15, 666, 0, 557, 0, 6], ["+", 0, 656, 0, 57, 15, 666, 0, 557, 0, 6], ["-", 0, 57, 75, 665, 15, 666, 0, 557, 0, 6], ["+", 0, 57, 75, 665, 15, 666, 0, 557, 0, 6]]
5
47
S = input() ren = 0 if S[1] == "R": if S[0] == "R" and S[2] == "R": ren = 3 elif S[0] == "R" or S[2] == "R": ren = 2 elif S[0] == "R" or S[2] == "R": ren = 1 print(ren)
S = input() ren = 0 if S[1] == "R": if S[0] == "R" and S[2] == "R": ren = 3 elif S[0] == "R" or S[2] == "R": ren = 2 else: ren = 1 elif S[0] == "R" or S[2] == "R": ren = 1 print(ren)
[["+", 0, 57, 64, 196, 0, 57, 75, 76, 0, 95], ["+", 0, 57, 64, 196, 0, 57, 75, 76, 0, 102], ["+", 75, 76, 8, 196, 0, 1, 0, 662, 31, 22], ["+", 75, 76, 8, 196, 0, 1, 0, 662, 0, 32], ["+", 75, 76, 8, 196, 0, 1, 0, 662, 12, 612]]
5
88
#include <bits/stdc++.h> #define rep(i, n) for (int i = 0; i < (int)(n); i++) using namespace std; int main() { string s; cin >> s; int ans = 0; rep(i, 2) { if (s[i] != 'S') { if (i == 0) { ans = 1; } else { if (s[i - 1] == 'R') ans++; else ans = 1; ...
#include <bits/stdc++.h> #define rep(i, n) for (int i = 0; i < (int)(n); i++) using namespace std; int main() { string s; cin >> s; int ans = 0; rep(i, s.size()) { if (s[i] != 'S') { if (i == 0) { ans = 1; } else { if (s[i - 1] == 'R') ans++; else ans...
[["-", 8, 9, 0, 1, 0, 2, 3, 4, 0, 13], ["+", 0, 2, 3, 4, 0, 2, 63, 118, 28, 22], ["+", 0, 2, 3, 4, 0, 2, 63, 118, 17, 131], ["+", 0, 2, 3, 4, 0, 2, 63, 118, 119, 120], ["+", 0, 2, 3, 4, 0, 2, 3, 4, 0, 24], ["+", 0, 2, 3, 4, 0, 2, 3, 4, 0, 25]]
1
96
S = input() if "RRR" in S: ans = 3 elif "RR" in S: ans = 2 elif "R" in S: ans = 1 print(ans)
S = input() if "RRR" in S: ans = 3 elif "RR" in S: ans = 2 elif "R" in S: ans = 1 else: ans = 0 print(ans)
[["+", 36, 36, 0, 656, 0, 57, 75, 76, 0, 95], ["+", 36, 36, 0, 656, 0, 57, 75, 76, 0, 102], ["+", 75, 76, 8, 196, 0, 1, 0, 662, 31, 22], ["+", 75, 76, 8, 196, 0, 1, 0, 662, 0, 32], ["+", 75, 76, 8, 196, 0, 1, 0, 662, 12, 612]]
5
39
#include <bits/stdc++.h> using namespace std; #define fast_io \ ios_base::sync_with_stdio(false); \ cin.tie(nullptr) #define rep(i, x, y) \ for (decl...
#include <bits/stdc++.h> using namespace std; #define fast_io \ ios_base::sync_with_stdio(false); \ cin.tie(nullptr) #define rep(i, x, y) \ for (decl...
[["-", 8, 9, 0, 1, 0, 2, 3, 4, 0, 13], ["+", 8, 9, 0, 1, 0, 2, 3, 4, 0, 13], ["+", 0, 57, 15, 339, 51, 16, 31, 16, 31, 22], ["+", 0, 57, 15, 339, 51, 16, 31, 16, 17, 18], ["+", 0, 57, 15, 339, 51, 16, 31, 16, 12, 13], ["+", 64, 9, 0, 57, 15, 339, 51, 16, 17, 98]]
1
263
import re S = input() if S == 'RRR': print(3) elif re.match('RR', S) is not None: print(2) elif re.match('R', S) is not None: print(1) else: print(0)
import re S = input() if S == 'RRR': print(3) elif re.search('RR', S) is not None: print(2) elif re.search('R', S) is not None: print(1) else: print(0)
[["-", 75, 665, 15, 666, 0, 652, 63, 319, 319, 22], ["+", 75, 665, 15, 666, 0, 652, 63, 319, 319, 22]]
5
62
s = gets.chomp tmp = 0 ans = 0 s.size.times do |i| if s[i] == "R" tmp = tmp + 1 else ans = tmp if tmp > ans end end ans = tmp if tmp > ans puts ans
s = gets.chomp tmp = 0 ans = 0 s.size.times do |i| if s[i] == "R" tmp = tmp + 1 else ans = tmp if tmp > ans tmp = 0 end end ans = tmp if tmp > ans puts ans
[["+", 8, 736, 0, 121, 75, 95, 0, 662, 31, 22], ["+", 8, 736, 0, 121, 75, 95, 0, 662, 0, 32], ["+", 8, 736, 0, 121, 75, 95, 0, 662, 12, 612]]
4
53
#include <bits/stdc++.h> using namespace std; typedef long long ll; #define pb push_back #define mod 1e9 + 7; #define rep(i, n) for (int i = 0; i < n; i++) #define repa(i, start, end) for (int i = start; i <= end; i++) #define repd(i, start, end) for (int i = start; i >= end; i--) void solve() { string s; cin >> s;...
#include <bits/stdc++.h> using namespace std; typedef long long ll; #define pb push_back #define mod 1e9 + 7; #define rep(i, n) for (int i = 0; i < n; i++) #define repa(i, start, end) for (int i = start; i <= end; i++) #define repd(i, start, end) for (int i = start; i >= end; i--) void solve() { string s; cin >> s;...
[["-", 8, 9, 0, 57, 15, 339, 51, 16, 31, 22], ["+", 8, 9, 0, 57, 15, 339, 51, 16, 31, 22]]
1
176
#include <bits/stdc++.h> using namespace std; #define ll long long int #define newl '\n' bool isprime(ll a) { if (a <= 1) return false; if (a == 2 || a == 3) return true; if (a % 2 == 0 || a % 3 == 0) return false; for (ll i = 5; i * i <= a; i = i + 6) { if (a % i == 0 || a % (i + 2) == 0) ...
#include <bits/stdc++.h> using namespace std; #define ll long long int #define newl '\n' bool isprime(ll a) { if (a <= 1) return false; if (a == 2 || a == 3) return true; if (a % 2 == 0 || a % 3 == 0) return false; for (ll i = 5; i * i <= a; i = i + 6) { if (a % i == 0 || a % (i + 2) == 0) ...
[["-", 0, 57, 75, 76, 0, 9, 0, 93, 0, 94], ["-", 0, 57, 75, 76, 0, 9, 0, 93, 0, 35]]
1
210
sr_list = list(input().split()) r_count = sr_list.count('R') if r_count == 0: print('0') elif r_count == 1: print('1') elif r_count ==3: print('3') else: if sr_list[1] == 'S': print('1') else: print('2')
sr_list = list(input()) r_count = sr_list.count('R') if r_count == 0: print('0') elif r_count == 1: print('1') elif r_count ==3: print('3') else: if sr_list[1] == 'S': print('1') else: print('2')
[["-", 12, 652, 3, 4, 0, 652, 63, 319, 0, 131], ["-", 12, 652, 3, 4, 0, 652, 63, 319, 319, 22], ["-", 12, 652, 3, 4, 0, 652, 3, 4, 0, 24], ["-", 0, 1, 0, 662, 12, 652, 3, 4, 0, 25]]
5
81
max([len(t) for t in input().split('S')])
print(max([len(t) for t in input().split('S')]))
[["+", 36, 36, 0, 656, 0, 1, 0, 652, 63, 22], ["+", 0, 656, 0, 1, 0, 652, 3, 4, 0, 24], ["+", 0, 652, 3, 4, 0, 652, 3, 4, 0, 25]]
5
22
S = list(input()) if "S" in S: if S[1] == "S" and (S[0] != "S" or S[2] != "S"): print(1) elif S[0] == "S" and S[1] == "S" and S[2] == "S": print(0) elif S[1] == "R" and (S[0] != "R" or S[2] != "R"): print(1) else: print(2) else: print(3)
S = list(input()) if "S" in S: if S[1] == "S" and (S[0] != "S" or S[2] != "S"): print(1) elif S[0] == "S" and S[1] == "S" and S[2] == "S": print(0) elif S[1] == "R" and S[0] != "R" and S[2] != "R": print(1) else: print(2) else: print(3)
[["-", 0, 57, 75, 665, 15, 679, 12, 23, 0, 24], ["-", 75, 665, 15, 679, 12, 23, 0, 679, 17, 354], ["+", 64, 196, 0, 57, 75, 665, 15, 679, 17, 355], ["-", 0, 57, 75, 665, 15, 679, 12, 23, 0, 25]]
5
127
#include <bits/stdc++.h> #define rep(i, n) for (int i = 0; i < (int)(n); i++) const int INF = 1 << 29; using namespace std; using ll = long long; int main() { string S; cin >> S; if (S[0] == 'R' && S[1] == 'R' && S[2] == 'R') { cout << 3 << endl; } else if (S[0] != 'R' && S[1] == 'R' && S[2] == 'R') { c...
#include <bits/stdc++.h> #define rep(i, n) for (int i = 0; i < (int)(n); i++) const int INF = 1 << 29; using namespace std; using ll = long long; int main() { string S; cin >> S; if (S[0] == 'R' && S[1] == 'R' && S[2] == 'R') { cout << 3 << endl; } else if (S[0] != 'R' && S[1] == 'R' && S[2] == 'R') { c...
[["-", 64, 9, 0, 1, 0, 16, 31, 16, 12, 13], ["+", 64, 9, 0, 1, 0, 16, 31, 16, 12, 13]]
1
315
p = 0 q = 0 for i in range(len(S)): if S[i] != 'S': p += 1 if p > q: q = p else: p = 0 print(q)
S = input() p = 0 q = 0 for i in range(len(S)): if S[i] != 'S': p += 1 if p > q: q = p else: p = 0 print(q)
[["+", 36, 36, 0, 656, 0, 1, 0, 662, 31, 22], ["+", 36, 36, 0, 656, 0, 1, 0, 662, 0, 32], ["+", 0, 656, 0, 1, 0, 662, 12, 652, 63, 22], ["+", 0, 1, 0, 662, 12, 652, 3, 4, 0, 24], ["+", 0, 1, 0, 662, 12, 652, 3, 4, 0, 25]]
5
47
import re X = input() if re.match("RRR", X) != None: print("3") elif re.match("RR", X) != None: print("2") elif re.match("R", X) != None: print("1") else: print("0")
import re X = input() if re.search("RRR", X) != None: print("3") elif re.search("RR", X) != None: print("2") elif re.search("R", X) != None: print("1") else: print("0")
[["-", 0, 57, 15, 666, 0, 652, 63, 319, 319, 22], ["+", 0, 57, 15, 666, 0, 652, 63, 319, 319, 22], ["-", 75, 665, 15, 666, 0, 652, 63, 319, 319, 22], ["+", 75, 665, 15, 666, 0, 652, 63, 319, 319, 22]]
5
75
#include <bits/stdc++.h> #define FAST \ ios_base::sync_with_stdio(false); \ cin.tie(NULL); \ cout.tie(NULL) #define PI acos(-1.0) #define sq(n...
#include <bits/stdc++.h> #define FAST \ ios_base::sync_with_stdio(false); \ cin.tie(NULL); \ cout.tie(NULL) #define PI acos(-1.0) #define sq(n...
[["-", 8, 9, 0, 57, 15, 339, 51, 11, 17, 32], ["+", 15, 339, 51, 16, 31, 16, 31, 16, 17, 60], ["-", 75, 76, 0, 57, 15, 339, 51, 11, 17, 32]]
1
217
#include <bits/stdc++.h> #define MAX 100005 #define ll long long #define upperlimit 1000100 #define INF 1e18 #define eps 1e-8 #define endl '\n' #define pcc pair<char, char> #define pii pair<int, int> #define pll pair<ll, ll> #define tr(container, it) \ for (typeof(...
#include <bits/stdc++.h> #define MAX 100005 #define ll long long #define upperlimit 1000100 #define INF 1e18 #define eps 1e-8 #define endl '\n' #define pcc pair<char, char> #define pii pair<int, int> #define pll pair<ll, ll> #define tr(container, it) \ for (typeof(...
[["+", 8, 9, 0, 1, 0, 16, 12, 2, 63, 22], ["+", 0, 1, 0, 16, 12, 2, 3, 4, 0, 24], ["+", 0, 1, 0, 16, 12, 2, 3, 4, 0, 21], ["+", 0, 1, 0, 16, 12, 2, 3, 4, 0, 22], ["+", 0, 1, 0, 16, 12, 2, 3, 4, 0, 25]]
1
347
#include <algorithm> #include <array> #include <cmath> #include <iostream> #include <vector> using namespace std; using ll = long long; int main() { string str; ll cnt = 0; ll temp = 0; cin >> str; for (const auto &e : str) { if (e == 'R') { temp++; } else { if (temp > cnt) { ...
#include <algorithm> #include <array> #include <cmath> #include <iostream> #include <vector> using namespace std; using ll = long long; int main() { string str; ll cnt = 0; ll temp = 0; cin >> str; str += 'S'; for (const auto &e : str) { if (e == 'R') { temp++; } else { if (temp ...
[["+", 0, 14, 8, 9, 0, 1, 0, 11, 31, 22], ["+", 0, 14, 8, 9, 0, 1, 0, 11, 17, 107], ["+", 8, 9, 0, 1, 0, 11, 12, 103, 0, 104], ["+", 8, 9, 0, 1, 0, 11, 12, 103, 0, 125], ["+", 0, 30, 0, 14, 8, 9, 0, 1, 0, 35]]
1
92
#include <iostream> using namespace std; int main() { string s; int max = 0, now = 0; cin >> s; for (int i = 0; i < 3; i++) { if (s[i] == 'R') { now++; } else { if (max < now) { max = now; } now = 0; } } if (now == 3) { cout << 3 << endl; } else { co...
#include <iostream> using namespace std; int main() { string s; int max = 0, now = 0; cin >> s; for (int i = 0; i < 3; i++) { if (s[i] == 'R') { now++; } else { if (max < now) { max = now; } now = 0; } } if (now > max) { cout << now << endl; } else { ...
[["-", 8, 9, 0, 57, 15, 339, 51, 16, 17, 60], ["-", 8, 9, 0, 57, 15, 339, 51, 16, 12, 13], ["+", 8, 9, 0, 57, 15, 339, 51, 16, 17, 47], ["+", 8, 9, 0, 57, 15, 339, 51, 16, 12, 22], ["-", 64, 9, 0, 1, 0, 16, 31, 16, 12, 13], ["+", 64, 9, 0, 1, 0, 16, 31, 16, 12, 22]]
1
102
#define _GLIBCXX_DEBUG #define rep(i, n) for (int i = 0; i < n; ++i) #include <bits/stdc++.h> using namespace std; using ll = long long; using P = pair<int, int>; int main() { string s; int count, ans; count = ans = 0; cin >> s; for (int i = 0; i < 3; ++i) { if (s[i] == 'R') ++count; else { ...
#define _GLIBCXX_DEBUG #define rep(i, n) for (int i = 0; i < n; ++i) #include <bits/stdc++.h> using namespace std; using ll = long long; using P = pair<int, int>; int main() { string s; int count, ans; count = ans = 0; cin >> s; for (int i = 0; i < 3; ++i) { if (s[i] == 'R') { ++count; if ...
[["+", 0, 7, 8, 9, 0, 57, 64, 9, 0, 45], ["-", 0, 7, 8, 9, 0, 57, 75, 76, 0, 95], ["-", 8, 9, 0, 57, 75, 76, 0, 9, 0, 45], ["+", 0, 57, 64, 9, 0, 57, 64, 9, 0, 46], ["+", 0, 7, 8, 9, 0, 57, 75, 76, 0, 95], ["+", 8, 9, 0, 57, 75, 76, 0, 9, 0, 45]]
1
114
#include <bits/stdc++.h> #define AndIamIronMan \ ios::sync_with_stdio(false); \ cin.tie(0); \ cout.tie(0); #define M 1000000007 #define int128 ...
#include <bits/stdc++.h> #define AndIamIronMan \ ios::sync_with_stdio(false); \ cin.tie(0); \ cout.tie(0); #define M 1000000007 #define int128 ...
[["-", 0, 14, 8, 9, 0, 7, 15, 16, 12, 22], ["+", 0, 7, 15, 16, 12, 2, 63, 118, 28, 22], ["+", 0, 7, 15, 16, 12, 2, 63, 118, 17, 131], ["+", 0, 7, 15, 16, 12, 2, 63, 118, 119, 120], ["+", 0, 7, 15, 16, 12, 2, 3, 4, 0, 24], ["+", 0, 7, 15, 16, 12, 2, 3, 4, 0, 25]]
1
196
#include <bits/stdc++.h> using namespace std; #define ll long long #define fo(i, n) for (int i = 0; i < n; i++) #define Fo(i, k, n) for (int i = k; i < n; i++) #define MOD 1000000007 #define deb(n) cout << "[ " #n << " = " << n << " ]" << endl; #define FIO ...
#include <bits/stdc++.h> using namespace std; #define ll long long #define fo(i, n) for (int i = 0; i < n; i++) #define Fo(i, k, n) for (int i = k; i < n; i++) #define MOD 1000000007 #define deb(n) cout << "[ " #n << " = " << n << " ]" << endl; #define FIO ...
[["-", 15, 339, 51, 16, 12, 23, 0, 16, 17, 354], ["+", 15, 339, 51, 16, 12, 23, 0, 16, 17, 355]]
1
213
import java.util.Scanner; public class Main { public static void main(String args[]) { Scanner scanner = new Scanner(System.in); String n = scanner.next(); int t = 0; for (int i = 0; i < 3; i++) { char str = n.charAt(0); if (str == 'R') { t = 1; } } for (int j = 0;...
import java.util.Scanner; public class Main { public static void main(String args[]) { Scanner scanner = new Scanner(System.in); String n = scanner.next(); int t = 0; for (int i = 0; i < 3; i++) { char str = n.charAt(i); if (str == 'R') { t = 1; } } for (int j = 0;...
[["-", 0, 503, 49, 200, 51, 492, 3, 4, 0, 499], ["+", 0, 503, 49, 200, 51, 492, 3, 4, 0, 22]]
3
152
s=input() c=0 ans=0 for i in range(len(s)): if(s[i]=='R'): c+=1 else: ans=max(ans,c) if(c): ans=max(ans,c) print(ans)
s=input() c=0 ans=0 for i in range(len(s)): if(s[i]=='R'): c+=1 else: ans=max(ans,c) c=0 if(c): ans=max(ans,c) print(ans)
[["+", 75, 76, 8, 196, 0, 1, 0, 662, 31, 22], ["+", 75, 76, 8, 196, 0, 1, 0, 662, 0, 32], ["+", 75, 76, 8, 196, 0, 1, 0, 662, 12, 612]]
5
64
#include <bits/stdc++.h> #include <iostream> using namespace std; typedef long long ll; int main() { string S; cin >> S; if (S[1] == 'R') { if (S[0] == 'R' && S[2] == 'R') { cout << '3'; } else if (S[0] == 'R' || S[2] == 'R') { cout << '2'; } else { cout << '0'; } } else { ...
#include <bits/stdc++.h> #include <iostream> using namespace std; typedef long long ll; int main() { string S; cin >> S; if (S[1] == 'R') { if (S[0] == 'R' && S[2] == 'R') { cout << '3'; } else if (S[0] == 'R' || S[2] == 'R') { cout << '2'; } else { cout << '1'; } } else { ...
[["-", 0, 9, 0, 1, 0, 16, 12, 103, 0, 125], ["+", 0, 9, 0, 1, 0, 16, 12, 103, 0, 125]]
1
145
#include <algorithm> #include <bitset> #include <cassert> #include <climits> #include <cmath> #include <cstdio> #include <cstring> #include <deque> #include <fstream> #include <functional> #include <iomanip> #include <iostream> #include <iterator> #include <list> #include <map> #include <queue> #include <set> #include ...
#include <algorithm> #include <bitset> #include <cassert> #include <climits> #include <cmath> #include <cstdio> #include <cstring> #include <deque> #include <fstream> #include <functional> #include <iomanip> #include <iostream> #include <iterator> #include <list> #include <map> #include <queue> #include <set> #include ...
[["-", 8, 9, 0, 7, 15, 16, 12, 16, 17, 33], ["-", 8, 9, 0, 7, 15, 16, 12, 16, 12, 13]]
1
321
#include <iostream> using namespace std; int main() { string s; int i, cnt; cin >> s; if (s[0] == 'R') { if (s[1] == 'R') { if (s[2] == 'R') cout << 3; else cout << 2; } else if (s[2] == 'R') { cout << 2; } else { cout << 1; } } else if (s[1] == 'R') {...
#include <iostream> using namespace std; int main() { string s; int i, cnt; cin >> s; if (s[0] == 'R') { if (s[1] == 'R') { if (s[2] == 'R') cout << 3; else cout << 2; } else if (s[2] == 'R') { cout << 1; } else { cout << 1; } } else if (s[1] == 'R') {...
[["-", 0, 57, 64, 9, 0, 1, 0, 16, 12, 13], ["+", 0, 57, 64, 9, 0, 1, 0, 16, 12, 13]]
1
150
#include <bits/stdc++.h> using namespace std; int main() { ios_base::sync_with_stdio(false); cin.tie(0); cout.tie(0); string str; cin >> str; int cnt = 0; for (int i = 0; i < str.length(); i++) { if (str[i] == 'R') { cnt++; if (str[i] == 'S') break; } } cout << cnt << endl...
#include <bits/stdc++.h> using namespace std; int main() { ios_base::sync_with_stdio(false); cin.tie(0); cout.tie(0); string str; cin >> str; int cnt = 0; for (int i = 0; i < str.length(); i++) { if (str[i] == 'R') { cnt++; if (str[i + 1] == 'S') { break; } } } cout...
[["+", 51, 16, 31, 69, 341, 342, 0, 16, 17, 72], ["+", 51, 16, 31, 69, 341, 342, 0, 16, 12, 13], ["+", 0, 57, 64, 9, 0, 57, 64, 9, 0, 45], ["+", 0, 57, 64, 9, 0, 57, 64, 9, 0, 46]]
1
100
import java.util.*; public class Main { public static void main(String[] args) { Scanner scan = new Scanner(System.in); String data = scan.next(); int max = 0, i = 0; for (int j = 0; j < 3; j++) { if (data.charAt(j) == 'S') i++; else i = 0; if (i > max) max =...
import java.util.*; public class Main { public static void main(String[] args) { Scanner scan = new Scanner(System.in); String data = scan.next(); int max = 0, i = 0; for (int j = 0; j < 3; j++) { if (data.charAt(j) == 'R') i++; else i = 0; if (i > max) max =...
[["-", 8, 196, 0, 57, 15, 15, 0, 16, 12, 252], ["+", 8, 196, 0, 57, 15, 15, 0, 16, 12, 252]]
3
110
#include <algorithm> #include <iostream> #include <string> #include <vector> #define ll long long #define mp make_pair using namespace std; int main() { string s; cin >> s; int r = 0; int tmp = 0; for (auto &x : s) { if (x == 'R') tmp++; else { r = max(tmp, r); tmp = 0; } }...
#include <algorithm> #include <iostream> #include <string> #include <vector> #define ll long long #define mp make_pair using namespace std; int main() { string s; cin >> s; int r = 0; int tmp = 0; for (auto &x : s) { if (x == 'R') { tmp++; r = max(tmp, r); } else { tmp = 0; }...
[["+", 0, 338, 8, 9, 0, 57, 64, 9, 0, 45], ["-", 0, 338, 8, 9, 0, 57, 75, 76, 0, 95], ["-", 8, 9, 0, 57, 75, 76, 0, 9, 0, 45], ["+", 0, 338, 8, 9, 0, 57, 64, 9, 0, 46], ["+", 0, 338, 8, 9, 0, 57, 75, 76, 0, 95], ["+", 8, 9, 0, 57, 75, 76, 0, 9, 0, 45]]
1
86
#include <bits/stdc++.h> #define fast() \ ios_base::sync_with_stdio(false); \ cin.tie(NULL); #define endl '\n' using namespace std; typedef long long ll; int main() { fast(); string str; cin >> st...
#include <bits/stdc++.h> #define fast() \ ios_base::sync_with_stdio(false); \ cin.tie(NULL); #define endl '\n' using namespace std; typedef long long ll; int main() { fast(); string str; cin >> st...
[["+", 0, 14, 8, 9, 0, 1, 0, 11, 31, 22], ["+", 0, 14, 8, 9, 0, 1, 0, 11, 17, 107], ["+", 8, 9, 0, 1, 0, 11, 12, 103, 0, 104], ["+", 8, 9, 0, 1, 0, 11, 12, 103, 0, 125], ["+", 0, 30, 0, 14, 8, 9, 0, 1, 0, 35]]
1
92
S = input() max_cnt = 0 cnt = 0 for s in S: if s == "R": cnt += 1 else: if cnt > max_cnt: max_cnt = cnt cnt = 0 print(max_cnt)
S = input() max_cnt = 0 cnt = 0 for s in S: if s == "R": cnt += 1 if cnt > max_cnt: max_cnt = cnt else: cnt = 0 print(max_cnt)
[["-", 0, 7, 8, 196, 0, 57, 75, 76, 0, 95], ["-", 0, 7, 8, 196, 0, 57, 75, 76, 0, 102], ["+", 0, 7, 8, 196, 0, 57, 75, 76, 0, 95], ["+", 0, 7, 8, 196, 0, 57, 75, 76, 0, 102]]
5
43
a=input() if a=='RRR': print('3') elif a=='RSS' or a=='SSR': print('2') elif a=='SSS': print('0') else: print('1')
a=input() if a=='RRR': print('3') elif a=='RRS' or a=='SRR': print('2') elif a=='SSS': print('0') else: print('1')
[["-", 75, 665, 15, 679, 31, 666, 0, 557, 0, 6], ["+", 75, 665, 15, 679, 31, 666, 0, 557, 0, 6], ["-", 75, 665, 15, 679, 12, 666, 0, 557, 0, 6], ["+", 75, 665, 15, 679, 12, 666, 0, 557, 0, 6]]
5
58
#include <bits/stdc++.h> using namespace std; typedef long long int ll; ll n, i, j, t; int main() { string s; cin >> s; ll c = 0, max = 0; for (i = 0; i < 3; i++) { if (s[i] == 'R') { c++; } else if (i < 2) { if (c > max) max = c; c = 0; } else if (i == 2) { if ...
#include <bits/stdc++.h> using namespace std; typedef long long int ll; ll n, i, j, t; int main() { string s; cin >> s; ll c = 0, max = 0; for (i = 0; i < 3; i++) { if (s[i] == 'R') { c++; } else if (i < 2) { if (c > max) max = c; c = 0; } if (i == 2) { if ...
[["-", 0, 57, 75, 76, 0, 57, 75, 76, 0, 95]]
1
127
s = input() r = 0 x=0 for i in s: if i == 'R': r += 1 else: x = max(r,x) r = 0 print(x)
s = input() r = 0 x=0 for i in s: if i == 'R': r += 1 else: x = max(r,x) r = 0 print(max(x,r))
[["+", 0, 1, 0, 652, 3, 4, 0, 652, 63, 22], ["+", 0, 652, 3, 4, 0, 652, 3, 4, 0, 24], ["+", 0, 652, 3, 4, 0, 652, 3, 4, 0, 21], ["+", 0, 652, 3, 4, 0, 652, 3, 4, 0, 22], ["+", 0, 652, 3, 4, 0, 652, 3, 4, 0, 25]]
5
43
#include <bits/stdc++.h> using namespace std; int main() { string s; cin >> s; for (int l = 3; 0 <= l; l--) { for (int i = 0; i < s.size(); i++) { string t = s.substr(i, l); bool f = true; for (auto &&c : t) { f &= (c == 'R'); } if (f) { cout << l << endl; ...
#include <bits/stdc++.h> using namespace std; int main() { string s; cin >> s; for (int l = 3; 0 <= l; l--) { for (int i = 0; i + l <= s.size(); i++) { string t = s.substr(i, l); bool f = true; for (auto &&c : t) { f &= (c == 'R'); } if (f) { cout << l << endl...
[["-", 0, 7, 8, 9, 0, 7, 15, 16, 17, 18], ["+", 8, 9, 0, 7, 15, 16, 31, 16, 17, 72], ["+", 8, 9, 0, 7, 15, 16, 31, 16, 12, 22], ["+", 0, 7, 8, 9, 0, 7, 15, 16, 17, 19]]
1
110
#include <bits/stdc++.h> using namespace std; #define IOS \ ios::sync_with_stdio(0); \ cin.tie(0); \ cout.tie(0); int main() { ...
#include <bits/stdc++.h> using namespace std; #define IOS \ ios::sync_with_stdio(0); \ cin.tie(0); \ cout.tie(0); int main() { ...
[["-", 0, 57, 64, 9, 0, 1, 0, 16, 12, 13], ["+", 0, 57, 64, 9, 0, 1, 0, 16, 12, 13]]
1
301
#pragma GCC optimize(2) #include <bits/stdc++.h> #define MIN -10000000 #define MAX 10000000 #define debug printf("%d", __LINE__) using namespace std; int main() { string s; cin >> s; if (s[0] != 'R' && s[1] != 'R' && s[3] != 'R') return puts("0"), 0; if (s[0] == 'R' && s[1] != 'R' && s[2] != 'R') return...
#pragma GCC optimize(2) #include <bits/stdc++.h> #define MIN -10000000 #define MAX 10000000 #define debug printf("%d", __LINE__) using namespace std; int main() { string s; cin >> s; if (s[0] != 'R' && s[1] != 'R' && s[2] != 'R') return puts("0"), 0; if (s[0] == 'R' && s[1] != 'R' && s[2] != 'R') return...
[["-", 51, 16, 12, 16, 31, 69, 341, 342, 0, 13], ["+", 51, 16, 12, 16, 31, 69, 341, 342, 0, 13]]
1
345
s = str(input()) s = list(s) cnt = 0 for i in range(3): if(s[i] == "S"): cnt += 1 if(s[0] == "S" and s[1] == "R" and s[2] == "S"): cnt = 1 print(cnt)
s = str(input()) s = list(s) cnt = 0 for i in range(3): if(s[i] == "R"): cnt += 1 if(s[0] == "R" and s[1] == "S" and s[2] == "R"): cnt = 1 print(cnt)
[["-", 0, 57, 15, 23, 0, 666, 0, 557, 0, 6], ["+", 0, 57, 15, 23, 0, 666, 0, 557, 0, 6], ["-", 0, 679, 31, 679, 31, 666, 0, 557, 0, 6], ["+", 0, 679, 31, 679, 31, 666, 0, 557, 0, 6], ["-", 0, 679, 31, 679, 12, 666, 0, 557, 0, 6], ["+", 0, 679, 31, 679, 12, 666, 0, 557, 0, 6], ["-", 15, 23, 0, 679, 12, 666, 0, 557, 0, 6...
5
77
#include <bits/stdc++.h> using ll = long long int; using namespace std; typedef pair<int, int> pi; int main() { string s; cin >> s; int c = 0; for (char c : s) if (c == 'S') c++; if (c == 3) puts("0"); else if (c == 1 && s[0] == 'R' && s[1] == 'R') puts("2"); else if (c == 1 && s[1] == ...
#include <bits/stdc++.h> using ll = long long int; using namespace std; typedef pair<int, int> pi; int main() { string s; cin >> s; int c = 0; for (char K : s) if (K == 'S') c++; if (c == 3) puts("0"); else if (c == 1 && s[0] == 'R' && s[1] == 'R') puts("2"); else if (c == 1 && s[1] == ...
[["-", 0, 30, 0, 14, 8, 9, 0, 338, 49, 22], ["+", 0, 30, 0, 14, 8, 9, 0, 338, 49, 22], ["-", 0, 338, 8, 57, 15, 339, 51, 16, 31, 22], ["+", 0, 338, 8, 57, 15, 339, 51, 16, 31, 22]]
1
160
weather = input() raincount=0 cont=0 for i in range(3): if weather[i]=="R" and cont==0: raincount=raincount+1 elif weather[i]=="R" and cont==1: raincount=1 elif weather[i] == "S": cont=1 print(raincount)
weather = input() raincount=0 cont=0 for i in range(3): if weather[i]=="R" and cont==0: raincount=raincount+1 elif weather[i]=="R" and cont==1: raincount=1 cont=0 elif weather[i] == "S": cont=1 print(raincount)
[["+", 75, 665, 64, 196, 0, 1, 0, 662, 31, 22], ["+", 75, 665, 64, 196, 0, 1, 0, 662, 0, 32], ["+", 75, 665, 64, 196, 0, 1, 0, 662, 12, 612]]
5
72
#include <algorithm> #include <cmath> #include <functional> #include <iomanip> #include <iostream> #include <map> #include <numeric> #include <queue> #include <string> #include <vector> #define rep(i, n) for (int i = 0; i < n; i++) #define rep1(i, n) for (int i = 1; i < n; i++) #define ll long long #define INF 21474836...
#include <algorithm> #include <cmath> #include <functional> #include <iomanip> #include <iostream> #include <map> #include <numeric> #include <queue> #include <string> #include <vector> #define rep(i, n) for (int i = 0; i < n; i++) #define rep1(i, n) for (int i = 1; i < n; i++) #define ll long long #define INF 21474836...
[["-", 0, 9, 0, 57, 15, 339, 51, 11, 17, 32], ["+", 0, 9, 0, 57, 15, 339, 51, 16, 17, 60]]
1
124
#include <iostream> // #include<vector> // #include<algorithm> // #include<cmath> // #include<iomanip> // #include<unordered_set> // #include<unordered_map> // #define pb push_back using namespace std; // typedef long long long long ll; // typedef unsigned long long long long ull; // typedef pair<int,int> pii; int ...
#include <iostream> // #include<vector> // #include<algorithm> // #include<cmath> // #include<iomanip> // #include<unordered_set> // #include<unordered_map> // #define pb push_back using namespace std; // typedef long long long long ll; // typedef unsigned long long long long ull; // typedef pair<int,int> pii; int ...
[["-", 0, 14, 8, 9, 0, 7, 26, 27, 28, 22], ["-", 0, 14, 8, 9, 0, 7, 26, 27, 17, 29]]
1
111
#include <bits/stdc++.h> using namespace std; using ll = long long; signed main() { string S; cin >> S; int count = 0; if (S == "SSS") { count = 0; } else if (S[1] == 'S') { count = 1; } else if (S == "RRR") { count = 3; } else { count = 2; } cout << count << endl; return 0; }
#include <bits/stdc++.h> using namespace std; using ll = long long; signed main() { string S; cin >> S; int count = 0; if (S == "SSS") { count = 0; } else if (S[1] == 'S' || S == "SRS") { count = 1; } else if (S == "RRR") { count = 3; } else { count = 2; } cout << count << endl; ...
[["+", 75, 76, 0, 57, 15, 339, 51, 16, 17, 106], ["+", 0, 57, 15, 339, 51, 16, 12, 16, 31, 22], ["+", 0, 57, 15, 339, 51, 16, 12, 16, 17, 60], ["+", 15, 339, 51, 16, 12, 16, 12, 5, 0, 62], ["+", 15, 339, 51, 16, 12, 16, 12, 5, 0, 6]]
1
93
#include <bits/stdc++.h> using namespace std; #define ll long long #define MoD 1e9 + 7 #define clear(a) memset(a, 0, sizeof(a)) #define fo(i, a, b) for (int i = a; i < b; i++) #define re(i, a, b) for (int i = b; i > a; i--) #define pb(a) push_back(a) template <typename T1, typename T2> inline void chmin(T1 &a, T2 b)...
#include <bits/stdc++.h> using namespace std; #define ll long long #define MoD 1e9 + 7 #define clear(a) memset(a, 0, sizeof(a)) #define fo(i, a, b) for (int i = a; i < b; i++) #define re(i, a, b) for (int i = b; i > a; i--) #define pb(a) push_back(a) template <typename T1, typename T2> inline void chmin(T1 &a, T2 b)...
[["-", 8, 9, 0, 1, 0, 2, 3, 4, 0, 13], ["+", 8, 9, 0, 1, 0, 2, 3, 4, 0, 13]]
1
264
#include <bits/stdc++.h> using namespace std; using p = pair<int, int>; #define int long long #define rep(i, N) for (int i = 0; i < N; i++) signed main() { string S; cin >> S; int ans = 0; if (S == "RSR") { ans = 2; cout << ans << endl; return 0; } rep(i, 3) { if (S[i] == 'R') ans += ...
#include <bits/stdc++.h> using namespace std; using p = pair<int, int>; #define int long long #define rep(i, N) for (int i = 0; i < N; i++) signed main() { string S; cin >> S; int ans = 0; if (S == "RSR") { ans = 1; cout << ans << endl; return 0; } rep(i, 3) { if (S[i] == 'R') ans += ...
[["-", 0, 57, 64, 9, 0, 1, 0, 11, 12, 13], ["+", 0, 57, 64, 9, 0, 1, 0, 11, 12, 13]]
1
101
#include <bits/stdc++.h> #define rep(i, n) for (int i = 0; i < (n); i++) using namespace std; using ll = long long; using P = pair<int, int>; int main() { string s; cin >> s; int ans = 0; if (s[0] == 'R' & s[2] == 'S' & s[2] == 'R') { cout << 1 << endl; return 0; } else { rep(i, 3) { if (s[...
#include <bits/stdc++.h> #define rep(i, n) for (int i = 0; i < (n); i++) using namespace std; using ll = long long; using P = pair<int, int>; int main() { string s; cin >> s; int ans = 0; if (s[0] == 'R' & s[1] == 'S' & s[2] == 'R') { cout << 1 << endl; return 0; } else { rep(i, 3) { if (s[...
[["-", 31, 16, 12, 16, 31, 69, 341, 342, 0, 13], ["+", 31, 16, 12, 16, 31, 69, 341, 342, 0, 13]]
1
125
#include <bits/stdc++.h> #include <math.h> using namespace std; typedef long long ll; typedef vector<int> vint; #define rep(i, n) for (int i = 0; i < (int)(n); ++i) #define rrep(i, j, n) for (int i = (int)(j); i < (int)(n); i++) #define mrep(i, n) for (int i = (int)(n); i > 0; i--) #define be(v) (v).begin(), (v).end() ...
#include <bits/stdc++.h> #include <math.h> using namespace std; typedef long long ll; typedef vector<int> vint; #define rep(i, n) for (int i = 0; i < (int)(n); ++i) #define rrep(i, j, n) for (int i = (int)(j); i < (int)(n); i++) #define mrep(i, n) for (int i = (int)(n); i > 0; i--) #define be(v) (v).begin(), (v).end() ...
[["-", 75, 76, 0, 1, 0, 16, 31, 16, 12, 13], ["+", 75, 76, 0, 1, 0, 16, 31, 16, 12, 13]]
1
176
#include <algorithm> #include <cmath> #include <cstdio> #include <cstring> #include <iostream> #include <iterator> #include <map> #include <queue> #include <set> #include <string> #include <vector> using namespace std; int main(int argc, const char *argv[]) { string S; cin >> S; if (S[0] == 'R' && S[1] == 'R' &&...
#include <algorithm> #include <cmath> #include <cstdio> #include <cstring> #include <iostream> #include <iterator> #include <map> #include <queue> #include <set> #include <string> #include <vector> using namespace std; int main(int argc, const char *argv[]) { string S; cin >> S; if (S[0] == 'R' && S[1] == 'R' &&...
[["+", 0, 14, 8, 9, 0, 57, 75, 76, 0, 95], ["+", 0, 57, 75, 76, 0, 57, 75, 76, 0, 95]]
1
198
n = input() c = 0 f = False if n[0] == "R" and n[1]=="R": c=2 f = True if n[1] == "R" and n[0] == "R": c=2 f = True if n[1] == "R" and n[0] == "R" and n[2] == "R": c= 3 if f == False: if n.count("R") == 0: c = 0 else: c = 1 print(c)
n = input() c = 0 f = False if n[0] == "R" and n[1]=="R": c=2 f = True if n[1] == "R" and n[2] == "R": c=2 f = True if n[1] == "R" and n[0] == "R" and n[2] == "R": c= 3 if f == False: if n.count("R") == 0: c = 0 else: c = 1 print(c)
[["-", 0, 57, 15, 679, 12, 666, 0, 206, 206, 612], ["+", 0, 57, 15, 679, 12, 666, 0, 206, 206, 612]]
5
121
#include <bits/stdc++.h> using namespace std; int main() { string S; cin >> S; int count = 0; int answer = 0; bool a = true; for (int i = 0; i < 3; i++) { if (S.at(i) == 'R') { count++; } else { answer = count; count = 0; } } cout << max(answer, count) << endl; }
#include <bits/stdc++.h> using namespace std; int main() { string S; cin >> S; int count = 0; int answer = 0; bool a = true; for (int i = 0; i < 3; i++) { if (S.at(i) == 'R') { count++; } else { answer = max(answer, count); count = 0; } } cout << max(answer, count) << endl;...
[["+", 0, 9, 0, 1, 0, 11, 12, 2, 63, 22], ["+", 0, 1, 0, 11, 12, 2, 3, 4, 0, 24], ["+", 0, 1, 0, 11, 12, 2, 3, 4, 0, 22], ["+", 0, 1, 0, 11, 12, 2, 3, 4, 0, 21], ["+", 0, 1, 0, 11, 12, 2, 3, 4, 0, 25]]
1
90
a=input() flag=False ans=0 hold=0 for i in range(3): if a[i]=='R' and not flag: ans=1 flag=not flag hold=max(hold,ans) elif a[i]=='R' and flag: ans+=1 hold=max(hold,ans) else: ans=0 flag=False return(hold)
a=input() flag=False ans=0 hold=0 for i in range(3): if a[i]=='R' and not flag: ans=1 flag=not flag hold=max(hold,ans) elif a[i]=='R' and flag: ans+=1 hold=max(hold,ans) else: ans=0 flag=False print(hold)
[["-", 36, 36, 36, 36, 0, 656, 0, 37, 0, 38], ["+", 36, 36, 0, 656, 0, 1, 0, 652, 63, 22]]
5
85
#include <algorithm> #include <iostream> #include <vector> using namespace std; typedef long long ll; const int N = 5e4 + 5; int arr[N]; vector<int> vc; bool cmp(int a, int b) { return a > b; } int main() { ios::sync_with_stdio(0); cin.tie(0), cout.tie(0); string s; cin >> s; if (s[0] == 'R' && s[1] == 'R' &&...
#include <algorithm> #include <iostream> #include <vector> using namespace std; typedef long long ll; const int N = 5e4 + 5; int arr[N]; vector<int> vc; bool cmp(int a, int b) { return a > b; } int main() { ios::sync_with_stdio(0); cin.tie(0), cout.tie(0); string s; cin >> s; if (s[0] == 'R' && s[1] == 'R' &&...
[["-", 0, 16, 31, 16, 31, 69, 341, 342, 0, 13], ["+", 0, 16, 31, 16, 31, 69, 341, 342, 0, 13], ["-", 0, 16, 12, 16, 31, 69, 341, 342, 0, 13], ["+", 0, 16, 12, 16, 31, 69, 341, 342, 0, 13]]
1
218
def ii():return int(input()) def iim():return map(int,input().split()) def iil():return list(map(int,input().split())) s = input() cnt = 0 ans = 0 for i in s: if i=='R': cnt += 1 else: ans = max(ans,cnt) cnt = 0 print(ans)
def ii():return int(input()) def iim():return map(int,input().split()) def iil():return list(map(int,input().split())) s = input() cnt = 0 ans = 0 for i in s: if i=='R': cnt += 1 else: ans = max(ans,cnt) cnt = 0 print(max(ans,cnt))
[["+", 0, 1, 0, 652, 3, 4, 0, 652, 63, 22], ["+", 0, 652, 3, 4, 0, 652, 3, 4, 0, 24], ["+", 0, 652, 3, 4, 0, 652, 3, 4, 0, 21], ["+", 0, 652, 3, 4, 0, 652, 3, 4, 0, 22], ["+", 0, 652, 3, 4, 0, 652, 3, 4, 0, 25]]
5
94
S = input() M = 0 count = 0 for i in range(0,3): if S[i] == 'R': count = count + 1 if i == 2: M = count else: M = count count = 0 print(M)
S = input() M = 0 count = 0 for i in range(0,3): if S[i] == 'R': count = count + 1 if i == 2: M = count else: if M < count: M = count count = 0 print(M)
[["+", 0, 57, 75, 76, 8, 196, 0, 57, 0, 121], ["+", 75, 76, 8, 196, 0, 57, 15, 666, 667, 18], ["+", 75, 76, 8, 196, 0, 57, 15, 666, 0, 22], ["+", 0, 57, 75, 76, 8, 196, 0, 57, 0, 102], ["+", 0, 57, 64, 196, 0, 1, 0, 662, 31, 22]]
5
56
#include <bits/stdc++.h> using namespace std; int main() { string a; cin >> a; int sum = 0, res = 0; for (int i = 0; i < a.size() - 1; i++) { if (a[i] == 'R') { while (a[i] == 'R') { sum++; i++; } i--; res = max(res, sum); sum = 0; } } cout << res << end...
#include <bits/stdc++.h> using namespace std; int main() { string a; cin >> a; int sum = 0, res = 0; for (int i = 0; i < a.size(); i++) { if (a[i] == 'R') { while (a[i] == 'R') { sum++; i++; } i--; res = max(res, sum); sum = 0; } } cout << res << endl; ...
[["-", 8, 9, 0, 7, 15, 16, 12, 16, 17, 33], ["-", 8, 9, 0, 7, 15, 16, 12, 16, 12, 13]]
1
107
#include <bits/stdc++.h> using namespace std; int main() { string s; cin >> s; if (find(s.begin(), s.end(), 'R') == s.end()) { cout << 0 << endl; } else if (s.find("RRR") != string::npos) { cout << 3 << endl; } else if (s.find("R") != string::npos) { cout << 2 << endl; } else { cout << 1 <...
#include <bits/stdc++.h> using namespace std; int main() { string s; cin >> s; if (find(s.begin(), s.end(), 'R') == s.end()) { cout << 0 << endl; } else if (s.find("RRR") != string::npos) { cout << 3 << endl; } else if (s.find("RR") != string::npos) { cout << 2 << endl; } else { cout << 1 ...
[["-", 51, 16, 31, 2, 3, 4, 0, 5, 0, 6], ["+", 51, 16, 31, 2, 3, 4, 0, 5, 0, 6]]
1
111
#include <bits/stdc++.h> #define rep(i, n) for (int i = 0; i < n; ++i) using namespace std; using ll = long long; int main() { string s; cin >> s; size_t n; n = s.size(); bool flag = true; int ans = 0; int cnt = 0; rep(i, n) { if (s[i] == 'R') { if (flag == true) cnt++; else ...
#include <bits/stdc++.h> #define rep(i, n) for (int i = 0; i < n; ++i) using namespace std; using ll = long long; int main() { string s; cin >> s; size_t n; n = s.size(); bool flag = true; int ans = 0; int cnt = 0; rep(i, n) { if (s[i] == 'R') { if (flag == true) cnt++; else { ...
[["+", 64, 9, 0, 57, 75, 76, 0, 9, 0, 45], ["+", 75, 76, 0, 9, 0, 1, 0, 27, 28, 22], ["+", 75, 76, 0, 9, 0, 1, 0, 27, 17, 29], ["+", 0, 57, 75, 76, 0, 9, 0, 1, 0, 35], ["+", 64, 9, 0, 57, 75, 76, 0, 9, 0, 46]]
1
142
#include <bits/stdc++.h> using namespace std; int main() { string s; cin >> s; int rainyDays_i = 0; bool isLonging = true; for (int i = 0; i < 3; i++) { if (s.at(i) == 'R') { if (isLonging) { rainyDays_i++; } else { rainyDays_i = 1; } } else { isLonging = fals...
#include <bits/stdc++.h> using namespace std; int main() { string s; cin >> s; int rainyDays_i = 0; bool isLonging = true; for (int i = 0; i < 3; i++) { if (s.at(i) == 'R') { if (isLonging) { rainyDays_i++; } else { rainyDays_i = 1; } isLonging = true; } else ...
[["+", 0, 57, 64, 9, 0, 1, 0, 11, 31, 22], ["+", 0, 57, 64, 9, 0, 1, 0, 11, 17, 32], ["+", 0, 57, 64, 9, 0, 1, 0, 11, 12, 146], ["+", 8, 9, 0, 57, 64, 9, 0, 1, 0, 35]]
1
89
text = input() if text[1] == "S": if text[0] == "R" or text[2] == "R": print(1) else: print(0) else: if text[0] == "R" and text[2] == "R": print(3) elif text[0] == "R" or text[2] == "R": print(2)
text = input() if text[1] == "S": if text[0] == "R" or text[2] == "R": print(1) else: print(0) else: if text[0] == "R" and text[2] == "R": print(3) elif text[0] == "R" or text[2] == "R": print(2) else: print(1)
[["+", 75, 76, 8, 196, 0, 57, 75, 76, 0, 95], ["+", 75, 76, 8, 196, 0, 57, 75, 76, 0, 102], ["+", 75, 76, 8, 196, 0, 1, 0, 652, 63, 22], ["+", 8, 196, 0, 1, 0, 652, 3, 4, 0, 24], ["+", 8, 196, 0, 1, 0, 652, 3, 4, 0, 612], ["+", 8, 196, 0, 1, 0, 652, 3, 4, 0, 25]]
5
92
#include <bits/stdc++.h> #include <iostream> #include <vector> using namespace std; int main() { int count = 0; int temp = 0; vector<char> c(3); for (int a = 0; a < 2; a++) { cin >> c.at(a); } for (int i = 0; i < 2; i++) { if (c.at(i) == 'S') { if (temp <= count) { temp = count; ...
#include <bits/stdc++.h> #include <iostream> #include <vector> using namespace std; int main() { int count = 0; int temp = 0; vector<char> c(3); for (int a = 0; a < 3; a++) { cin >> c.at(a); } for (int i = 0; i < 3; i++) { if (c.at(i) == 'S') { if (temp <= count) { temp = count; ...
[["-", 0, 14, 8, 9, 0, 7, 15, 16, 12, 13], ["+", 0, 14, 8, 9, 0, 7, 15, 16, 12, 13]]
1
149
temp = str(input()) count = 0 for i in temp: if i == 'R': count = count + 1 max_count = count else: if max_count < count: max_count = count count = 0 print(max_count)
temp = str(input()) count = 0 max_count = 0 for i in temp: if i == 'R': count = count + 1 max_count = count else: if max_count < count: max_count = count count = 0 print(max_count)
[["+", 36, 36, 0, 656, 0, 1, 0, 662, 31, 22], ["+", 36, 36, 0, 656, 0, 1, 0, 662, 0, 32], ["+", 36, 36, 0, 656, 0, 1, 0, 662, 12, 612]]
5
48
#include <iostream> using namespace std; int main() { string s; cin >> s; int cnt = 0; for (int i = 0; i < 3; i++) { if (s[i] == 'S') { cnt++; } } if (cnt == 0 || cnt == 3) { cout << cnt << endl; } else if (cnt == 1) { cout << 1 << endl; } else if (cnt == 2) { if (s[0] == 'S' ...
#include <iostream> using namespace std; int main() { string s; cin >> s; int cnt = 0; for (int i = 0; i < 3; i++) { if (s[i] == 'R') { cnt++; } } if (cnt == 0 || cnt == 3) { cout << cnt << endl; } else if (cnt == 1) { cout << 1 << endl; } else if (cnt == 2) { if (s[0] == 'R' ...
[["-", 0, 57, 15, 339, 51, 16, 12, 103, 0, 125], ["+", 0, 57, 15, 339, 51, 16, 12, 103, 0, 125], ["-", 15, 339, 51, 16, 31, 16, 12, 103, 0, 125], ["+", 15, 339, 51, 16, 31, 16, 12, 103, 0, 125], ["-", 15, 339, 51, 16, 12, 16, 12, 103, 0, 125], ["+", 15, 339, 51, 16, 12, 16, 12, 103, 0, 125]]
1
164
S = input() if S.count("RRR") == 1 : print("3") elif S.count("RRR") == 1 : print("2") else : if S.count("R") >= 1 : print("1") else : print("0")
S = input() if S.count("RRR") == 1 : print("3") elif S.count("RR") == 1 : print("2") else : if S.count("R") >= 1 : print("1") else : print("0")
[["-", 15, 666, 0, 652, 3, 4, 0, 557, 0, 6], ["+", 15, 666, 0, 652, 3, 4, 0, 557, 0, 6]]
5
69
#include <bits/stdc++.h> #include <ext/pb_ds/assoc_container.hpp> using namespace __gnu_pbds; using namespace std; typedef long long ll; const int N = 2e5 + 10, OO = 0x3f3f3f3f, mod = 1e9 + 7; #define PI acos(-1) #define clr(arr, val) memset(arr, val, sizeof(arr)) #define loop(i, n) for (int i = 0; i < int(n); i++) #...
#include <bits/stdc++.h> #include <ext/pb_ds/assoc_container.hpp> using namespace __gnu_pbds; using namespace std; typedef long long ll; const int N = 2e5 + 10, OO = 0x3f3f3f3f, mod = 1e9 + 7; #define PI acos(-1) #define clr(arr, val) memset(arr, val, sizeof(arr)) #define loop(i, n) for (int i = 0; i < int(n); i++) #...
[["-", 0, 30, 0, 14, 8, 9, 0, 1, 0, 35], ["-", 8, 9, 0, 57, 75, 76, 0, 9, 0, 46], ["+", 8, 9, 0, 57, 75, 76, 0, 9, 0, 46]]
1
256
/* @uthor: Kashish Gilhotra user: CodeChef, CodeForces, HackerEarth, HackerRank, SPOJ: kashish001 */ #include <bits/stdc++.h> using namespace std; #define int long long int typedef vector<int> vi; typedef vector<pair<int, int>> vpi; typedef vector<vi> vvi; const int mod = 1e9 + 7; #define FAST ...
/* @uthor: Kashish Gilhotra user: CodeChef, CodeForces, HackerEarth, HackerRank, SPOJ: kashish001 */ #include <bits/stdc++.h> using namespace std; #define int long long int typedef vector<int> vi; typedef vector<pair<int, int>> vpi; typedef vector<vi> vvi; const int mod = 1e9 + 7; #define FAST ...
[["-", 0, 14, 8, 9, 0, 43, 49, 50, 51, 13], ["+", 0, 14, 8, 9, 0, 43, 49, 50, 51, 13], ["-", 8, 9, 0, 1, 0, 16, 31, 16, 12, 22], ["+", 8, 9, 0, 1, 0, 16, 31, 16, 12, 22]]
1
181
// Author: Fuadul Hasan(fuadul202@gmail.com) #include <bits/stdc++.h> using namespace std; #define ll long long const int N = 2e5 + 5; int main() { string s; cin >> s; if (s[0] == 'R' and s[1] == 'R' and s[2] == 'R') { cout << 3 << endl; } else if (s[1] != 'R' and s[0] == 'R' or s[2] == 'R') { cout ...
// Author: Fuadul Hasan(fuadul202@gmail.com) #include <bits/stdc++.h> using namespace std; #define ll long long const int N = 2e5 + 5; int main() { string s; cin >> s; if (s[0] == 'R' and s[1] == 'R' and s[2] == 'R') { cout << 3 << endl; } else if (s[1] != 'R' and (s[0] == 'R' or s[2] == 'R')) { cou...
[["+", 0, 57, 15, 339, 51, 16, 12, 23, 0, 24], ["+", 0, 57, 15, 339, 51, 16, 12, 23, 0, 25]]
1
214