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
#include <bits/stdc++.h> #define ll long long int #define fast \ ios_base::sync_with_stdio(false); \ cin.tie(NULL); #define fr(i, a, b) for (long long int i = a; i < b; i++) #define pb push_back #define mp m...
#include <bits/stdc++.h> #define ll long long int #define fast \ ios_base::sync_with_stdio(false); \ cin.tie(NULL); #define fr(i, a, b) for (long long int i = a; i < b; i++) #define pb push_back #define mp m...
[["-", 75, 76, 0, 1, 0, 11, 12, 69, 28, 22], ["-", 0, 1, 0, 11, 12, 69, 341, 342, 0, 70], ["-", 0, 1, 0, 11, 12, 69, 341, 342, 0, 22], ["-", 0, 1, 0, 11, 12, 69, 341, 342, 0, 73], ["+", 0, 57, 75, 76, 0, 1, 0, 11, 12, 13]]
1
150
import sys if __name__ == '__main__': S = sys.stdin.readline().rstrip() if S == 'SSS': print('3') elif 'SS' in S: print('2') elif 'S' in S: print('1') else: print('0')
import sys if __name__ == '__main__': S = sys.stdin.readline().rstrip() if S == 'RRR': print('3') elif 'RR' in S: print('2') elif 'R' in S: print('1') else: print('0')
[["-", 64, 196, 0, 57, 15, 666, 0, 557, 0, 6], ["+", 64, 196, 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
69
#include <bits/stdc++.h> using namespace std; long long mx(long long a, long long b) { if (a > b) return a; else return b; } long long mn(long long a, long long b) { if (a < b) return a; else return b; } long long cei(long long a, long long b) { if (a % b == 0) return a / b; else ret...
#include <bits/stdc++.h> using namespace std; long long mx(long long a, long long b) { if (a > b) return a; else return b; } long long mn(long long a, long long b) { if (a < b) return a; else return b; } long long cei(long long a, long long b) { if (a % b == 0) return a / b; else ret...
[["-", 0, 14, 8, 9, 0, 43, 49, 50, 51, 22], ["+", 0, 14, 8, 9, 0, 43, 49, 50, 51, 13]]
1
226
#include <bits/stdc++.h> using namespace std; int main() { ios_base::sync_with_stdio(false); cin.tie(NULL); string s; int count = 0, max = 0; cin >> s; for (int i = 0; i < s.size() - 1; i++) { count = 0; while (i < s.size() && s[i] == 'R') { count++; i++; } if (count > max) ...
#include <bits/stdc++.h> using namespace std; int main() { ios_base::sync_with_stdio(false); cin.tie(NULL); string s; int count = 0, max = 0; cin >> s; for (int i = 0; i < s.size(); i++) { count = 0; while (i < s.size() && s[i] == 'R') { count++; i++; } if (count > max) max...
[["-", 8, 9, 0, 7, 15, 16, 12, 16, 17, 33], ["-", 8, 9, 0, 7, 15, 16, 12, 16, 12, 13]]
1
114
#include <bits/stdc++.h> using namespace std; typedef long long ll; int main() { int i, j, k, n, r = 0; string s; cin >> s; if (s[0] == 'R') r++; for (i = 1; i < 2; i++) { if (s[i] == 'R') { if (s[i - 1] == 'R') r++; } } cout << r; return 0; }
#include <bits/stdc++.h> using namespace std; typedef long long ll; int main() { int i, j, k, n, r = 0; string s; cin >> s; if (s[0] == 'R') r++; for (i = 1; i < 3; i++) { if (s[i] == 'R') { if (s[i - 1] == 'R') r++; else r = 1; } } cout << r; return 0; }
[["-", 0, 14, 8, 9, 0, 7, 15, 16, 12, 13], ["+", 0, 14, 8, 9, 0, 7, 15, 16, 12, 13], ["+", 0, 57, 64, 9, 0, 57, 64, 1, 0, 35], ["+", 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]]
1
102
#include <iostream> #include <string> using namespace std; int main() { string s; cin >> s; bool flg = false; int cnt = 0; for (int i = 0; i < 3; i++) { if (s[i] == 'R') { if (flg) { cnt++; } else { flg = true; cnt = 1; } } else { flg = false; cnt ...
#include <iostream> #include <string> using namespace std; int main() { string s; cin >> s; bool flg = false; int cnt = 0; for (int i = 0; i < 3; i++) { if (s[i] == 'R') { if (flg) { cnt++; } else { flg = true; cnt = 1; } } else { flg = false; } } ...
[["-", 75, 76, 0, 9, 0, 1, 0, 11, 31, 22], ["-", 75, 76, 0, 9, 0, 1, 0, 11, 17, 32], ["-", 75, 76, 0, 9, 0, 1, 0, 11, 12, 13], ["-", 0, 57, 75, 76, 0, 9, 0, 1, 0, 35]]
1
97
#include <bits/stdc++.h> using namespace std; // TEMPLATE #define pb push_back #define mp make_pair #define ll long long #define ld long double #define pii pair<ll, ll> #define piii pair<ll, pii> #define F first #define S second #define newline printf("\n") #define minusone printf("-1\n") #define zeroo printf("0\n") ...
#include <bits/stdc++.h> using namespace std; // TEMPLATE #define pb push_back #define mp make_pair #define ll long long #define ld long double #define pii pair<ll, ll> #define piii pair<ll, pii> #define F first #define S second #define newline printf("\n") #define minusone printf("-1\n") #define zeroo printf("0\n") ...
[["-", 0, 57, 15, 339, 51, 16, 12, 16, 17, 98], ["+", 75, 76, 0, 57, 15, 339, 51, 16, 17, 106]]
1
536
#include <bits/stdc++.h> using namespace std; int main() { string S; cin >> S; if (S == "RRR") cout << 3 << endl; else if (S == "SSS") cout << 0 << endl; else if (S == "RSS" || S == "SRR") cout << 2 << endl; else cout << 1 << endl; }
#include <bits/stdc++.h> using namespace std; int main() { string S; cin >> S; if (S == "RRR") cout << 3 << endl; else if (S == "SSS") cout << 0 << endl; else if (S == "RRS" || S == "SRR") cout << 2 << endl; else cout << 1 << endl; }
[["-", 15, 339, 51, 16, 31, 16, 12, 5, 0, 6], ["+", 15, 339, 51, 16, 31, 16, 12, 5, 0, 6]]
1
76
package main import "fmt" func main() { var n string fmt.Scan(&n) var ans int var aans int for _, v := range n { if v == 'R' { ans += 1 if aans < ans { aans = ans } } else { ans = 0 } } fmt.Println(ans) }
package main import "fmt" func main() { var n string fmt.Scan(&n) var ans int var aans int for _, v := range n { if v == 'R' { ans += 1 if aans < ans { aans = ans } } else { ans = 0 } } fmt.Println(aans) }
[["-", 8, 196, 0, 1, 0, 2, 3, 4, 0, 22], ["+", 8, 196, 0, 1, 0, 2, 3, 4, 0, 22]]
7
81
#include <bits/stdc++.h> using namespace std; #define pb push_back #define ll long long int // #define mp make_pair #define S second #define F first ll mod = 1e9 + 7; #define fastIO \ ios_base::sync_with_stdio(false); ...
#include <bits/stdc++.h> using namespace std; #define pb push_back #define ll long long int // #define mp make_pair #define S second #define F first ll mod = 1e9 + 7; #define fastIO \ ios_base::sync_with_stdio(false); ...
[["-", 0, 30, 0, 14, 8, 9, 0, 43, 49, 22]]
1
128
S = list(input()) count = 0 ans = 0 for w in S: if w == 'R': count += 1 else: if count > ans: ans = count count = 0 print(ans)
S = list(input()) count = 0 ans = 0 for w in S: if w == 'R': count += 1 else: count = 0 if count > ans: ans = count 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], ["-", 0, 57, 64, 196, 0, 1, 0, 662, 12, 22], ["-", 75, 76, 8, 196, 0, 1, 0, 662, 0, 32], ["-", 75, 76, 8, 196, 0, 1, 0, 662, 12, 612]]
5
46
#include <bits/stdc++.h> using namespace std; #define ll long long #define ar array #define MAX(a, b) ((a) > (b) ? (a) : (b)) #define MIN(a, b) ((a) < (b) ? (a) : (b)) int n, k, tmp; string s; bool compare(const pair<int, bool> &p1, const pair<int, bool> &p2) { return p1.first > p2.first; } void solve() { cin ...
#include <bits/stdc++.h> using namespace std; #define ll long long #define ar array #define MAX(a, b) ((a) > (b) ? (a) : (b)) #define MIN(a, b) ((a) < (b) ? (a) : (b)) int n, k, tmp; string s; bool compare(const pair<int, bool> &p1, const pair<int, bool> &p2) { return p1.first > p2.first; } void solve() { cin ...
[["+", 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, 47], ["+", 0, 9, 0, 57, 15, 339, 51, 16, 12, 22], ["+", 75, 76, 0, 9, 0, 57, 15, 339, 0, 25]]
1
163
#include <bits/stdc++.h> using namespace std; #define ll long long int int main() { string s; cin >> s; vector<ll> v(3, 0); ll maxi = 0; for (int i = 0; i < 3; i++) { if (s[i] == 'R') v[i] = 1; if (i > 0 && v[i] == 'R' && v[i - 1] == 'R') v[i] += v[i - 1]; maxi = max(maxi, v[i]); } ...
#include <bits/stdc++.h> using namespace std; #define ll long long int int main() { string s; cin >> s; vector<ll> v(3, 0); ll maxi = 0; for (int i = 0; i < 3; i++) { if (s[i] == 'R') v[i] = 1; if (i > 0 && s[i] == 'R' && s[i - 1] == 'R') v[i] += v[i - 1]; maxi = max(maxi, v[i]); } ...
[["-", 51, 16, 31, 16, 12, 16, 31, 69, 28, 22], ["+", 51, 16, 31, 16, 12, 16, 31, 69, 28, 22], ["-", 15, 339, 51, 16, 12, 16, 31, 69, 28, 22], ["+", 15, 339, 51, 16, 12, 16, 31, 69, 28, 22]]
1
128
s = str(input()) ans = 0 if(s[0]=="R"): if(s[1]=="R"): if(s[2]=="R"): ans = 3 else: ans = 1 else: if(s[1]=="R"): if(s[2]=="R"): ans = 2 else: ans = 1 else: if(s[2]=="R"): ans = 1 else: ans = 0 print(ans)
s = str(input()) ans = 0 if(s[0]=="R"): if(s[1]=="R"): if(s[2]=="R"): ans = 3 else: ans = 2 else: ans = 1 else: if(s[1]=="R"): if(s[2]=="R"): ans = 2 else: ans = 1 else: if(s[2]=="R"): ans = 1 else: ans = 0 print(ans)
[["+", 75, 76, 8, 196, 0, 1, 0, 662, 12, 612], ["+", 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]]
5
115
#include <bits/stdc++.h> using namespace std; #define ALL(x) (x).begin(), (x).end() #define COUT(x) cout << (x) << "\n" #define IOS \ ios::sync_with_stdio(0); \ cin.tie(0); ...
#include <bits/stdc++.h> using namespace std; #define ALL(x) (x).begin(), (x).end() #define COUT(x) cout << (x) << "\n" #define IOS \ ios::sync_with_stdio(0); \ cin.tie(0); ...
[["-", 75, 76, 0, 9, 0, 1, 0, 11, 31, 22], ["-", 75, 76, 0, 9, 0, 1, 0, 11, 17, 32], ["-", 75, 76, 0, 9, 0, 1, 0, 11, 12, 22], ["-", 0, 57, 75, 76, 0, 9, 0, 1, 0, 35]]
1
311
#include <bits/stdc++.h> using namespace std; int main() { string s; int C = 0; cin >> s; for (int i = 0; i < 3; i++) { if (s.at(i) == 'R') { C++; } } string SS = "SRS"; if (C == 2 && s == SS) { C = 1; } cout << C << endl; }
#include <bits/stdc++.h> using namespace std; int main() { string s; int C = 0; cin >> s; for (int i = 0; i < 3; i++) { if (s.at(i) == 'R') { C++; } } string SS = "RSR"; if (C == 2 && s == SS) { C = 1; } cout << C << endl; }
[["-", 8, 9, 0, 43, 49, 50, 51, 5, 0, 6], ["+", 8, 9, 0, 43, 49, 50, 51, 5, 0, 6]]
1
87
#include <bits/stdc++.h> using namespace std; int main() { string s; int res = 0, best = 0; cin >> s; for (char c : s) { if (c == 'R') { res++; } else { best = max(best, res); res = 0; } } cout << best; }
#include <bits/stdc++.h> using namespace std; int main() { string s; int res = 0, best = 0; cin >> s; for (char c : s) { if (c == 'R') { res++; } else { best = max(best, res); res = 0; } } cout << max(res, best); }
[["+", 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, 22], ["+", 0, 1, 0, 16, 12, 2, 3, 4, 0, 21], ["+", 0, 1, 0, 16, 12, 2, 3, 4, 0, 25]]
1
70
#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; int ans = 0; int state = 1; rep(i, 3) { if (s[i] == 'R') { if (state == 1) { ans++; } state = 1; } else { state = 0; ...
#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; int ans = 0; int state = 1; rep(i, 3) { if (s[i] == 'R') { if (ans == 0 || state == 1) { ans++; } state = 1; } else { s...
[["+", 0, 57, 15, 339, 51, 16, 31, 16, 31, 22], ["+", 0, 57, 15, 339, 51, 16, 31, 16, 17, 60], ["+", 0, 57, 15, 339, 51, 16, 31, 16, 12, 13], ["+", 64, 9, 0, 57, 15, 339, 51, 16, 17, 106]]
1
96
S = list(input()) cnt = 0 if S[0]=="R": cnt = 1 if S[1]=="R": cnt += 1 if S[2]=="R": cnt += 1 else: if S[2]=="R": cnt += 1 print (cnt)
S = list(input()) cnt = 0 if S[0]=="R": cnt = 1 if S[1]=="R": cnt += 1 if S[2]=="R": cnt += 1 else: if S[2]=="R": cnt = 1 print (cnt)
[["-", 0, 57, 64, 196, 0, 1, 0, 677, 17, 107], ["+", 0, 57, 64, 196, 0, 1, 0, 662, 0, 32]]
5
69
a = input() c = 0 ans = 0 for s in a: if s == 'S': c += 1 else: c = 0 ans = max(ans,c) print(ans)
a = input() c = 0 ans = 0 for s in a: if s == 'R': c += 1 else: c = 0 ans = max(ans,c) print(ans)
[["-", 8, 196, 0, 57, 15, 666, 0, 557, 0, 6], ["+", 8, 196, 0, 57, 15, 666, 0, 557, 0, 6]]
5
43
#include <algorithm> #include <bitset> #include <cstdlib> #include <iomanip> #include <iostream> #include <map> #include <math.h> #include <string> #include <vector> #define db double #define vi vector<int> #define pb push_back #define fi first #define se second #define ll long long #define ld long double #define maxn...
#include <algorithm> #include <bitset> #include <cstdlib> #include <iomanip> #include <iostream> #include <map> #include <math.h> #include <string> #include <vector> #define db double #define vi vector<int> #define pb push_back #define fi first #define se second #define ll long long #define ld long double #define maxn...
[["-", 64, 9, 0, 1, 0, 16, 31, 16, 12, 13], ["+", 64, 9, 0, 1, 0, 16, 31, 16, 12, 13]]
1
308
s=input() arr=[] for i in s: arr.append(i) brr=[] count=0 for i in arr: if(i=='S'): brr.append(count) if(i=='R'): count=count+1 brr.append(count) print(max(brr))
s=input() arr=[] for i in s: arr.append(i) brr=[] count=0 for i in arr: if(i=='S'): brr.append(count) count=0 if(i=='R'): count=count+1 brr.append(count) print(max(brr))
[["+", 0, 57, 64, 196, 0, 1, 0, 662, 31, 22], ["+", 0, 57, 64, 196, 0, 1, 0, 662, 0, 32], ["+", 0, 57, 64, 196, 0, 1, 0, 662, 12, 612]]
5
74
#include <iostream> #include <string> using namespace std; int main() { string a; cin >> a; if (a[0] == 'S') { if (a[1] == 'S') { if (a[2] == 'S') { cout << 3 << endl; } else { cout << 2 << endl; } } else { cout << 1 << endl; } } else { if (a[1] == 'S') {...
#include <iostream> #include <string> using namespace std; int main() { string a; cin >> a; if (a[0] == 'R') { if (a[1] == 'R') { if (a[2] == 'R') { cout << 3 << endl; } else { cout << 2 << endl; } } else { cout << 1 << endl; } } else { if (a[1] == 'R') {...
[["-", 0, 57, 15, 339, 51, 16, 12, 103, 0, 125], ["+", 0, 57, 15, 339, 51, 16, 12, 103, 0, 125]]
1
162
#include <iostream> using namespace std; int main(void) { string str; cin >> str; if (str.find("SSS") != -1) { cout << 3 << endl; } else if (str.find("SS") != -1) { cout << 2 << endl; } else if (str.find("S") != -1) { cout << 1 << endl; } else { cout << 0 << endl; } return 0; }
#include <iostream> using namespace std; int main(void) { string str; cin >> str; if (str.find("RRR") != -1) { cout << 3 << endl; } else if (str.find("RR") != -1) { cout << 2 << endl; } else if (str.find("R") != -1) { cout << 1 << endl; } else { cout << 0 << endl; } return 0; }
[["-", 51, 16, 31, 2, 3, 4, 0, 5, 0, 6], ["+", 51, 16, 31, 2, 3, 4, 0, 5, 0, 6]]
1
97
S = input() counts = [0] if "R" in S: counts.appned(1) if "RR" in S: counts.append(2) if "RRR" in S: counts.append(3) print(max(counts))
S = input() counts = [0] if "R" in S: counts.append(1) if "RR" in S: counts.append(2) if "RRR" in S: counts.append(3) print(max(counts))
[["-", 64, 196, 0, 1, 0, 652, 63, 319, 319, 22], ["+", 64, 196, 0, 1, 0, 652, 63, 319, 319, 22]]
5
56
#include <algorithm> #include <cassert> #include <complex> #include <functional> #include <iomanip> #include <iostream> #include <map> #include <math.h> #include <queue> #include <set> #include <string.h> #include <string> #include <unordered_map> #include <utility> #include <vector> using namespace std; typedef long l...
#include <algorithm> #include <cassert> #include <complex> #include <functional> #include <iomanip> #include <iostream> #include <map> #include <math.h> #include <queue> #include <set> #include <string.h> #include <string> #include <unordered_map> #include <utility> #include <vector> using namespace std; typedef long l...
[["-", 0, 57, 75, 76, 0, 1, 0, 16, 17, 60], ["+", 0, 57, 75, 76, 0, 1, 0, 11, 17, 32]]
1
138
// ★★ ASHWINI SHARMA ★★ #include <bits/stdc++.h> using namespace std; #define fastio \ ios_base::sync_with_stdio(false); \ cin.tie(NULL); #define fr(i, a, b) for (int i = (a), _b = (b); i <= _b; i++)...
// ★★ ASHWINI SHARMA ★★ #include <bits/stdc++.h> using namespace std; #define fastio \ ios_base::sync_with_stdio(false); \ cin.tie(NULL); #define fr(i, a, b) for (int i = (a), _b = (b); i <= _b; i++)...
[["-", 8, 9, 0, 1, 0, 2, 3, 4, 0, 13], ["+", 8, 9, 0, 1, 0, 2, 3, 4, 0, 13], ["-", 64, 9, 0, 57, 64, 1, 0, 16, 12, 13], ["+", 64, 9, 0, 57, 64, 1, 0, 16, 12, 13], ["-", 0, 57, 75, 76, 0, 1, 0, 16, 12, 13], ["+", 0, 57, 75, 76, 0, 1, 0, 16, 12, 13]]
1
286
S=input() ans=0 temp=0 for i in range(3): if S[i]=="R": temp+=1 else: ans=temp temp=0 if ans<temp: ans=temp print(ans)
S=input() ans=0 temp=0 for i in range(3): if S[i]=="R": temp+=1 else: if ans<temp: ans=temp temp=0 if ans<temp: ans=temp print(ans)
[["+", 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
52
#include <bits/stdc++.h> #include <ext/pb_ds/assoc_container.hpp> #include <ext/pb_ds/tree_policy.hpp> //#include <boost/multiprecision/cpp_int.hpp> // // using namespace boost::multiprecision; using namespace __gnu_pbds; using namespace std; typedef tree<int, null_type, less_equal<int>, rb_tree_tag, tree_...
#include <bits/stdc++.h> #include <ext/pb_ds/assoc_container.hpp> #include <ext/pb_ds/tree_policy.hpp> //#include <boost/multiprecision/cpp_int.hpp> // // using namespace boost::multiprecision; using namespace __gnu_pbds; using namespace std; typedef tree<int, null_type, less_equal<int>, rb_tree_tag, tree_...
[["-", 8, 9, 0, 43, 49, 50, 51, 91, 17, 33], ["-", 8, 9, 0, 43, 49, 50, 51, 91, 28, 22], ["+", 0, 14, 8, 9, 0, 43, 49, 50, 51, 13]]
1
844
import java.util.*; public class Main { public static void main(String args[]) { Scanner scan = new Scanner(System.in); String s = scan.next(); char a = s.charAt(0); char b = s.charAt(1); char c = s.charAt(2); if (a == 'R') { if (b == 'R') { if (c == 'R') { System...
import java.util.*; public class Main { public static void main(String args[]) { Scanner scan = new Scanner(System.in); String s = scan.next(); char a = s.charAt(0); char b = s.charAt(1); char c = s.charAt(2); if (a == 'R') { if (b == 'R') { if (c == 'R') { System...
[["-", 75, 196, 0, 1, 0, 492, 3, 4, 0, 499], ["+", 75, 196, 0, 1, 0, 492, 3, 4, 0, 499]]
3
203
#include <bits/stdc++.h> #define rep(i, n) for (int i = 0; i < (n); i++) using namespace std; using P = pair<int, int>; using ll = long long; int main() { string s; cin >> s; int ans = 0; rep(i, 3) { if (s[i] == 'R') ans++; } if (s[1] == 'S') ans = 1; cout << ans << endl; }
#include <bits/stdc++.h> #define rep(i, n) for (int i = 0; i < (n); i++) using namespace std; using P = pair<int, int>; using ll = long long; int main() { string s; cin >> s; int ans = 0; rep(i, 3) { if (s[i] == 'R') ans++; } if (s[1] == 'S' && ans > 1) ans = 1; cout << ans << endl; }
[["+", 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, 47], ["+", 0, 57, 15, 339, 51, 16, 12, 16, 12, 13]]
1
92
#include <bits/stdc++.h> using namespace std; #define rep(i, n) for (int i = 0; i < (n); i++) typedef long long ll; #define REP(i, n) for (ll i = 0; i < (ll)(n); i++) #define REPD(i, n) for (ll i = n - 1; i >= 0; i--) #define FOR(i, a, b) for (ll i = a; i <= (ll)(b); i++) #define FORD(i, a, b) for (ll i = a; i >= (l...
#include <bits/stdc++.h> using namespace std; #define rep(i, n) for (int i = 0; i < (n); i++) typedef long long ll; #define REP(i, n) for (ll i = 0; i < (ll)(n); i++) #define REPD(i, n) for (ll i = n - 1; i >= 0; i--) #define FOR(i, a, b) for (ll i = a; i <= (ll)(b); i++) #define FORD(i, a, b) for (ll i = a; i >= (l...
[["-", 0, 14, 8, 9, 0, 1, 0, 16, 17, 60], ["+", 0, 14, 8, 9, 0, 1, 0, 11, 17, 32]]
1
154
import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); String record = sc.next(); sc.close(); int result = 0; if (record.indexOf("R") > 0) { result = 1; } if (record.indexOf("RR") > 0) { result = 2; } ...
import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); String record = sc.next(); sc.close(); int result = 0; if (record.indexOf("R") > -1) { result = 1; } if (record.indexOf("RR") > -1) { result = 2; }...
[["-", 8, 196, 0, 57, 15, 15, 0, 16, 12, 499], ["+", 0, 57, 15, 15, 0, 16, 12, 91, 17, 33], ["+", 0, 57, 15, 15, 0, 16, 12, 91, 439, 499]]
3
121
S = input() if S == 'RSR': renzoku = 2 else: renzoku = 0 for si in S: if si == 'R': renzoku += 1 print(renzoku)
S = input() if S == 'RSR': renzoku = 1 else: renzoku = 0 for si in S: if si == 'R': renzoku += 1 print(renzoku)
[["-", 0, 57, 64, 196, 0, 1, 0, 662, 12, 612], ["+", 0, 57, 64, 196, 0, 1, 0, 662, 12, 612]]
5
39
#include <bits/stdc++.h> using namespace std; int main() { int a = 0; string b; cin >> b; if (b == "SSS") cout << "0" << endl; else if (b == "SSR" || b == "RSS") cout << "1" << endl; else if (b == "RRR") cout << "3" << endl; else cout << "2" << endl; }
#include <bits/stdc++.h> using namespace std; int main() { int a = 0; string b; cin >> b; if (b == "SSS") cout << "0" << endl; else if (b == "RRS" || b == "SRR") cout << "2" << endl; else if (b == "RRR") cout << "3" << endl; else cout << "1" << endl; }
[["-", 15, 339, 51, 16, 31, 16, 12, 5, 0, 6], ["+", 15, 339, 51, 16, 31, 16, 12, 5, 0, 6], ["-", 15, 339, 51, 16, 12, 16, 12, 5, 0, 6], ["+", 15, 339, 51, 16, 12, 16, 12, 5, 0, 6], ["-", 64, 1, 0, 16, 31, 16, 12, 5, 0, 6], ["+", 64, 1, 0, 16, 31, 16, 12, 5, 0, 6], ["-", 0, 1, 0, 16, 31, 16, 12, 5, 0, 6], ["+", 0, 1, 0,...
1
89
#include <math.h> #include <stdio.h> int main(void) { int n = 0, result = 0; char s[3]; scanf("%s", &s); if (s[0] == 'R') { n++; result = 1; } else { n = 0; } if (s[1] == 'R') { n++; if (n == 2) { result = 2; } } else { n = 0; } if (s[2] == 'R') { n++; } els...
#include <math.h> #include <stdio.h> int main(void) { int n = 0, result = 0; char s[3]; scanf("%s", &s); if (s[0] == 'R') { n++; result = 1; } else { n = 0; } if (s[1] == 'R') { n++; result = 1; if (n == 2) { result = 2; } } else { n = 0; } if (s[2] == 'R') { ...
[["+", 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]]
0
155
#include <bits/stdc++.h> using namespace std; typedef long long ll; #define pb push_back #define eb emplace_back const int MAX = 1000000; int main() { ll t; t = 0; while (t--) { string str; cin >> str; ll cnt = 0, ans = 0; for (ll i = 0; str[i]; i++) { if (str[i] == 'R') cnt++...
#include <bits/stdc++.h> using namespace std; typedef long long ll; #define pb push_back #define eb emplace_back const int MAX = 1000000; int main() { ll t; t = 1; while (t--) { string str; cin >> str; ll cnt = 0, ans = 0; for (ll i = 0; str[i]; i++) { if (str[i] == 'R') cnt++...
[["-", 0, 14, 8, 9, 0, 1, 0, 11, 12, 13], ["+", 0, 14, 8, 9, 0, 1, 0, 11, 12, 13]]
1
121
s = input() Rnum=s.count('R') ans=0 if Rnum==3: ans=3 elif Rnum==0: ans=0 elif Rnum==2 and s!='RSR': ans=2 elif Rnum==1: ans=1 print(ans)
s = input() Rnum=s.count('R') ans=1 if Rnum==3: ans=3 elif Rnum==0: ans=0 elif Rnum==2 and s!='RSR': ans=2 elif Rnum==1: ans=1 print(ans)
[["-", 36, 36, 0, 656, 0, 1, 0, 662, 12, 612], ["+", 36, 36, 0, 656, 0, 1, 0, 662, 12, 612]]
5
60
import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); String s = sc.next(); int max = 0; int count = 0; for (int i = 0; i < 3; i++) { if (s.charAt(i) == 'S') { count = 0; } else if (s.charAt(i) == 'R') { ...
import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); String s = sc.next(); int max = 0; int count = 0; for (int i = 0; i < 3; i++) { if (s.charAt(i) == 'S') { count = 0; } else if (s.charAt(i) == 'R') { ...
[["-", 8, 196, 0, 1, 0, 492, 3, 4, 0, 22], ["+", 8, 196, 0, 1, 0, 492, 3, 4, 0, 22]]
3
125
s = gets.chomp.split("") max = 0 cnt = 0 for i in 0..2 if s[i] == "S" cnt += 1 else max = [cnt,max].max cnt = 0 end end max = [cnt,max].max puts max
s = gets.chomp.split("") max = 0 cnt = 0 for i in 0..2 if s[i] == "R" cnt += 1 else max = [cnt,max].max cnt = 0 end end max = [cnt,max].max puts max
[["-", 8, 170, 0, 121, 15, 738, 12, 557, 0, 6], ["+", 8, 170, 0, 121, 15, 738, 12, 557, 0, 6]]
4
61
import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); String line = sc.nextLine(); if (line.equals("RRR")) { System.out.println(3); } else if (line.equals("SSS")) { System.out.println(0); } else if (line.equals("R...
import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); String line = sc.nextLine(); if (line.equals("RRR")) { System.out.println(3); } else if (line.equals("SSS")) { System.out.println(0); } else if (line.equals("R...
[["-", 0, 16, 12, 492, 3, 4, 0, 5, 0, 491], ["+", 0, 16, 12, 492, 3, 4, 0, 5, 0, 491]]
3
133
import sys input = sys.stdin.readline S=input().strip() if not ("R" in S): print(0) elif S[1]!="R": print(1) else: A=1 if S[0]=="R": A+=1 elif S[2]=="R": A+=1 print(A)
import sys input = sys.stdin.readline S=input().strip() if not ("R" in S): print(0) elif S[1]!="R": print(1) else: A=1 if S[0]=="R": A+=1 if S[2]=="R": A+=1 print(A)
[["-", 75, 76, 8, 196, 0, 57, 75, 665, 0, 683], ["+", 0, 57, 75, 76, 8, 196, 0, 57, 0, 121]]
5
81
#include <bits/stdc++.h> using namespace std; #define ll long long #define pb push_back #define vi vector<int> #define vll vector<ll> #define vvll vector<vll> #define vvi vector<vector<int>> #define vvb vector<vector<bool>> #define vb vector<bool> #define pii pair<int, int> #define vpli vector<pair<long long, int>> #d...
#include <bits/stdc++.h> using namespace std; #define ll long long #define pb push_back #define vi vector<int> #define vll vector<ll> #define vvll vector<vll> #define vvi vector<vector<int>> #define vvb vector<vector<bool>> #define vb vector<bool> #define pii pair<int, int> #define vpli vector<pair<long long, int>> #d...
[["-", 0, 14, 8, 9, 0, 7, 26, 27, 28, 22], ["-", 0, 14, 8, 9, 0, 7, 26, 27, 17, 29]]
1
285
import java.util.*; class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); String S = sc.next(); int c = 0; if (S.equals("RRR")) { c = 3; } else if (S.equals("RRS") || S.equals("SRR")) { c = 3; } else if (S.equals("SSS")) { c = 0; } e...
import java.util.*; class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); String S = sc.next(); int c = 0; if (S.equals("RRR")) { c = 3; } else if (S.equals("RRS") || S.equals("SRR")) { c = 2; } else if (S.equals("SSS")) { c = 0; } e...
[["-", 75, 57, 64, 196, 0, 1, 0, 11, 12, 499], ["+", 75, 57, 64, 196, 0, 1, 0, 11, 12, 499]]
3
126
S = input() if S == "RRR": print(0) elif S == "SSS": print(3) elif S == "SSR" or S == "RSS": print(2) else: print(1)
S = input() if S == "RRR": print(3) elif S == "SSS": print(0) elif S == "SRR" or S == "RRS": print(2) else: print(1)
[["-", 64, 196, 0, 1, 0, 652, 3, 4, 0, 612], ["+", 64, 196, 0, 1, 0, 652, 3, 4, 0, 612], ["-", 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
50
def main(): S = input() ans = 0 if S == "RRR": ans = 3 elif S == "RRS" or S == "SSR": ans = 2 else: if S.count("R") != 0: ans = 1 print(ans) if __name__ == "__main__": main()
def main(): S = input() ans = 0 if S == "RRR": ans = 3 elif S == "RRS" or S == "SRR": ans = 2 else: if S.count("R") != 0: ans = 1 print(ans) if __name__ == "__main__": main()
[["-", 75, 665, 15, 679, 12, 666, 0, 557, 0, 6], ["+", 75, 665, 15, 679, 12, 666, 0, 557, 0, 6]]
5
70
s=input() a=s.count('R') if a==0: print(a) elif s[1]=='S': print(a-1) else: print(a)
s=input() a=s.count('R') if a==0: print(a) elif s[1]=='S' and a==2: print(a-1) else: print(a)
[["+", 0, 656, 0, 57, 75, 665, 15, 679, 17, 355], ["+", 0, 57, 75, 665, 15, 679, 12, 666, 0, 22], ["+", 0, 57, 75, 665, 15, 679, 12, 666, 667, 60], ["+", 0, 57, 75, 665, 15, 679, 12, 666, 0, 612]]
5
46
// #include <bits/stdc++.h> using namespace std; #define PB push_back #define f first #define s second #define what_is(x) cerr << #x << " is " << x << endl; typedef long long ll; typedef pair<ll, ll> pll; typedef pair<int, int> pii; const int INF = 1000000007; const ll MOD = 1000000007; int main() { ios_base::sy...
// #include <bits/stdc++.h> using namespace std; #define PB push_back #define f first #define s second #define what_is(x) cerr << #x << " is " << x << endl; typedef long long ll; typedef pair<ll, ll> pll; typedef pair<int, int> pii; const int INF = 1000000007; const ll MOD = 1000000007; int main() { ios_base::sy...
[["-", 0, 11, 12, 2, 3, 4, 0, 16, 17, 72], ["-", 0, 11, 12, 2, 3, 4, 0, 16, 12, 13]]
1
168
s = input() if s[1] == 'S': if 'R' in s: print(1) else: print(0) else: if s[0] == 'R' or s[2] == 'R': if 'S' in s: print(2) else: print(3)
s = input() if s[1] == 'S': if 'R' in s: print(1) else: print(0) else: if s[0] == 'R' or s[2] == 'R': if 'S' in s: print(2) else: print(3) 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
70
#include <algorithm> #include <cmath> #include <iostream> #include <map> #include <queue> #include <set> #include <stdio.h> #include <vector> #define N 100010 #define ff first #define ss second #define ll long long #define pb push_back #define mod 1000000007 #define pii pair<ll, ll> using namespace std; string s; i...
#include <algorithm> #include <cmath> #include <iostream> #include <map> #include <queue> #include <set> #include <stdio.h> #include <vector> #define N 100010 #define ff first #define ss second #define ll long long #define pb push_back #define mod 1000000007 #define pii pair<ll, ll> using namespace std; string s; i...
[["+", 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
117
#include <bits/stdc++.h> using namespace std; int main() { string s; cin >> s; if (s == "RRR") cout << 3 << endl; if (s == "SSS") cout << 0 << endl; if (s == "RRS" || s == "SRR") cout << 2 << endl; else cout << 1 << endl; return 0; }
#include <bits/stdc++.h> using namespace std; int main() { string s; cin >> s; if (s == "RRR") cout << 3 << endl; else if (s == "SSS") cout << 0 << endl; else if (s == "RRS" || s == "SRR") cout << 2 << endl; else cout << 1 << endl; return 0; }
[["+", 0, 14, 8, 9, 0, 57, 75, 76, 0, 95], ["+", 0, 57, 75, 76, 0, 57, 75, 76, 0, 95]]
1
77
#include "algorithm" #include "cmath" #include "cstdio" #include "cstring" #include "iostream" #include "queue" #include "stack" using namespace std; #define read(x) scanf("%d", &x) #define readl(x) scanf("%lld", &x) #define ll long long #define ull unsigned long long #define MAXN 1000005 char c[5]; int main() { f...
#include "algorithm" #include "cmath" #include "cstdio" #include "cstring" #include "iostream" #include "queue" #include "stack" using namespace std; #define read(x) scanf("%d", &x) #define readl(x) scanf("%lld", &x) #define ll long long #define ull unsigned long long #define MAXN 1000005 char c[5]; int main() { f...
[["+", 0, 7, 8, 57, 64, 9, 0, 93, 0, 94], ["+", 0, 7, 8, 57, 64, 9, 0, 93, 0, 35]]
1
247
/* https://codeforces.com/contest/1360/problem/H */ #include <bits/stdc++.h> using namespace std; using ll = long long; using vs = vector<string>; using vi = vector<int>; using vl = vector<ll>; using vb = vector<bool>; using pi = pair<int, int>; using pl = pair<ll, ll>; using vpi = vector<pair<int, int>>; using vpl = ...
/* https://codeforces.com/contest/1360/problem/H */ #include <bits/stdc++.h> using namespace std; using ll = long long; using vs = vector<string>; using vi = vector<int>; using vl = vector<ll>; using vb = vector<bool>; using pi = pair<int, int>; using pl = pair<ll, ll>; using vpi = vector<pair<int, int>>; using vpl = ...
[["-", 31, 16, 31, 16, 31, 69, 341, 342, 0, 13], ["+", 31, 16, 31, 16, 31, 69, 341, 342, 0, 13]]
1
322
#include <bits/stdc++.h> #include <iostream> using namespace std; int main() { string s; cin >> s; int ans = 0, ans1 = 0; for (int i = 0; i < 3; i++) { if (s[i] == 'R') ans1++; else { ans = max(ans, ans1); ans = 0; } } ans = max(ans, ans1); cout << ans; return 0; }
#include <bits/stdc++.h> #include <iostream> using namespace std; int main() { string s; cin >> s; int ans = 0, ans1 = 0; for (int i = 0; i < 3; i++) { if (s[i] == 'R') ans1++; else { ans = max(ans, ans1); ans1 = 0; } } ans = max(ans, ans1); cout << ans; return 0; }
[["-", 75, 76, 0, 9, 0, 1, 0, 11, 31, 22], ["+", 75, 76, 0, 9, 0, 1, 0, 11, 31, 22]]
1
92
def resolve(): s = list(input()) cnt = 0 m_cnt = 0 for c in s: if c == 'R': cnt += 1 else: if cnt > m_cnt: m_cnt = cnt cnt = 0 print(m_cnt) resolve()
def resolve(): s = list(input()) cnt = 0 m_cnt = 0 for c in s: if c == 'R': cnt += 1 if cnt > m_cnt: m_cnt = cnt else: cnt = 0 print(m_cnt) resolve()
[["-", 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
54
S = input() ans = 0 r = 0 for c in S: if c == 'R': r += 1 else: ans = max(ans, r) r = 0 print(ans)
S = input() ans = 0 r = 0 for c in S: if c == 'R': r += 1 ans = r else: ans = max(ans, r) r = 0 print(ans)
[["+", 0, 57, 64, 196, 0, 1, 0, 662, 31, 22], ["+", 0, 57, 64, 196, 0, 1, 0, 662, 0, 32], ["+", 0, 57, 64, 196, 0, 1, 0, 662, 12, 22]]
5
43
#include <bits/stdc++.h> using namespace std; int main() { string s; int n, i, ans = 0, sum = 0; cin >> s; n = 3; for (i = 0; i < n; i++) { if (s[i] == 'R') { sum++; if (sum > ans) ans = sum; } else { sum = 0; } } cout << sum; return 0; }
#include <bits/stdc++.h> using namespace std; int main() { string s; int n, i, ans = 0, sum = 0; cin >> s; n = 3; for (i = 0; i < n; i++) { if (s[i] == 'R') { sum++; if (sum > ans) ans = sum; } else { sum = 0; } } cout << ans; return 0; }
[["-", 0, 14, 8, 9, 0, 1, 0, 16, 12, 22], ["+", 0, 14, 8, 9, 0, 1, 0, 16, 12, 22]]
1
91
""" Satwik_Tiwari ;) . 14th AUGUST , 2020 - FRIDAY """ #=============================================================================================== #importing some useful libraries. from __future__ import division, print_function from fractions import Fraction import sys import os from io import BytesIO,...
""" Satwik_Tiwari ;) . 14th AUGUST , 2020 - FRIDAY """ #=============================================================================================== #importing some useful libraries. from __future__ import division, print_function from fractions import Fraction import sys import os from io import BytesIO,...
[["-", 8, 196, 0, 7, 12, 652, 3, 4, 0, 612], ["+", 8, 196, 0, 7, 12, 652, 3, 4, 0, 612]]
5
1,241
#include <iostream> #include <string> using namespace std; int main() { string s; cin >> s; if (s == "RRR") cout << 3; else if (s == "RRS") cout << 2; else if (s == "SRR") cout << 2; else if (s == "RRR") cout << 0; else cout << 1; }
#include <iostream> #include <string> using namespace std; int main() { string s; cin >> s; if (s == "RRR") cout << 3; else if (s == "RRS") cout << 2; else if (s == "SRR") cout << 2; else if (s == "SSS") cout << 0; else cout << 1; }
[["-", 0, 57, 15, 339, 51, 16, 12, 5, 0, 6], ["+", 0, 57, 15, 339, 51, 16, 12, 5, 0, 6]]
1
77
#include <bits/stdc++.h> using namespace std; #define ll long long #define pb push_back #define sz size() #define S second #define F first #define all(x) x.begin(), x.end() typedef pair<int, int> pii; typedef vector<int> vi; typedef vector<vector<int>> vvi; void solve() { string s; cin >> s; int cnt = 0; if...
#include <bits/stdc++.h> using namespace std; #define ll long long #define pb push_back #define sz size() #define S second #define F first #define all(x) x.begin(), x.end() typedef pair<int, int> pii; typedef vector<int> vi; typedef vector<vector<int>> vvi; void solve() { string s; cin >> s; int cnt = 0; if...
[["-", 64, 9, 0, 1, 0, 11, 12, 2, 63, 22], ["+", 64, 9, 0, 1, 0, 11, 12, 2, 63, 22]]
1
166
#include <bits/stdc++.h> using namespace std; int main() { string S; cin >> S; if (S == "RRR") { cout << 3 << endl; } if (S == "SSS") { cout << 0 << endl; } if (S == "RRS" || S == "SRR") { cout << 2 << endl; } else { cout << 1 << endl; } }
#include <bits/stdc++.h> using namespace std; int main() { string S; cin >> S; if (S == "RRR") { cout << 3 << endl; } else if (S == "SSS") { cout << 0 << endl; } else if (S == "RRS" || S == "SRR") { cout << 2 << endl; } else { cout << 1 << endl; } }
[["+", 0, 14, 8, 9, 0, 57, 75, 76, 0, 95], ["+", 0, 57, 75, 76, 0, 57, 75, 76, 0, 95]]
1
82
s = str(input()) count = [] x = 0 for i in range(len(s)): if s[i] == "R": x += 1 if s[i] == len(s)-1: count.append(x) if s[i] == "S": count.append(x) x = 0 print(max(count))
s = str(input()) count = [] x = 0 for i in range(len(s)): if s[i] == "R": x += 1 if i == len(s)-1: count.append(x) if s[i] == "S": count.append(x) x = 0 print(max(count))
[["-", 64, 196, 0, 57, 15, 666, 0, 206, 51, 22], ["-", 64, 196, 0, 57, 15, 666, 0, 206, 0, 70], ["-", 64, 196, 0, 57, 15, 666, 0, 206, 0, 73]]
5
84
#include <bits/stdc++.h> using namespace std; using ll = long long; int main() { ios_base::sync_with_stdio(0); cin.tie(0); string s; cin >> s; int ans = 0; if (s[0] == 'R' && s[1] == 'R' && s[2] == 'R') cout << "3\n"; else if ((s[0] == 'R' && s[1] == 'R') || (s[1] == 'R' && s[2] == 'R')) cout << "...
#include <bits/stdc++.h> using namespace std; using ll = long long; int main() { ios_base::sync_with_stdio(0); cin.tie(0); string s; cin >> s; int ans = 0; if (s[0] == 'R' && s[1] == 'R' && s[2] == 'R') cout << "3\n"; else if ((s[0] == 'R' && s[1] == 'R') || (s[1] == 'R' && s[2] == 'R')) cout << "...
[["-", 0, 57, 15, 339, 51, 16, 12, 16, 17, 98], ["+", 75, 76, 0, 57, 15, 339, 51, 16, 17, 106]]
1
175
#include <bits/stdc++.h> using namespace std; #define int long long const int N = 1e5 + 5; signed main() { string s; cin >> s; int sum = 0; int maxn = -1; for (int i = 0; i < s.size(); i++) { if (s[i] == 'R') sum++, maxn = max(sum, maxn); else sum = 0; } cout << maxn << "\n"; }
#include <bits/stdc++.h> using namespace std; #define int long long const int N = 1e5 + 5; signed main() { string s; cin >> s; int sum = 0; int maxn = 0; for (int i = 0; i < s.size(); i++) { if (s[i] == 'R') sum++, maxn = max(sum, maxn); else sum = 0; } cout << maxn << "\n"; }
[["-", 0, 14, 8, 9, 0, 43, 49, 50, 51, 13], ["+", 0, 14, 8, 9, 0, 43, 49, 50, 51, 13]]
1
96
S = input() cnt = 0 max_c = 0 for s in S: if s == 'R': cnt += 1 max_c = max(cnt,max_c) else: cnt = 0 print(cnt)
S = input() cnt = 0 max_c = 0 for s in S: if s == 'R': cnt += 1 max_c = max(cnt,max_c) else: cnt = 0 print(max_c)
[["-", 0, 656, 0, 1, 0, 652, 3, 4, 0, 22], ["+", 0, 656, 0, 1, 0, 652, 3, 4, 0, 22]]
5
43
#A import sys s = input() num = s.count("R") if num >= 2: if s[1] == "R": num = 1 print(num)
#A import sys s = input() num = s.count("R") if num >= 2: if s[1] == "S": num = 1 print(num)
[["-", 64, 196, 0, 57, 15, 666, 0, 557, 0, 6], ["+", 64, 196, 0, 57, 15, 666, 0, 557, 0, 6]]
5
40
#include <algorithm> #include <climits> #include <cmath> #include <cstdio> #include <iostream> #include <string> #include <vector> #define ll long long #define MAX 25 * 1e13 #define N 200010 #define SIZE(A) ((int)A.size()) #define LEN(A) ((int)A.length()) #define MP(A, B) make_pair(A, B) #define PB(X) push_back(X) #de...
#include <algorithm> #include <climits> #include <cmath> #include <cstdio> #include <iostream> #include <string> #include <vector> #define ll long long #define MAX 25 * 1e13 #define N 200010 #define SIZE(A) ((int)A.size()) #define LEN(A) ((int)A.length()) #define MP(A, B) make_pair(A, B) #define PB(X) push_back(X) #de...
[["+", 0, 14, 8, 9, 0, 57, 64, 9, 0, 45], ["+", 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], ["+", 0, 57, 64, 9, 0, 1, 0, 11, 31, 22], ["+", 0, 14, 8, 9, 0, 57, 64, 9, 0, 46]]
1
246
#include <bits/stdc++.h> #define fio \ ios_base::sync_with_stdio(false); \ cin.tie(NULL); \ cout.tie(NULL) #define int long long #define endl ...
#include <bits/stdc++.h> #define fio \ ios_base::sync_with_stdio(false); \ cin.tie(NULL); \ cout.tie(NULL) #define int long long #define endl ...
[["+", 0, 14, 8, 9, 0, 1, 0, 11, 31, 22], ["+", 0, 14, 8, 9, 0, 1, 0, 11, 17, 32]]
1
1,501
s = list(input()) box = [] cnt = 0 for i in s: if i == 'R': cnt += 1 else: box.append(cnt) box.append(cnt) print(max(box))
s = list(input()) box = [] cnt = 0 for i in s: if i == 'R': cnt += 1 else: box.append(cnt) cnt = 0 box.append(cnt) print(max(box))
[["+", 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
51
#pragma GCC optimize("Ofast") #pragma GCC optimize("unroll-loops") #pragma GCC optimize("fast-math") #pragma GCC target("sse4") #include <algorithm> #include <bitset> #include <cassert> #include <deque> #include <iostream> #include <map> #include <math.h> #include <queue> #include <random> #include <set> #include <stac...
#pragma GCC optimize("Ofast") #pragma GCC optimize("unroll-loops") #pragma GCC optimize("fast-math") #pragma GCC target("sse4") #include <algorithm> #include <bitset> #include <cassert> #include <deque> #include <iostream> #include <map> #include <math.h> #include <queue> #include <random> #include <set> #include <stac...
[["-", 15, 339, 51, 16, 12, 16, 31, 16, 17, 60], ["+", 8, 9, 0, 57, 15, 339, 51, 16, 17, 106]]
1
364
S = input() C = 0 l = [] for s in S: if s == "R": C += 1 else: l.append(C) C = 0 print(max(l))
S = input() C = 0 l = [] for s in S: if s == "R": C += 1 else: l.append(C) C = 0 l.append(C) print(max(l))
[["+", 0, 656, 0, 1, 0, 652, 63, 319, 500, 22], ["+", 0, 656, 0, 1, 0, 652, 63, 319, 0, 131], ["+", 0, 656, 0, 1, 0, 652, 63, 319, 319, 22], ["+", 0, 656, 0, 1, 0, 652, 3, 4, 0, 24], ["+", 0, 656, 0, 1, 0, 652, 3, 4, 0, 22], ["+", 0, 656, 0, 1, 0, 652, 3, 4, 0, 25]]
5
45
s = input() temp = 0 ans = 0 for i in s: if(i == "R"): temp += 1 else: if(temp > ans): ans = temp if(temp > ans): ans = temp print(temp)
s = input() temp = 0 ans = 0 for i in s: if(i == "R"): temp += 1 else: if(temp > ans): ans = temp temp = 0 if(temp > ans): ans = temp print(ans)
[["+", 0, 57, 64, 196, 0, 1, 0, 662, 31, 22], ["+", 0, 57, 64, 196, 0, 1, 0, 662, 0, 32], ["+", 0, 57, 64, 196, 0, 1, 0, 662, 12, 612], ["-", 0, 656, 0, 1, 0, 652, 3, 4, 0, 22], ["+", 0, 656, 0, 1, 0, 652, 3, 4, 0, 22]]
5
54
#include <bits/stdc++.h> using namespace std; typedef long long ll; typedef pair<int, int> P; typedef pair<ll, ll> PL; #define int ll const ll MOD = 1000000007; const ll INF_LL = (ll)1000000007 * 1000000007; const int INF_INT = (int)1000000007; const double PI = 3.14159265358979323846; const int dx[4] = {1, 0, -1, 0...
#include <bits/stdc++.h> using namespace std; typedef long long ll; typedef pair<int, int> P; typedef pair<ll, ll> PL; #define int ll const ll MOD = 1000000007; const ll INF_LL = (ll)1000000007 * 1000000007; const int INF_INT = (int)1000000007; const double PI = 3.14159265358979323846; const int dx[4] = {1, 0, -1, 0...
[["-", 15, 339, 51, 16, 31, 69, 341, 342, 0, 13], ["+", 15, 339, 51, 16, 31, 69, 341, 342, 0, 13]]
1
439
#include <bits/stdc++.h> using namespace std; #define int long long #define REP(i, m, n) for (int i = (m); i < (n); i++) #define rep(i, n) REP(i, 0, n) #define pb push_back #define all(a) a.begin(), a.end() #define rall(c) (c).rbegin(), (c).rend() #define mp make_pair #define endl '\n' #define vec vector<ll> #define ma...
#include <bits/stdc++.h> using namespace std; #define int long long #define REP(i, m, n) for (int i = (m); i < (n); i++) #define rep(i, n) REP(i, 0, n) #define pb push_back #define all(a) a.begin(), a.end() #define rall(c) (c).rbegin(), (c).rend() #define mp make_pair #define endl '\n' #define vec vector<ll> #define ma...
[["-", 8, 9, 0, 1, 0, 2, 3, 4, 0, 13], ["+", 8, 9, 0, 1, 0, 2, 3, 4, 0, 13]]
1
186
#include <bits/stdc++.h> using namespace std; void solve() { string s; cin >> s; int sm = 0, cnt = 0; sm += (s[0] == 'R' ? 1 : 0); cnt = sm; for (int i = 1; i < 2; i++) { if (s[i] == 'R') cnt++; else cnt = 0; sm = max(cnt, sm); } cout << sm << '\n'; } int main() { ios::sync_w...
#include <bits/stdc++.h> using namespace std; void solve() { string s; cin >> s; int sm = 0, cnt = 0; sm += (s[0] == 'R' ? 1 : 0); cnt = sm; for (int i = 1; i <= 2; i++) { if (s[i] == 'R') cnt++; else cnt = 0; sm = max(cnt, sm); } cout << sm << '\n'; } int main() { ios::sync_...
[["-", 0, 14, 8, 9, 0, 7, 15, 16, 17, 18], ["+", 0, 14, 8, 9, 0, 7, 15, 16, 17, 19]]
1
142
#include <bits/stdc++.h> #include <math.h> using namespace std; #define rep(i, n) for (int i = 0; i < (int)(n); i++) #define rep2(i, s, n) for (int i = (s); i < (int)(n); i++) typedef long long ll; using Graph = vector<vector<int>>; typedef pair<int, int> P; const int MOD = 1000000007; const int INF_32 = 1LL << 30; co...
#include <bits/stdc++.h> #include <math.h> using namespace std; #define rep(i, n) for (int i = 0; i < (int)(n); i++) #define rep2(i, s, n) for (int i = (s); i < (int)(n); i++) typedef long long ll; using Graph = vector<vector<int>>; typedef pair<int, int> P; const int MOD = 1000000007; const int INF_32 = 1LL << 30; co...
[["+", 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, 7, 8, 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
155
#include <bits/stdc++.h> using namespace std; #define S size() #define E end() #define B begin() #define L length() #define endl "\n" #define cnt count #define in insert #define er erase #define fi first #define se second #define fl float #define ld long double #define ll long long #define gcd __gcd #define mp make_...
#include <bits/stdc++.h> using namespace std; #define S size() #define E end() #define B begin() #define L length() #define endl "\n" #define cnt count #define in insert #define er erase #define fi first #define se second #define fl float #define ld long double #define ll long long #define gcd __gcd #define mp make_...
[["-", 0, 57, 15, 339, 51, 16, 12, 103, 0, 125], ["+", 0, 57, 15, 339, 51, 16, 12, 103, 0, 125]]
1
408
import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); String str = sc.next(); int count = 0; if (str.charAt(0) == 'R' && str.charAt(1) == 'R' && str.charAt(2) == 'R') count = 3; else if (str.charAt(0) == 'R' && str.charA...
import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); String str = sc.next(); int count = 0; if (str.charAt(0) == 'R' && str.charAt(1) == 'R' && str.charAt(2) == 'R') count = 3; else if (str.charAt(0) == 'R' && str.charA...
[["-", 0, 16, 12, 16, 31, 492, 3, 4, 0, 499], ["+", 0, 16, 12, 16, 31, 492, 3, 4, 0, 499]]
3
175
#include <bits/stdc++.h> using namespace std; #define fastIO \ ios_base::sync_with_stdio(false); \ cin.tie(NULL); \ cout.tie(NULL); #define int l...
#include <bits/stdc++.h> using namespace std; #define fastIO \ ios_base::sync_with_stdio(false); \ cin.tie(NULL); \ cout.tie(NULL); #define int l...
[["-", 0, 16, 12, 16, 31, 69, 341, 342, 0, 13], ["+", 0, 16, 12, 16, 31, 69, 341, 342, 0, 13]]
1
396
#include <bits/stdc++.h> using namespace std; constexpr long long int mod = 1000000007, MOD = 998244353; constexpr double PI = 3.14159265358979323846; int main() { int A, B, C; string D, E, F; cin >> D; A = 0; for (size_t i = 0; i < 3; i++) { if (D.at(i) == 'R') A++; } if (A != 0 && D.at(1) != ...
#include <bits/stdc++.h> using namespace std; constexpr long long int mod = 1000000007, MOD = 998244353; constexpr double PI = 3.14159265358979323846; int main() { int A, B, C; string D, E, F; cin >> D; A = 0; for (size_t i = 0; i < 3; i++) { if (D.at(i) == 'R') A++; } if (A == 2 && D.at(1) != ...
[["-", 0, 57, 15, 339, 51, 16, 31, 16, 17, 79], ["-", 0, 57, 15, 339, 51, 16, 31, 16, 12, 13], ["+", 0, 57, 15, 339, 51, 16, 31, 16, 17, 60], ["+", 0, 57, 15, 339, 51, 16, 31, 16, 12, 13]]
1
108
import java.util.*; public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); String a = sc.next(); if (a.equals("SSS")) { System.out.println(0); return; } if (a.equals("RRR")) { System.out.println(3); return; } if (a.equals("...
import java.util.*; public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); String a = sc.next(); if (a.equals("SSS")) { System.out.println(0); return; } if (a.equals("RRR")) { System.out.println(3); return; } if (a.equals("...
[["-", 8, 196, 0, 57, 15, 15, 0, 16, 17, 106], ["+", 8, 196, 0, 57, 15, 15, 0, 16, 17, 139], ["-", 64, 196, 0, 1, 0, 492, 3, 4, 0, 499], ["+", 64, 196, 0, 1, 0, 492, 3, 4, 0, 499]]
3
134
#include <algorithm> #include <cstdio> using namespace std; char buf[5]; int main() { scanf("%s", buf); int ans = 0; int cur = 0; for (int i = 0; i < 3; i++) { if (buf[cur] == 'S') cur = 0; else cur++, ans = max(ans, cur); } printf("%d\n", ans); return 0; }
#include <algorithm> #include <cstdio> using namespace std; char buf[5]; int main() { scanf("%s", buf); int ans = 0; int cur = 0; for (int i = 0; i < 3; i++) { if (buf[i] == 'S') cur = 0; else cur++, ans = max(ans, cur); } printf("%d\n", ans); return 0; }
[["-", 15, 339, 51, 16, 31, 69, 341, 342, 0, 22], ["+", 15, 339, 51, 16, 31, 69, 341, 342, 0, 22]]
1
96
#include <algorithm> #include <cctype> #include <cmath> #include <cstdlib> #include <iomanip> #include <iostream> #include <numeric> #include <queue> #include <set> #include <string> #include <unordered_map> #include <vector> using namespace std; #define rep(i, n) for (int i = 0; i < (int)(n); i++) using ll = long long...
#include <algorithm> #include <cctype> #include <cmath> #include <cstdlib> #include <iomanip> #include <iostream> #include <numeric> #include <queue> #include <set> #include <string> #include <unordered_map> #include <vector> using namespace std; #define rep(i, n) for (int i = 0; i < (int)(n); i++) using ll = long long...
[["-", 51, 16, 31, 16, 12, 16, 12, 5, 0, 6], ["-", 51, 16, 31, 16, 12, 16, 12, 5, 0, 62], ["-", 8, 9, 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]]
1
213
#include <bits/stdc++.h> #define pb push_back typedef long long ll; using namespace std; int main() { string s; cin >> s; int cnt = 0; if (s[0] == 'R' or s[1] == 'R' or s[2] == 'R') cnt = 1; if ((s[0] == s[1] and s[0] == 'R') or (s[0] == s[1] and s[0] == 'R')) cnt = 2; if (s[0] == 'R' and s[1] == 'R...
#include <bits/stdc++.h> #define pb push_back typedef long long ll; using namespace std; int main() { string s; cin >> s; int cnt = 0; if (s[0] == 'R' or s[1] == 'R' or s[2] == 'R') cnt = 1; if ((s[0] == s[1] and s[0] == 'R') or (s[1] == s[2] and s[1] == 'R')) cnt = 2; if (s[0] == 'R' and 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, 31, 16, 12, 69, 341, 342, 0, 13], ["+", 0, 16, 31, 16, 12, 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
152
import sys from collections import deque import numpy as np import math sys.setrecursionlimit(10**6) def S(): return sys.stdin.readline().rstrip() def SL(): return map(str,sys.stdin.readline().rstrip().split()) def I(): return int(sys.stdin.readline().rstrip()) def IL(): return map(int,sys.stdin.readline().rstrip().spl...
import sys from collections import deque import numpy as np import math sys.setrecursionlimit(10**6) def S(): return sys.stdin.readline().rstrip() def SL(): return map(str,sys.stdin.readline().rstrip().split()) def I(): return int(sys.stdin.readline().rstrip()) def IL(): return map(int,sys.stdin.readline().rstrip().spl...
[["+", 0, 57, 75, 665, 15, 679, 12, 666, 0, 22], ["+", 0, 57, 75, 665, 15, 679, 12, 666, 667, 60]]
5
173
#include <bits/stdc++.h> using namespace std; void solve() { string s; cin >> s; if (s == "RRR") { cout << 3 << endl; } else if (s == "RRS" || "SRR") { cout << 2 << endl; } else if (s == "SSS") { cout << 0 << endl; } else { cout << 1 << endl; } } int main() { long long m; m = 1; w...
#include <bits/stdc++.h> using namespace std; void solve() { string s; cin >> s; if (s == "RRR") { cout << 3 << endl; } else if (s == "RRS" || s == "SRR") { cout << 2 << endl; } else if (s == "SSS") { cout << 0 << endl; } else { cout << 1 << endl; } } int main() { long long m; m = 1...
[["+", 0, 57, 15, 339, 51, 16, 12, 16, 31, 22], ["+", 0, 57, 15, 339, 51, 16, 12, 16, 17, 60]]
1
110
#include <bits/stdc++.h> #include <vector> #define rep(i, n) for (int i = 0; i < n; ++i) #define ll long long #define all(a) a.begin(), a.end() using namespace std; int main() { char a, b, c; cin >> a >> b >> c; char r = 'R'; if (a == r && b == r && c == r) cout << 3 << endl; else if ((a == r && b == r) ...
#include <bits/stdc++.h> #include <vector> #define rep(i, n) for (int i = 0; i < n; ++i) #define ll long long #define all(a) a.begin(), a.end() using namespace std; int main() { char a, b, c; cin >> a >> b >> c; char r = 'R'; if (a == r && b == r && c == r) cout << 3 << endl; else if ((a == r && b == r) ...
[["-", 51, 16, 12, 23, 0, 16, 12, 16, 31, 22], ["+", 51, 16, 12, 23, 0, 16, 12, 16, 31, 22]]
1
130
#include <bits/stdc++.h> using namespace std; #define pb push_back #define mp(aa, bb) make_pair(aa, bb) #define _for(i, b) for (int i = (0); i < (b); i++) #define rep(i, a, b) for (int i = (a); i <= (b); i++) #define per(i, b, a) for (int i = (b); i >= (a); i--) #define mst(abc, bca) memset(abc, bca, sizeof abc) #defin...
#include <bits/stdc++.h> using namespace std; #define pb push_back #define mp(aa, bb) make_pair(aa, bb) #define _for(i, b) for (int i = (0); i < (b); i++) #define rep(i, a, b) for (int i = (a); i <= (b); i++) #define per(i, b, a) for (int i = (b); i >= (a); i--) #define mst(abc, bca) memset(abc, bca, sizeof abc) #defin...
[["+", 0, 57, 75, 76, 0, 1, 0, 34, 0, 21], ["+", 75, 76, 0, 1, 0, 34, 12, 11, 31, 22], ["+", 75, 76, 0, 1, 0, 34, 12, 11, 17, 32], ["+", 75, 76, 0, 1, 0, 34, 12, 11, 12, 13]]
1
230
S = gets.chomp result = '' if S.match('SSS') result = 3 elsif S.match('SS') result = 2 elsif S.match('S') result = 1 else result = 0 end p result
S = gets.chomp result = '' if S.match('RRR') result = 3 elsif S.match('RR') result = 2 elsif S.match('R') result = 1 else result = 0 end p result
[["-", 0, 121, 15, 652, 3, 4, 0, 557, 0, 6], ["+", 0, 121, 15, 652, 3, 4, 0, 557, 0, 6], ["-", 75, 759, 15, 652, 3, 4, 0, 557, 0, 6], ["+", 75, 759, 15, 652, 3, 4, 0, 557, 0, 6]]
4
52
#include <bits/stdc++.h> #include <iostream> using namespace std; int main() { string s; int Max = 0; cin >> s; int a = s.size(); int sum = 0; if (s[0] == 'R') sum++; for (int i = 1; i < a; i++) { if (s[i] == s[i - 1] && s[i] == 'R') sum++; else if (s[i] == 'R' && s[i - 1] == 'S') ...
#include <bits/stdc++.h> #include <iostream> using namespace std; int main() { string s; int Max = 0; cin >> s; int a = s.size(); int sum = 0; if (s[0] == 'R') sum++; Max = sum; for (int i = 1; i < a; i++) { if (s[i] == s[i - 1] && s[i] == 'R') sum++; else if (s[i] == 'R' && s[i - 1] ...
[["+", 0, 14, 8, 9, 0, 1, 0, 11, 31, 22], ["+", 0, 14, 8, 9, 0, 1, 0, 11, 17, 32], ["+", 0, 14, 8, 9, 0, 1, 0, 11, 12, 22], ["+", 0, 30, 0, 14, 8, 9, 0, 1, 0, 35], ["-", 8, 9, 0, 1, 0, 16, 31, 16, 12, 22], ["+", 8, 9, 0, 1, 0, 16, 31, 16, 12, 22]]
1
154
x = max(map(len,input().split(S))) print(x)
x = max(map(len,input().split("S"))) print(x)
[["+", 3, 4, 0, 652, 3, 4, 0, 557, 0, 654], ["+", 3, 4, 0, 652, 3, 4, 0, 557, 0, 655]]
5
22
#include <bits/stdc++.h> using namespace std; #define FASTER \ ios_base::sync_with_stdio(0); \ cin.tie(0); \ cout.tie(0) typedef long long...
#include <bits/stdc++.h> using namespace std; #define FASTER \ ios_base::sync_with_stdio(0); \ cin.tie(0); \ cout.tie(0) typedef long long...
[["-", 0, 14, 8, 9, 0, 1, 0, 16, 31, 22], ["-", 0, 14, 8, 9, 0, 1, 0, 16, 17, 152], ["-", 0, 14, 8, 9, 0, 1, 0, 16, 12, 22], ["-", 0, 30, 0, 14, 8, 9, 0, 1, 0, 35]]
1
125
#include <bits/stdc++.h> using namespace std; int main() { string str; cin >> str; if (str == "RRR") { cout << "3" << endl; } if (str == "RRS" || str == "SRR") { cout << "2" << endl; } if (str == "SSS") { cout << "0" << endl; } else { cout << "1" << endl; } }
#include <bits/stdc++.h> using namespace std; int main() { string str; cin >> str; if (str == "RRR") { cout << "3" << endl; } else if (str == "RRS" || str == "SRR") { cout << "2" << endl; } else if (str == "SSS") { cout << "0" << endl; } else { cout << "1" << endl; } }
[["+", 0, 14, 8, 9, 0, 57, 75, 76, 0, 95], ["+", 0, 57, 75, 76, 0, 57, 75, 76, 0, 95]]
1
90
#include <bits/stdc++.h> using namespace std; int main() { string S; cin >> S; int ans = 0; for (int i = 0; i < 3; i++) { if (S[i] == 'R') ans = 1; } if (S[0] == S[1] && S[0] == 'R') ans = 2; if (S[2] == S[2] && S[1] == 'R') ans = 2; if (S[0] == S[1] && S[1] == S[2] && S[0] == 'R') ...
#include <bits/stdc++.h> using namespace std; int main() { string S; cin >> S; int ans = 0; for (int i = 0; i < 3; i++) { if (S[i] == 'R') ans = 1; } if (S[0] == S[1] && S[0] == 'R') ans = 2; if (S[1] == S[2] && S[1] == 'R') ans = 2; if (S[0] == S[1] && S[1] == S[2] && S[0] == 'R') ...
[["-", 51, 16, 31, 16, 31, 69, 341, 342, 0, 13], ["+", 51, 16, 31, 16, 31, 69, 341, 342, 0, 13]]
1
146
#include <bits/stdc++.h> //#include <ext/pb_ds/assoc_container.hpp> // using namespace __gnu_pbds; // DEEP using namespace std; #define boost \ ios_base::sync_with_stdio(false); \ cin.tie(NULL); ...
#include <bits/stdc++.h> //#include <ext/pb_ds/assoc_container.hpp> // using namespace __gnu_pbds; // DEEP using namespace std; #define boost \ ios_base::sync_with_stdio(false); \ cin.tie(NULL); ...
[["+", 75, 76, 0, 9, 0, 1, 0, 11, 31, 22], ["+", 75, 76, 0, 9, 0, 1, 0, 11, 17, 32], ["+", 75, 76, 0, 9, 0, 1, 0, 11, 12, 13], ["+", 0, 57, 75, 76, 0, 9, 0, 1, 0, 35]]
1
375
#include <bits/stdc++.h> using namespace std; #define rep(i, n) for (int i = 0; i < (n); i++) using ll = long long; const int MAX = 3000000; const int MOD = 1000000007; int main() { string s; cin >> s; int rain = 0, sun = 0; rep(i, 3) { if (s[i] == 'R') rain++; else sun++; } if (s == ...
#include <bits/stdc++.h> using namespace std; #define rep(i, n) for (int i = 0; i < (n); i++) using ll = long long; const int MAX = 3000000; const int MOD = 1000000007; int main() { string s; cin >> s; int rain = 0, sun = 0; rep(i, 3) { if (s[i] == 'R') rain++; else sun++; } if (s == ...
[["-", 0, 57, 15, 339, 51, 16, 12, 5, 0, 6], ["+", 0, 57, 15, 339, 51, 16, 12, 5, 0, 6]]
1
101
strings = input() lists = [] count = 0 for i in strings: if i == 'R': count += 1 elif i == 'S': lists.append(count) count = 0 print(max(lists))
strings = input() lists = [] count = 0 for i in strings: if i == 'R': count += 1 elif i == 'S': lists.append(count) count = 0 lists.append(count) print(max(lists))
[["+", 0, 656, 0, 1, 0, 652, 63, 319, 500, 22], ["+", 0, 656, 0, 1, 0, 652, 63, 319, 0, 131], ["+", 0, 656, 0, 1, 0, 652, 63, 319, 319, 22], ["+", 0, 656, 0, 1, 0, 652, 3, 4, 0, 24], ["+", 0, 656, 0, 1, 0, 652, 3, 4, 0, 22], ["+", 0, 656, 0, 1, 0, 652, 3, 4, 0, 25]]
5
50
#include <bits/stdc++.h> #include <stdlib.h> using namespace std; #define ll long long #define ld long double #define pb push_back #define pr pair<ll, ll> #define vct vector<ll> #define vpt vector<pr> #define st set<ll> #define pq priority_queue<ll> #define mat vector<vector<ll>> #define all(x) x.begin(), x.end() #def...
#include <bits/stdc++.h> #include <stdlib.h> using namespace std; #define ll long long #define ld long double #define pb push_back #define pr pair<ll, ll> #define vct vector<ll> #define vpt vector<pr> #define st set<ll> #define pq priority_queue<ll> #define mat vector<vector<ll>> #define all(x) x.begin(), x.end() #def...
[["+", 0, 57, 75, 76, 0, 57, 75, 76, 0, 95], ["+", 0, 57, 75, 76, 0, 1, 0, 2, 63, 22], ["+", 75, 76, 0, 1, 0, 2, 3, 4, 0, 24], ["+", 75, 76, 0, 1, 0, 2, 3, 4, 0, 13], ["+", 75, 76, 0, 1, 0, 2, 3, 4, 0, 25], ["+", 75, 76, 0, 57, 75, 76, 0, 1, 0, 35]]
1
788
#include <bits/stdc++.h> using namespace std; typedef long long ll; typedef pair<int, int> pii; typedef pair<ll, ll> pll; typedef vector<bool> vb; typedef vector<int> vi; typedef vector<ll> vll; typedef vector<pii> vpii; typedef vector<pll> vpl; typedef vector<vi> vvi; typedef vector<vll> vvll; void __print(int x) {...
#include <bits/stdc++.h> using namespace std; typedef long long ll; typedef pair<int, int> pii; typedef pair<ll, ll> pll; typedef vector<bool> vb; typedef vector<int> vi; typedef vector<ll> vll; typedef vector<pii> vpii; typedef vector<pll> vpl; typedef vector<vi> vvi; typedef vector<vll> vvll; void __print(int x) {...
[["+", 75, 76, 0, 9, 0, 1, 0, 11, 31, 22], ["+", 75, 76, 0, 9, 0, 1, 0, 11, 17, 32], ["+", 75, 76, 0, 9, 0, 1, 0, 11, 12, 13], ["+", 0, 57, 75, 76, 0, 9, 0, 1, 0, 35]]
1
1,023
#include <bits/stdc++.h> #define ll long long #define ld long double #define pb push_back #define ip pair<ll, ll> #define vii vector<ll> #define vpp vector<ip> #define vdd vector<ld> #define vb vector<bool> #define pi pair<ll, ip> #define sc(x) scanf("%lli", &x) #define c(x) cin >> x #define fo(i, k, n) for (int i = k;...
#include <bits/stdc++.h> #define ll long long #define ld long double #define pb push_back #define ip pair<ll, ll> #define vii vector<ll> #define vpp vector<ip> #define vdd vector<ld> #define vb vector<bool> #define pi pair<ll, ip> #define sc(x) scanf("%lli", &x) #define c(x) cin >> x #define fo(i, k, n) for (int i = k;...
[["-", 0, 9, 0, 57, 64, 9, 0, 116, 0, 117], ["+", 0, 9, 0, 57, 64, 9, 0, 93, 0, 94]]
1
613