problem_id
stringclasses
100 values
submission_id
stringlengths
10
10
status
stringclasses
2 values
code
stringlengths
6
806
p02582
s869052717
Accepted
s = input() if s == "SSS": print(0) elif s == "RRR": print(3) elif s == "SRR" or s == "RRS": print(2) else: print(1)
p02582
s684961054
Accepted
print(max(map(len,input().split("S"))))
p02582
s931003834
Accepted
s = input() rain_max = 0 local_max = 0 for i in range(len(s)): if s[i] == 'R': local_max += 1 else: if local_max > rain_max: rain_max = local_max local_max = 0 if local_max > rain_max: rain_max = local_max print(rain_max)
p02582
s571489128
Accepted
n = input() rcount = 0 m = 0 for i in n: if i == "R": rcount += 1 else: rcount = 0 if m <= rcount: m = rcount print(m)
p02582
s086474592
Accepted
s=input() s=list(s) s_c = s.count('R') if s[1]=='S' and s_c==2: s_c=1 print(s_c)
p02582
s611271034
Accepted
S = input() if S == "RRR": print(3) elif "RR" in S: print(2) elif "R" in S: print(1) else: print(0)
p02582
s497839180
Accepted
s = input() if s == "RRR": print(3) elif "RR" in s: print(2) elif "R" in s: print(1) else: print(0)
p02582
s159622804
Accepted
S = input() rst = 0 for i in range(0,3): cnt = 0 if S[i] == "R": cnt += 1 for j in range(i+1,3): if S[j] == "R": cnt+= 1 else: break rst = max(rst,cnt) print(rst)
p02582
s459263165
Accepted
s = input() if s=="RRR": print(3) elif s=="RRS" or s=="SRR": print(2) elif s=="SSS": print(0) else: print(1)
p02582
s926730510
Accepted
s = input() count = 0 if(s[1]=='R'): for i in s: if(i=='R'): count+=1 else: for i in s: if(i=='R'): count = 1 print(count)
p02582
s999037686
Accepted
S = input() if 'RRR' in S: print(3) elif 'RR' in S: print(2) elif 'R' in S: print(1) else: print(0)
p02582
s019625264
Accepted
n = input() if n == "RRR": print("3") elif n[:2] == "RR" or n[1:] == "RR": print("2") elif n=="SSS": print("0") else: print("1")
p02582
s742870177
Accepted
S = input() if(S=="RRR"): print(3) elif(S=="RRS" or S=="SRR"): print(2) elif(S[0]=="R" or S[1]=="R" or S[2]=="R"): print(1) else: print(0)
p02582
s892015900
Accepted
S = input() if S == "SSS": print(0) if S == "RSS": print(1) if S == "RRS": print(2) if S == "RRR": print(3) if S == "SRS": print(1) if S == "SSR": print(1) if S == "SRR": print(2) if S == "RSR": print(1)
p02582
s099141795
Accepted
S = input() if S[0] == "R": if S[1] =="R": if S[2]=="R": print(3) else: print(2) else: print(1) else: if S[1] =="R": if S[2]=="R": print(2) else: print(1) else: if S[2]=="R": print(1) else: print(0)
p02582
s793381367
Accepted
import sys sys.setrecursionlimit(10 ** 8) input = sys.stdin.readline def main(): S = input().strip() if S.count("RRR"): print(3) elif S.count("RR"): print(2) elif S.count("R"): print(1) else: print(0) if __name__ == '__main__': main()
p02582
s766694778
Accepted
w=input() if w=="RRR": print(3) elif w=="SRR": print(2) elif w=="RRS": print(2) elif w=="RSR": print(1) elif w=="RSS": print(1) elif w=="SRS": print(1) elif w=="SSR": print(1) else : print(0)
p02582
s324342596
Accepted
S = input() if S == 'RRR': print(3) else: if S == 'RRS' or S == 'SRR': print(2) else: if S =='SSS': print(0) else: print(1)
p02582
s022820886
Accepted
num = list(map(str,input())) if num[0]== 'R' and num[1] =='S': print('1') else: print(num.count('R'))
p02582
s425765046
Accepted
# -*- coding: utf-8 -*- s = input() if s == 'RRR': print(3) elif 'RR' in s: print(2) elif 'R' in s: print(1) else: print(0)
p02582
s864987644
Accepted
s = input() cnt = 0 if 'RRR' in s: print(3) exit() if 'RR' in s: print(2) exit() if 'R' in s: print(1) exit() print(0)
p02582
s557294662
Accepted
def main(): s = input().split('S') x = max(map(len,s)) print(x) main()
p02582
s566683322
Accepted
S = input() result = 0 if S == "RRR": result = 3 elif S == "RRS" or S == "SRR": result = 2 elif "R" in S: result = 1 print(result)
p02582
s433454946
Accepted
s=input() ans=0 num=0 for i in range(len(s)): if s[i] == 'R': num+=1 else: num=0 if num>ans: ans=num print(ans)
p02582
s969149314
Accepted
s = input().strip() if (s[0] == "R") and (s[1] =="R") and (s[2] =="R"): print(3) elif (s[0] == "R" and s[1] == "R" and s[2] == "S")or(s[0] == "S" and s[1] == "R" and s[2] == "R"): print(2) elif s[0] == "S" and s[1] == "S" and s[2] == "S": print(0) else: print(1)
p02582
s545108358
Accepted
S = list(input()) RD = S.count('R') if RD != 2: print(RD) else: if S[1] == 'R': print(RD) else: print(1)
p02582
s573480483
Accepted
S = list(input()) cnt = 0 for i, s in enumerate(S): if s == 'R' and cnt == 0: cnt += 1 elif s == 'R' and cnt >= 1 and S[i-1] == 'R': cnt += 1 print(cnt)
p02582
s636641917
Accepted
s=str(input()) R=s.count('R') if s=='RSR': print(1) else: print(R)
p02582
s100375699
Accepted
str = input() ans = 0 list_ans=[] flag = 0 for i in range(len(str)): if str[i] == 'R': if flag == 0: ans = 1 else: ans += 1 flag = 1 else: flag = 0 list_ans.append(ans) list_ans.append(ans) print(max(list_ans))
p02582
s776885517
Accepted
S = input() cur = 0 ans = 0 for i in range(len(S)): if S[i] == "R": cur += 1 else: ans = max(ans, cur) cur = 0 ans = max(ans, cur) print(ans)
p02582
s024616516
Accepted
import sys import heapq, math from itertools import zip_longest, permutations, combinations, combinations_with_replacement from itertools import accumulate, dropwhile, takewhile, groupby from functools import lru_cache from copy import deepcopy S = input() if S[0] == S[1] == S[2] == "R": print(3) elif S[0:2] == "RR" or S[1:3] == "RR": print(2) elif "R" in S: print(1) else: print(0)
p02582
s568962080
Accepted
S = input() compareStr = 'R' * len(S) while len(compareStr) > 0: if compareStr in S: break compareStr = compareStr[:-1] print(len(compareStr))
p02582
s079451214
Accepted
s = input() if 'RRR' in s: print(3) elif 'RR' in s: print(2) elif 'R' in s: print(1) else: print(0)
p02582
s824358951
Accepted
s = input() ans = 0 for r in s: if r == 'R': ans += 1 if ans == 2 and s == 'RSR': print(1) else: print(ans)
p02582
s569175574
Accepted
x = max(map(len,input().split("S"))) print(x)
p02582
s793898876
Accepted
s=input() if ("RRR" in s): print(3) elif ("RR" in s): print(2) elif ("R" in s): print(1) else: print(0)
p02582
s143015030
Accepted
s=input() cnt=0 for i in range(3): if(s[i]=='R'): cnt+=1 if(cnt!=2): print(cnt) elif(s=="RSR"): print(1) else: print(2)
p02582
s403328591
Accepted
s = list(input()) if s.count('R') == 3: print(3) elif s.count('R') == 1: print(1) elif s.count('R') == 0: print(0) else: if s[1] == 'R': print(2) else: print(1)
p02582
s040800194
Accepted
s = str(input()) n = len(s) c = 0 for i in range(n): if s[i] == "R": j = i a = 0 while s[j] == "R" and j < n-1: a += 1 j += 1 if j == n-1 and s[j] == "R": a += 1 c = max(a,c) print(c)
p02582
s964035079
Accepted
S=list(input().split("S")) print(max(len(s) for s in S))
p02582
s799799478
Accepted
def resolve(): S = input() mark = "" count = 0 max_count = 0 for s in list(S): if s == "R": count += 1 else: max_count = max(max_count, count) count = 0 mark = s max_count = max(max_count, count) print(max_count) resolve()
p02582
s001641982
Accepted
s = input() if s == "RRR": print(3) elif s == "RRS" or s == "SRR": print(2) elif s == "RSS" or s == "SRS" or s == "SSR" or s == "RSR": print(1) else: print(0)
p02582
s249356451
Accepted
s = input() ans = 0 if 'RRR' in s: ans = 3 elif 'RR' in s: ans = 2 elif 'R' in s: ans = 1 print(ans)
p02582
s628836857
Accepted
D = input() ans = 0 ans_list = [] if D.count("R") >= 1: for i in range(3): if D[i] == 'R': ans += 1 ans_list.append(ans) elif D[i] == 'S': ss = 0 ans_list.append(ss) if i > 0: ans = 0 print(max(ans_list)) elif D.count("R") < 1: print(0)
p02582
s235869433
Accepted
S=input() if S=="RRR": print(3) elif S=="RRS" or S=="SRR": print(2) elif S.count("R")>0: print(1) else: print(0)
p02582
s697163125
Accepted
import re S = input() rrr = S.count("RRR") rr = S.count("RR") r = S.count("R") if rrr == 1: print(3) elif rr == 1: print(2) elif r == 1 or r == 2: print(1) else: print(0)
p02582
s183275383
Accepted
#175 A S = input() if S == 'RRR': print(3) elif S == 'SRR' or S == 'RRS': print(2) elif S == 'SSS': print(0) else: print(1)
p02582
s153516051
Accepted
s = input() if 'RRR' in s: print(3) elif 'RR' in s: print(2) elif 'R' in s: print(1) else: print(0)
p02582
s385919603
Accepted
S=input() if S=="RRR" : print(3) elif S=="RRS" : print(2) elif S=="SRR" : print(2) elif S=="RSS" : print(1) elif S=="SRS" : print(1) elif S=="SSR" : print(1) elif S=="RSR" : print(1) else : print(0)
p02582
s258428006
Accepted
s = input() if "RRR" in s: r = 3 elif "RR" in s: r = 2 elif "R" in s: r= 1 else: r = 0 print(r)
p02582
s229519259
Accepted
S = input() def it(s): c = 0 for v in s: if v == 'R': c += 1 else: c = 0 yield c print(max(it(S)))
p02582
s930934170
Accepted
s = input() w_l = s.split('S') print(max([m for m in map(len, w_l)]))
p02582
s016508832
Accepted
S = input() ans = 0 tmp = 0 for i in S: if i == 'R': tmp += 1 else: ans = max(tmp,ans) tmp = 0 ans = max(tmp,ans) print(ans)
p02582
s652075608
Accepted
def Next(): return input() def NextInt(): return int(Next()) def NextInts(): return map(int,input().split()) def Nexts(): return map(str,input().split()) def NextIntList(): return list(map(int,input().split())) def RowInts(n): return [input() for i in range(n)] s = input() ans = 0 tmp = 0 for i in s: if i == 'R': tmp += 1 ans = max(ans, tmp) else: tmp = 0 print(ans)
p02582
s356809085
Accepted
S = input() sum = 0 for i in range(3): if S[i]=="R": sum += 1 if sum == 2 and S[1] == "S": sum = 1 print(sum)
p02582
s956288616
Accepted
print(len(max(input().split('S'))))
p02582
s917922889
Accepted
weather = input().rstrip() #print(weather) if weather.count('RRR') == 1: print(3) elif weather.count('RR') == 1: print(2) elif weather.count('R') >= 1: print(1) else: print(0)
p02582
s676718945
Accepted
S = input() count = S.count("R") if count == 2 and S[0] == "R" and S[2] == "R": count = 1 print(count)
p02582
s789477146
Accepted
# from pprint import pprint # import math # import collections s = input() # n, k = map(int, input().split(' ')) # a = list(map(int, input().split(' '))) # a = [] # for i in range(n): # a.append(int(input())) if s == 'RRR': ans = 3 elif s in ('RRS', 'SRR'): ans = 2 elif s == 'SSS': ans = 0 else: ans = 1 print(ans)
p02582
s681870965
Accepted
s = input() if s == "RRR": print(3) elif "RR" in s: print(2) elif "R" in s: print(1) else: print(0)
p02582
s719021549
Accepted
s=input() if 'RRR' in s: print(3) elif 'RR' in s: print(2) elif 'R' in s: print(1) else: print(0)
p02582
s935003335
Accepted
S = input() if S == 'RSS': print(1) exit() tmp = 0 for i in range(len(S)): if S[i] == 'R': tmp += 1 else: if i == 2: break else: tmp = 0 print(tmp)
p02582
s086170089
Accepted
tenki = str(input()) count = 0 tenki_list = [] for n in tenki: if n == 'R': count +=1 else: count = 0 tenki_list.append(count) print(max(tenki_list))
p02582
s696738275
Accepted
S = input() count = 0 mcount = 0 for i in range(len(S)): if(S[i] == 'S'): count = 0 elif(S[i] == 'R'): count += 1 if(count>mcount): mcount = count print(mcount)
p02582
s606046532
Accepted
s=input() a=s.count("R") if a==0: print(0) elif a==1: print(1) elif a==2: if s[1]=="S": print(1) else: print(2) else: print(3)
p02582
s548876607
Accepted
S=list(input()) ans=0 for i in range(len(S)): if ans==0 and S[i]=="R": ans=1 for i in range(len(S)-1): if S[i]=="R" and S[i+1]=="R": ans+=1 print(ans)
p02582
s653430869
Accepted
# -*- coding: utf-8 -*- def main(): s = str(input()) if s == "RRR": print(3) elif s == "RRS" or s == "SRR": print(2) elif s == "SSS": print(0) else: print(1) if __name__ == '__main__': main()
p02582
s163441187
Accepted
import sys input = sys.stdin.readline from collections import * s = input()[:-1] l = [] cnt = 1 for i in range(len(s)-1): if s[i]!=s[i+1]: l.append((s[i], cnt)) cnt = 1 else: cnt += 1 l.append((s[-1], cnt)) ans = 0 for si, c in l: if si=='R': ans = max(ans, c) print(ans)
p02582
s292039082
Accepted
S = input() for i in range(4)[::-1]: if 'R' * i in S: print(i) exit()
p02582
s498425073
Accepted
s=input() if "RRR" in s: print(3) elif "RR" in s: print(2) elif "R" in s: print(1) else: print(0)
p02582
s595987937
Accepted
W = input() if W[0] == 'R' and W[1] == 'R' and W[2] == 'R': print(3) elif (W[0] == 'R' and W[1] == 'R') or (W[1] == 'R' and W[2] == 'R'): print(2) elif W[0] == 'S' and W[1] == 'S' and W[2] == 'S': print(0) else: print(1)
p02582
s725383525
Accepted
S = input() count = 0 if S == 'RSR': print(1) else: for i in S: if i == 'R': count+=1 print(count)
p02582
s123502623
Accepted
string = input() result = string.count("R") if(result == 2 and string[1] == "S"): print("1") else: print(result)
p02582
s288346982
Accepted
S = input() count = S.count('R') if count == 0 or count == 1 or count == 3: print(count) else: if S == 'RSR': print(1) else: print(2)
p02582
s280962564
Accepted
import sys input = sys.stdin.readline def main(): S = input().rstrip() if "RRR" in S: ans = 3 elif "RR" in S: ans = 2 elif "R" in S: ans = 1 else: ans = 0 print(ans) if __name__ == "__main__": main()
p02582
s541200794
Accepted
str = input() cnt = 0 for i in range(3): if str == 'RRR': cnt = 3 elif str == 'RRS': cnt = 2 elif str == 'SRR': cnt = 2 elif str == 'SSS': cnt = 0 else: cnt = 1 print(cnt)
p02582
s828601648
Accepted
# A s = input() count = 0 ans = 0 for i in range(len(s)): if s[i] == "R": count += 1 else: if ans < count: ans = count count = 0 if ans < count: ans = count print(ans)
p02582
s568566117
Accepted
s = input().split('S') ans = 0 for i in s: if len(i) > ans: ans = len(i) print(ans)
p02582
s420501210
Accepted
x = input() a = [int(x[i]=='R') for i in range(3)] s = sum(a) if(s==2 and a[1]==0): s = 1 print(s)
p02582
s011225678
Accepted
S = input() cnt = 0 for i,ch in enumerate(S): if cnt == 0: if ch == "R": cnt = 1 elif ch == "R" and S[i-1] == "R": cnt += 1 print(cnt)
p02582
s676514784
Accepted
#!/usr/bin/env python3 import sys input = sys.stdin.readline s = input().rstrip() if "RRR" in s: print(3) elif "RR" in s: print(2) elif "R" in s: print(1) else: print(0)
p02582
s985417302
Accepted
s = input() if 'RRR' in s: print(3) elif 'RR' in s: print(2) elif 'R' in s: print(1) else: print(0)
p02582
s764131948
Accepted
S = input() count = 0 if 'R' in S: count = 1 if 'RR' in S: count = 2 if 'RRR' in S: count = 3 print(count)
p02582
s933491536
Accepted
N=input() if N==('SSS'): print(0) if N==('SSR'): print(1) if N==('SRS'): print(1) if N==('RSR'): print(1) if N==('RSS'): print(1) if N==('SRR'): print(2) if N==('RRS'): print(2) if N==('RRR'): print(3)
p02582
s742750341
Accepted
a = input() if "RRR" in a: print(3) elif "RR" in a: print(2) elif "R" in a: print(1) else: print(0)
p02582
s643607197
Accepted
S = input() count = 0 if S[0] == "R" and S[1] == "R": if S[2] == "R": count = 3 else: count = 2 if S[0] == "R" and S[1] == "S": count = 1 if S[0] == "S" and S[1] == "R": if S[2] == "R": count = 2 else: count = 1 if S[0] == "S" and S[1] == "S": if S[2] == "R": count = 1 else: count = 0 print(count)
p02582
s771098075
Accepted
import sys sys.setrecursionlimit(10**9) def mi(): return map(int,input().split()) def ii(): return int(input()) def isp(): return input().split() def deb(text): print("-------\n{}\n-------".format(text)) INF=10**20 def main(): S = input() if S == "RRR": print(3) elif S[1:3] == "RR" or S[0:2] == "RR": print(2) else: ans = 0 for s in S: if s == "R": ans = 1 print(ans) if __name__ == "__main__": main()
p02582
s384691513
Accepted
def solve(s): res=0 for i in range(len(s)): if s[i]=="R": res+=1 elif s[i]=="S" and res>0: return res return res s=input() print(solve(s))
p02582
s038108402
Accepted
S = input() # RC = S.count('R') # if S[1] == 'S' and RC == 2: # print(1) # else: # print(RC) rs = S.split('S') ans = 0 for r in rs: ans = max(ans, len(r)) print(ans)
p02582
s721755307
Accepted
line = input() rain_day = 0 k = 0 for wether in line: #当日雨 if wether == "R": rain_day += 1 #当日晴れ、前日は雨 elif rain_day != 0: k = rain_day rain_day = 0 #当日晴れ、前日も晴れ else: pass if k > rain_day: print(k) else: print(rain_day)
p02582
s290142508
Accepted
A = input() count = 0 for a in range(3): if A[a] == 'R': count+=1 if count == 2 and A[1] == 'S': count = 1 print(count)
p02582
s148964827
Accepted
S=input() if S== 'RRR': print(3) elif S=='RRS' or S=='SRR': print(2) elif S=='SSS': print(0) else: print(1)
p02582
s931785837
Accepted
def read_int(): return int(input().strip()) def read_ints(): return list(map(int, input().strip().split(' '))) def solve(): S = input() if 'RRR' in S: return 3 if 'RR' in S: return 2 if 'R' in S: return 1 return 0 if __name__ == '__main__': print(solve())
p02582
s409381776
Accepted
s=input() if s.count('R')==3: print(3) elif s[0]==s[1]=='R' or s[1]==s[2]=='R': print(2) elif s.count('R')!=0: print(1) else: print(0)
p02582
s326486491
Accepted
S=input() print(max(i for i in range(4)if S.count("R"*i)))
p02582
s294643623
Accepted
S = input() a = 0 if S == 'RSR': print(1) else: for i in S: if i == 'R': a += 1 print(a)
p02582
s916151521
Accepted
str = input() if str == "RRR": print("3") elif str == "RRS" or str == "SRR": print("2") elif str == "SSS": print("0") else: print("1")
p02582
s810007037
Accepted
S = input() if 'RSR' in S: print(1) else: print(S.count("R"))
p02582
s171918153
Accepted
s = input() if 'RRR' in s: print(3) elif 'RR' in s: print(2) elif 'R' in s: print(1) else: print(0)
p02582
s552559728
Accepted
s = input() maxCount = 0 count = 0 for i in s: if(i == 'R'): count += 1 else: maxCount = max(count, maxCount) count = 0 print(max(count, maxCount))