problem_id
stringclasses
100 values
submission_id
stringlengths
10
10
status
stringclasses
2 values
code
stringlengths
6
806
p02582
s983830331
Accepted
s=input() t=s.find('R') if t==2: print(1) elif t==-1: print('0') elif t==0: if s[t]==s[t+1]: if s[t+1]==s[t+2]: print('3') else: print('2') else: print(1) else: if s[t]==s[t+1]: print(2) else: print(1)
p02582
s325610847
Accepted
n = input() if n[0] == "S": if n[1] == "S": if n[2] == "S": print("0") else: print("1") else: if n[2] == "S": print("1") else: print("2") else: if n[1] == "S": print("1") else: if n[2] == "S": print("2") else: print("3")
p02582
s469851246
Accepted
S = input() s_num = len(S) i=0 max_count = 0 count = 0 while i < s_num: if S[i] != "R": if max_count < count: max_count = count count = 0 elif S[i] == "R": count += 1 i+=1 if max_count < count: max_count = count print(max_count)
p02582
s326669834
Accepted
weatherS = input() p = weatherS[0] == 'R' q = weatherS[1] == 'R' r = weatherS[2] == 'R' if p and q and r: serial = 3 elif (p and q) or (q and r): serial = 2 elif p or q or r: serial = 1 else: serial = 0 print(serial)
p02582
s144275699
Accepted
s = input() if s == 'RRR': print(3) elif s[:2] == "RR" or s[1:] == "RR": print(2) elif 'R' in s: print(1) else: print(0)
p02582
s686682069
Accepted
s = input() for i in range(5): if "R"*i not in s: print(i-1) break
p02582
s437689917
Accepted
s = input() ans1 = 0 ans = 0 for i in range(3): if s[i]=="R": ans1 += 1 else: ans = ans1 ans1 = 0 if not s=="RSS": print(max(ans,ans1)) else: print("1")
p02582
s873622098
Accepted
S = input() if S[0] == 'R' and S[1] == 'R' and S[2] == 'R': print(3) elif (S[0] == 'R' and S[1] == 'R') or (S[1] == 'R' and S[2] == 'R'): print(2) elif S[0] == 'R' or S[1] == 'R' or S[2] == 'R' or (S[0] == 'R' and S[2] == 'R'): print(1) else: print(0)
p02582
s503013606
Accepted
s = input() if s.count("R") in [0,1,3]: print( s.count("R") ) else: if s == "RSR": print(1) else: print(2)
p02582
s431604315
Accepted
S = input() if 'RRR' == S: print(3) elif 'RR' in S: print(2) elif 'R' in S: print(1) else: print(0)
p02582
s444487217
Accepted
from sys import stdin input = stdin.readline s = input() a = b = c = 0 a = (s[0] == 'R') * 1 b = (s[1] == 'R') * (1 + a) c = (s[2] == 'R') * (1 + b) print(max(a, b, c))
p02582
s428869328
Accepted
a = input('') S = [] num = 0 for i in a: S.append(i) for j in range(3): if S[j] == 'R': num += 1 if num == 2 and S[1] == 'S': print(1) else: print(num)
p02582
s856789211
Accepted
S = input() cnt = 0 if S.count('R') == 0: cnt = 0 elif S.count('R') == 1: cnt = 1 elif S.count('R') == 3: cnt = 3 else : if S[1] == 'R': cnt = 2 else : cnt = 1 print(cnt)
p02582
s321786437
Accepted
s = input() cnt = 0 maxcnt = 0 for c in s: if c == 'R': cnt += 1 else: cnt = 0 if maxcnt < cnt: maxcnt = cnt print(maxcnt)
p02582
s308292585
Accepted
def main(): s = input() cnt = 0 cnt2 = 0 for i in s: if i == "R": cnt2 += 1 else: cnt = max(cnt, cnt2) cnt2 = 0 print(max(cnt, cnt2)) main()
p02582
s799682341
Accepted
S=input() if S[1-1]=='R': if S[2-1]=='R': if S[3-1]=='R': print(3) else: print(2) else: print(1) elif S[2-1]=='R': if S[3-1]=='R': print(2) else: print(1) elif S[3-1]=='R': print(1) else: print(0)
p02582
s894111984
Accepted
s = input() cnt = 0 if 'RRR' in s: print(3) elif 'RR' in s: print(2) elif 'R' in s: print(1) else: print(0)
p02582
s217976324
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
s291471056
Accepted
#!/usr/bin/env python # coding: utf-8 def ri(): return int(input()) def rl(): return list(input().split()) def rli(): return list(map(int, input().split())) def main(): s = input() if s == "RRR": print(3) elif "RR" in s: print(2) elif "R" in s: print(1) else: print(0) if __name__ == '__main__': main()
p02582
s001629648
Accepted
s=input() if s == 'RRR': print(3) elif s == 'SRR' or s == 'RRS': print(2) elif s == 'SSS': print(0) else: print(1)
p02582
s093405604
Accepted
S = input() ans = 0 if S == 'RRR': ans = 3 elif 'RR' in S: ans = 2 elif 'R' in S: ans = 1 print(ans)
p02582
s640314550
Accepted
import re x = input() pattern = "R+" pat = re.search(pattern, x) if pat: print(len(pat.group())) else: print(0)
p02582
s393004640
Accepted
W = list(input()) ans = [] a = 0 for i in W: if i == 'R': a += 1 else: ans.append(a) a = 0 ans.append(a) print(max(ans))
p02582
s105821039
Accepted
S=input() if S=="RSR": print(1) else: print(S.count("R"))
p02582
s329039656
Accepted
s = input() if s.count('RRR') == 1: print(3) elif s.count('RR') == 1: print(2) elif s.count('R'): print(1) else: print(0)
p02582
s744534563
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
s527132097
Accepted
LL = input() count = 0 maxcount = 0 for ll in LL: if ll == "R": count+= 1 else: count = 0 if maxcount <= count: maxcount = count print(maxcount)
p02582
s379680207
Accepted
s = input() if s[0] == 'R' and s[1] == 'R' and s[2] == 'R': print(3) elif s[0] == 'R' and s[1] == 'R': print(2) elif s[1] == 'R' and s[2] == 'R': print(2) elif s[0] == 'R' or s[1] == 'R' or s[2] == 'R': print(1) else: print(0)
p02582
s447925938
Accepted
# a,b = map(int, input().split()) s = input() c = s.count("R") if c == 1: print(c) elif c == 2: if s[0] == s[1]: print(c) elif s[1] == s[2]: print(c) else: print(1) elif c == 3: print(3) elif c == 0: print(0)
p02582
s740130034
Accepted
w=list(input()) n=len(w) S=0 S_max=S for i in range(n): if w[i]=='R': S+=1 j=0 while True: if i+j+1<=n-1: j+=1 if w[i+j]=='R': S+=1 else: i+=j break else: i=n-1 break S_max=max([S_max,S]) S=0 print(S_max)
p02582
s924094934
Accepted
s=str(input()) if s=="RRR": print(3) elif s=="RRS" or s=="SRR": print(2) elif s=="SSS": print(0) else: print(1)
p02582
s619991771
Accepted
d = input() if "RRR" in d: print("3") elif "RR" in d: print("2") elif "R" in d: print("1") else: print("0")
p02582
s518690734
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
s981309091
Accepted
#!/usr/bin/env python3 s = input() if s == "RRR": print(3) elif s== "RRS" or s=="SRR": print(2) elif s == "SSS": print(0) else: print(1)
p02582
s266067077
Accepted
s=input() ans = 0 if "R" in s: ans = 1 if s[0] == s[1] == "R": ans += 1 if s[1] == s[2] == "R": ans += 1 print(ans)
p02582
s647834681
Accepted
s = input() w = ["R","RR","RRR"] ans = 0 for i in range(3): if w[i] in s: ans = i + 1 print(ans)
p02582
s688637415
Accepted
s = input() if ("RRS" == s) or ("SRR" == s) : print(2) elif ("RSS" == s) or ("SRS" == s) or ("SSR" == s) or ("RSR" == s): print(1) elif ("SSS" == s): print(0) elif ("RRR" == s): print(3)
p02582
s424643379
Accepted
import sys import numpy as np X = str(input()) d = 0 s = 0 for i in X: if i == 'R': d += 1 else: if s < d: s = d d = 0 if s < d: s = d print(s)
p02582
s959985974
Accepted
S = input() if S[0] == S[1] == S[2] == 'R': print(3) elif S[0] == S[1] == 'R' or S[2] == S[1] == 'R': print(2) elif S[0] == S[1] == S[2] == 'S': print(0) else: print(1)
p02582
s461859734
Accepted
W = input() if 'RRR' in W: print(3) elif 'RR' in W: print(2) elif 'R' in W: print(1) else: print(0)
p02582
s184756821
Accepted
s = input() if "R" not in s: print(0) exit() ans = 1 for i in range(2): if s[i] == "R" and s[i+1] == "R": ans += 1 print(ans)
p02582
s745563841
Accepted
S = str(input()) a=0 if 'R'in S: a=1 if 'RR'in S: a=2 if 'RRR'in S: a=3 print(a)
p02582
s545179899
Accepted
s=input() c=0 m=0 flg=False for x in s: if x=="R" and flg:c+=1;m=max(m,c) if x=="R" and not flg: flg=True c=1 m=max(m,c) if x=="S": flg=False c=0 print(m)
p02582
s497576675
Accepted
s = input() ans = 0 if s == "RRR": ans = 3 if s == "RRS": ans = 2 if s == "RSR": ans = 1 if s == "RSS": ans = 1 if s == "SRR": ans = 2 if s == "SRS": ans = 1 if s == "SSR": ans = 1 if s == "SSS": ans = 0 print(ans)
p02582
s332945685
Accepted
s=input() if s=='RRR': print(3) elif s=='SRR': print(2) elif s=='RRS': print(2) elif s=='SSS': print(0) else: print(1)
p02582
s352191832
Accepted
ans = 0 tmp = 0 for s in input(): if s == 'R': tmp += 1 else: ans = max(ans,tmp) tmp = 0 print(max(ans,tmp))
p02582
s902424278
Accepted
S=input() ans=0 kouho=0 for i in range(len(S)): if S[i]=="R": kouho+=1 ans=max(ans,kouho) else: kouho=0 print(ans)
p02582
s560510806
Accepted
s = input() if s[1] == "R": print(s.count("R")) else: if "R" in s: print(1) else: print(0)
p02582
s379179271
Accepted
st = input() tmp=0 rt = 0 for i in range(len(st)): if st[i] == "R": tmp+=1 if tmp > rt: rt = tmp else: tmp = 0 print(rt)
p02582
s882633302
Accepted
S = input().rstrip() if S == "RRR": print(3) elif S=="SRR" or S=="RRS": print(2) elif S == "RSS" or S=="SRS" or S=="SSR" or S=="RSR": print(1) else: print(0)
p02582
s471472814
Accepted
S = input() count = 0 ans = 0 for i in range(3): if S[i] == "R": count += 1 ans = max(ans, count) else: ans = max(ans, count) count = 0 print(ans)
p02582
s349395850
Accepted
s = input() ans=0 if s.count("R")>0: ans = 1 if s[:2]=="RR": ans = 2 if s[1:]=="RR": ans = 2 if s == "RRR": ans = 3 print(ans)
p02582
s951609710
Accepted
s = input() record = list(s) n = 0 high_score = 0 yesterday = ' ' for today in record : ####### main if today == 'R': if yesterday == 'R' : n += 1 else : n = 1 ###### ato if high_score < n : high_score = n yesterday = today print(high_score)
p02582
s369419309
Accepted
S = list(input()) count = 0 ans = 0 for i in range(len(S)): if S[i] == 'R': count += 1 if ans < count: ans = count else: count = 0 print(ans)
p02582
s902313660
Accepted
s = input() if (s == "RRR"): print(3) elif (s[0] == s[1] == 'R' or s[1] == s[2] == 'R'): print(2) elif (s[0] == 'R' or s[1] == 'R' or s[2] == 'R'): print(1) else: print(0)
p02582
s778262738
Accepted
s = input() ans = 0 t = 0 for c in s: if c == "R": t += 1 else: ans = max(ans, t) t = 0 ans = max(ans, t) print(ans)
p02582
s275561102
Accepted
S =input() cnt = 0 cntmax = 0 for i in range(3): if S[i] == 'R': cnt+= 1 cntmax = max(cntmax, cnt) else: cnt =0 print(cntmax)
p02582
s046133723
Accepted
S = input() if S.find("RRR") == 0 : print(3) elif S.find("RR") >= 0 : print(2) elif S.find("R") >= 0 : print(1) else: print(0)
p02582
s361330824
Accepted
S=input() if S[0]==S[1]==S[2]: if S[0]=='R': print(3) else: print(0) elif S[0]==S[1]: if S[0]=='R': print(2) else: print(1) elif S[1]==S[2]: if S[1]=='R': print(2) else: print(1) else: print(1)
p02582
s427768631
Accepted
S = input() if S == 'RRR': print(3) elif S == 'SSS': print(0) elif S == 'SRR' or S == 'RRS': print(2) else: print(1)
p02582
s630343654
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
s384790585
Accepted
import re s=input() rs = [len(x) for x in re.findall("R{1,}", s)] if rs == []: print(0) else: print(max(rs))
p02582
s587814874
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
s805799877
Accepted
n = input().split('S') print(len(sorted(n,key=len, reverse=True)[0]))
p02582
s709887464
Accepted
S = input() if S == "RRR": print(3) elif S == "RRS": print(2) elif S == "SRR": print(2) elif S == "RSR": print(1) elif S == "SRS": print(1) elif S == "RSS": print(1) elif S == "SSR": print(1) else: print(0)
p02582
s235563228
Accepted
S = input() prev = True ans = 0 cnt = 0 for i in range(3): if S[i] == 'R': if prev: cnt += 1 else: prev = True cnt = 1 else: ans = max(ans, cnt) cnt = 0 prev = False print(max(ans, cnt))
p02582
s709871829
Accepted
s = input() if s == 'RSR': print(1) exit() ans = 0 for i in s: if i == 'R': ans += 1 print(ans)
p02582
s162033704
Accepted
S = input() a = "RRR" b = "RR" c = "R" if a == S: print(3) elif b in S: print(2) elif c in S: print(1) else: print(0)
p02582
s397159248
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
s007122828
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
s246206532
Accepted
s = input() if "R" in s: if "RR" in s: if "RRR" in s: print(3) else: print(2) else: print(1) else: print(0)
p02582
s279203104
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
s463380739
Accepted
s = input() ans = 0 if s[0] == "R": ans += 1 if s[1] == "R": ans += 1 if s[2] == "R": ans += 1 elif s[1] == "R": ans += 1 if s[2] == "R": ans += 1 elif s[2] == "R": ans += 1 print(ans)
p02582
s787753919
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
s733961347
Accepted
s = input() if s == "RRR" : print(3) elif s =="RRS" or s =="SRR" : print(2) elif "R" in s: print(1) else: print(0)
p02582
s311200549
Accepted
s = input() if (s == "RRR"): print(3) elif (s[0] == s[1] == 'R' or s[1] == s[2] == 'R'): print(2) elif (s[0] == 'R' or s[1] == 'R' or s[2] == 'R'): print(1) else: print(0)
p02582
s519123472
Accepted
S = input() if S[0] == 'R' and S[1] == 'R' and S[2] == 'R': print(3) elif (S[0] == 'R' and S[1] == 'R') or (S[1] == 'R' and S[2] == 'R'): print(2) elif S[0] == 'R' or S[1] == 'R' or S[2] == 'R': print(1) else: print(0)
p02582
s942233715
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
s850904984
Accepted
# input 長さ3の文字列 input_s = input(); output = 0; if "R" in input_s: output = 1; if "RR" in input_s: output = 2; if "RRR" in input_s: output = 3; print(output);
p02582
s727537464
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
s044735288
Accepted
s=input() if s=='SSS': print(0) elif s=='SSR': print(1) elif s=='SRS': print(1) elif s=='SRR': print(2) elif s=='RSS': print(1) elif s=='RSR': print(1) elif s=='RRS': print(2) elif s=='RRR': print(3)
p02582
s872403596
Accepted
X = input() if X =='RRR': print('3') elif X =='RRS' or X =='SRR': print('2') elif X =='RSS' or X =='SRS' or X =='SSR' or X =='RSR': print('1') elif X =='SSS': print('0')
p02582
s055100971
Accepted
s = input() if s.count('S') == 0: print(3) elif s[:2] == 'RR' or s[1:3] == 'RR': print(2) elif s[0] == 'R' and s[2] == 'R': print(1) elif s.count('R') == 1: print(1) else: print(0)
p02582
s560351042
Accepted
S = input() s = list(S) a = 0 for i in s: if i == 'R': a += 1 if a != 2: print(a) elif s[1] == 'R': print(2) else: print(1)
p02582
s199854871
Accepted
t = input() ans = 0 maxans = 0 for i in t: if i =="R": ans += 1 else: maxans = max(ans,maxans) ans = 0 print(max(maxans,ans))
p02582
s995456813
Accepted
s = input() ans = 0 if s.count("R") == 3: print(3) elif s.count("R") == 2: if s[0] == s[1] or s[1] == s[2]: print(2) else: print(1) elif s.count("R") == 1: print(1) else: print(0)
p02582
s268282972
Accepted
s = input() if s == 'RRS' or s == 'SRR': print(2) elif s == 'RRR': print(3) elif s == 'SSS': print(0) else: print(1)
p02582
s377623059
Accepted
S = list(input()) r_cnt = 0 max_r_cnt = 0 for s in S: if s == "R": r_cnt += 1 else: r_cnt = 0 max_r_cnt = max(r_cnt, max_r_cnt) print(max_r_cnt)
p02582
s780304009
Accepted
import sys def S(): return sys.stdin.readline().rstrip() S = S() if S == 'RRR': print(3) elif S == 'RRS' or S == 'SRR': print(2) elif S == 'SSS': print(0) else: print(1)
p02582
s836988333
Accepted
s=str(input()) if s=='RRR': print(3) if s=='RRS': print(2) if s=='RSR': print(1) if s=='SRR': print(2) if s=='RSS': print(1) if s=='SRS': print(1) if s=='SSR': print(1) if s=='SSS': print(0)
p02582
s262268578
Accepted
s=input() count=0 count1=0 for i in s: if i=='R': count+=1 if count1<count: count1=count else: count=0 print(count1)
p02582
s670811419
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
s924439050
Accepted
s = input() if 'RRR' in s: result = 3 elif 'RR' in s: result = 2 elif 'R' in s: result = 1 else: result = 0 print(result)
p02582
s730325525
Accepted
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)
p02582
s465452962
Accepted
def resolve(): 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) resolve()
p02582
s491639378
Accepted
S = input() s = list(S) if S == "RSR": print(1) else: print(s.count('R'))
p02582
s265474820
Accepted
def find(s): ans=0 for i in s: if i=="R": ans+=1 elif i=="S" and ans>0: return ans return ans s=input() print(find(s))
p02582
s791329425
Accepted
s = input() ans,cnt = 0,0 for l in s: if l=='R': cnt += 1 ans = max(ans,cnt) else: ans = max(cnt,ans) cnt = 0 print(ans)
p02582
s424601272
Accepted
S = input() if S == "RRR": print(3) elif "RR" in S: print(2) elif "R" in S: print(1) else: print(0)
p02582
s948457908
Accepted
s = input() if s == 'RRR' : print(3) if s == 'SRR' : print(2) if s == 'RSR' : print(1) if s == 'RRS' : print(2) if s == 'SSR' : print(1) if s == 'RSS' : print(1) if s == 'SRS' : print(1) if s == 'SSS' : print(0)