problem_id
stringlengths
6
6
user_id
stringlengths
10
10
time_limit
float64
1k
8k
memory_limit
float64
262k
1.05M
problem_description
stringlengths
48
1.55k
codes
stringlengths
35
98.9k
status
stringlengths
28
1.7k
submission_ids
stringlengths
28
1.41k
memories
stringlengths
13
808
cpu_times
stringlengths
11
610
code_sizes
stringlengths
7
505
p02954
u111473084
2,000
1,048,576
Given is a string S consisting of `L` and `R`. Let N be the length of S. There are N squares arranged from left to right, and the i-th character of S from the left is written on the i-th square from the left. The character written on the leftmost square is always `R`, and the character written on the rightmost square...
['import sys\nfrom operator import itemgetter\n\nsys.setrecursionlimit(10**9)\ninput = sys.stdin.readline\n\ndef ii(): return int(input())\ndef mi(): return map(int, input().split())\ndef lmi(): return list(map(int, input().split()))\ndef lmif(n): return [list(map(int, input().split())) for _ in range(n)]\ndef ss(): re...
['Time Limit Exceeded', 'Accepted']
['s560861282', 's386837958']
[9944.0, 10844.0]
[2206.0, 70.0]
[1083, 1114]
p02954
u116002573
2,000
1,048,576
Given is a string S consisting of `L` and `R`. Let N be the length of S. There are N squares arranged from left to right, and the i-th character of S from the left is written on the i-th square from the left. The character written on the leftmost square is always `R`, and the character written on the rightmost square...
['S = input()\nn = len(S)\n\noutput = []\n\ni = 0\nwhile i < n:\n countR = 0\n countL = 0\n while i < n and S[i] == "R":\n countR += 1\n i += 1\n while i < n and S[i] == "L":\n countL += 1\n i += 1\n output += [0]*(countR-1)\n if abs(countR - countL) % 2 == 0:\n outp...
['Wrong Answer', 'Runtime Error', 'Runtime Error', 'Wrong Answer', 'Runtime Error', 'Accepted']
['s212464131', 's252882127', 's368863307', 's401715585', 's799470203', 's840135498']
[4976.0, 3064.0, 4860.0, 4852.0, 3064.0, 10492.0]
[123.0, 17.0, 148.0, 116.0, 17.0, 82.0]
[673, 507, 806, 506, 497, 830]
p02954
u116038906
2,000
1,048,576
Given is a string S consisting of `L` and `R`. Let N be the length of S. There are N squares arranged from left to right, and the i-th character of S from the left is written on the i-th square from the left. The character written on the leftmost square is always `R`, and the character written on the rightmost square...
['\n\nS =input().strip()\nans=[0]*len(S)\ncount_R =0\ncount_L =0\n\nfor i in range(len(S)):\n if S[i]=="R":\n count_R +=1\n #continue\n else:\n even_num_R =count_R//2\n odd_num_R =count_R -even_num_R\n ans[i-1] +=odd_num_R\n ans[i] +=even_num_R\n count_R...
['Wrong Answer', 'Accepted']
['s234023909', 's438664340']
[6412.0, 6512.0]
[117.0, 126.0]
[899, 898]
p02954
u121698457
2,000
1,048,576
Given is a string S consisting of `L` and `R`. Let N be the length of S. There are N squares arranged from left to right, and the i-th character of S from the left is written on the i-th square from the left. The character written on the leftmost square is always `R`, and the character written on the rightmost square...
["import math\nS = input()\nRL = []\nLR = []\np = 'L'\npl = -1\nfor i in S:\n if i == 'L':\n if p == 'R':\n RL.append(pl)\n else:\n if p == 'L':\n LR.append(pl)\n p = i\n pl += 1\nLR.append(len(S)-1)\nc = [0 for j in range(len(S))]\nprint(RL)\nprint(LR)\nW = len(RL)\nfor ...
['Wrong Answer', 'Accepted']
['s356579957', 's692132479']
[15272.0, 14276.0]
[157.0, 140.0]
[539, 519]
p02954
u124498235
2,000
1,048,576
Given is a string S consisting of `L` and `R`. Let N be the length of S. There are N squares arranged from left to right, and the i-th character of S from the left is written on the i-th square from the left. The character written on the leftmost square is always `R`, and the character written on the rightmost square...
['import math\ns = input()\nv = [0 for i in range(len(s))]\nr,l = 0,0\nfor i in range(len(s)):\n\tif s[i] == "R":\n\t\tr += 1\n\telse:\n\t\tv[i-1] += r//2\n\t\tv[i] += math.ceil(r/2)\n\t\tr = 0\n\t\tl += 1\nv[-2] += 1\nprint (*v)\n', "s = input()\nv = [0 for i in range(len(s))]\nr,l = 0,0\nvis = [False for i in range(l...
['Wrong Answer', 'Accepted']
['s800641492', 's033856472']
[10756.0, 11616.0]
[92.0, 122.0]
[203, 420]
p02954
u124735330
2,000
1,048,576
Given is a string S consisting of `L` and `R`. Let N be the length of S. There are N squares arranged from left to right, and the i-th character of S from the left is written on the i-th square from the left. The character written on the leftmost square is always `R`, and the character written on the rightmost square...
["import sys\nfrom copy import deepcopy\nfrom collections import deque\nsys.setrecursionlimit(20000000)\n\n\ndef main():\n S = input()\n\n lines = deque()\n zero_lines = deque()\n\n longest = []\n c = 0\n last = 'R'\n for s in list(S):\n if s == last:\n c += 1\n else:\n ...
['Wrong Answer', 'Wrong Answer', 'Accepted']
['s149230889', 's776528943', 's221348962']
[63804.0, 6056.0, 7588.0]
[2107.0, 105.0, 137.0]
[973, 736, 743]
p02954
u134302690
2,000
1,048,576
Given is a string S consisting of `L` and `R`. Let N be the length of S. There are N squares arranged from left to right, and the i-th character of S from the left is written on the i-th square from the left. The character written on the leftmost square is always `R`, and the character written on the rightmost square...
['S = input()\ncount_R = 0\ncount_L = 0\nans = [0] * len(S)\ncal = True\nfor i in range(len(S)):\n if S[i] == "R" and cal:\n count_R += 1\n elif S[i] == "L":\n count_L += 1\n cal = False\n elif S[i] == "R" and not cal:\n if (count_R + count_L) % 4 == 3:\n if count_L < cou...
['Wrong Answer', 'Accepted']
['s144925803', 's183500813']
[5108.0, 10484.0]
[91.0, 98.0]
[1890, 501]
p02954
u143903328
2,000
1,048,576
Given is a string S consisting of `L` and `R`. Let N be the length of S. There are N squares arranged from left to right, and the i-th character of S from the left is written on the i-th square from the left. The character written on the leftmost square is always `R`, and the character written on the rightmost square...
["str = list(input())\nN = len(str)\nstr.append('EOF')\nans = [0] * N\ni = 0\ncountR = 0\ncountL = 0\n\nwhile str[i] != 'EOF':\n countR = 0\n countL = 0\n while str[i] == 'R':\n countR = countR + 1\n i = i + 1\n while str[i] == 'L':\n countL = countL + 1\n i = i + 1\n ans[i - ...
['Wrong Answer', 'Accepted']
['s617097550', 's048627798']
[7204.0, 9016.0]
[200.0, 144.0]
[462, 444]
p02954
u148981246
2,000
1,048,576
Given is a string S consisting of `L` and `R`. Let N be the length of S. There are N squares arranged from left to right, and the i-th character of S from the left is written on the i-th square from the left. The character written on the leftmost square is always `R`, and the character written on the rightmost square...
["s = input()\nn = len(s)\nR = [] # the number of consecutive 'R's on and toward the left\nL = [] # the number of consecutive 'L's on and toward the right \nans = []\n\ncnt = 0\nfor i in range(n):\n if s[i] == 'R':\n cnt += 1\n else:\n cnt = 0\n R.append(cnt)\nR.append(0)\n\ns = s[::-1]\ncnt =0\n...
['Wrong Answer', 'Accepted']
['s082894877', 's506030599']
[16440.0, 16072.0]
[123.0, 157.0]
[849, 1132]
p02954
u150664457
2,000
1,048,576
Given is a string S consisting of `L` and `R`. Let N be the length of S. There are N squares arranged from left to right, and the i-th character of S from the left is written on the i-th square from the left. The character written on the leftmost square is always `R`, and the character written on the rightmost square...
["S = input() \n\nN = len(S)\nnow = 'R'\nA_R = 0\nB_R = 0\nA_L = 0\nB_L = 0\nList = []\n\nfor i in range(N-1):\n if now == 'R' and S[i+1] == 'R':\n if A_R <= B_R:\n A_R += 1\n else:\n B_R += 1\n\n elif now == 'L' and S[i+1] == 'L':\n if A_L <= B_L:\n A_L += 1\...
['Wrong Answer', 'Accepted']
['s120388268', 's784056366']
[5108.0, 6408.0]
[123.0, 185.0]
[1689, 1139]
p02954
u151005508
2,000
1,048,576
Given is a string S consisting of `L` and `R`. Let N be the length of S. There are N squares arranged from left to right, and the i-th character of S from the left is written on the i-th square from the left. The character written on the leftmost square is always `R`, and the character written on the rightmost square...
["S=input()\nN=len(S)\nchildren=[1]*N\ndef next(children):\n new_children=[0]*N\n for i in range(N):\n if S[i]=='L':\n new_children[i-1]+=children[i]\n else:\n new_children[i+1]+=children[i]\n return new_children\n\nchange=[]\ncount=0\nwhile True:\n\n #print(children)\n ...
['Wrong Answer', 'Wrong Answer', 'Runtime Error', 'Accepted']
['s596169187', 's740270536', 's993552001', 's197581743']
[106740.0, 5108.0, 106740.0, 10612.0]
[2110.0, 141.0, 2110.0, 148.0]
[573, 955, 593, 967]
p02954
u157020659
2,000
1,048,576
Given is a string S consisting of `L` and `R`. Let N be the length of S. There are N squares arranged from left to right, and the i-th character of S from the left is written on the i-th square from the left. The character written on the leftmost square is always `R`, and the character written on the rightmost square...
["s = input()\nn = len(s)\nr, l = 0, 0\nodd, even = 0, 0\nans = [0] * n\nfor i in range(n):\n if i % 2 == 0:\n even += 1\n else:\n odd += 1\n if i == n - 1 or s[i] != s[i + 1]:\n if s[i] == 'R':\n r, l = i, i + 1\n if (r % 2 == 0 and s[i] == 'R') or (r % 2 == 1 and s[i] =...
['Wrong Answer', 'Accepted']
['s410979584', 's168420961']
[11544.0, 11592.0]
[115.0, 102.0]
[478, 345]
p02954
u158778550
2,000
1,048,576
Given is a string S consisting of `L` and `R`. Let N be the length of S. There are N squares arranged from left to right, and the i-th character of S from the left is written on the i-th square from the left. The character written on the leftmost square is always `R`, and the character written on the rightmost square...
['s = input()\nans = [0]*len(s)\ncounter = 1\nRLSwitch = 0 # if start from "R", 0 else 1\nfor i in range(1, len(s)):\n if RLSwitch == 0:\n if s[i] == "L":\n pos = i\n if counter % 2 == 1:\n ans[i-1] += counter // 2 + 1\n ans[i] += counter // 2\n e...
['Wrong Answer', 'Accepted']
['s554488594', 's297473096']
[6528.0, 10484.0]
[126.0, 138.0]
[1131, 409]
p02954
u162660367
2,000
1,048,576
Given is a string S consisting of `L` and `R`. Let N be the length of S. There are N squares arranged from left to right, and the i-th character of S from the left is written on the i-th square from the left. The character written on the leftmost square is always `R`, and the character written on the rightmost square...
['S=input().strip()\ns="R"\ncut_l = 0\nss=[]\nfor i,c in enumerate(S):\n if c!=s:\n if s=="R":\n s="L"\n else:\n ss.append(S[cut_l:i])\n cut_l = i\n s="R"\nss.append(S[cut_l:])\nseps = [s.index("L")for s in ss]\nress = []\nfor s,idx in zip(ss,seps):\n \n ...
['Wrong Answer', 'Accepted']
['s889198305', 's787263953']
[10980.0, 10980.0]
[169.0, 170.0]
[520, 521]
p02954
u163320134
2,000
1,048,576
Given is a string S consisting of `L` and `R`. Let N be the length of S. There are N squares arranged from left to right, and the i-th character of S from the left is written on the i-th square from the left. The character written on the leftmost square is always `R`, and the character written on the rightmost square...
["s=input()+'R'\nl=len(s)\nans=[0]*(l-1)\nrcnt=0\nlcnt=0\nrpos=0\nlpos=0\nflag=0\nfor i in range(l):\n if s[i]=='R':\n if flag==1:\n if rcnt%2==0:\n ans[rpos]+=rcnt//2+1\n ans[lpos]+=rcnt//2\n else:\n ans[rpos]+=rcnt//2\n ans[lpos]+=rcnt//2\n if lcnt%2==0:\n ans[rpo...
['Wrong Answer', 'Accepted']
['s344245967', 's336359526']
[6400.0, 6400.0]
[119.0, 120.0]
[548, 548]
p02954
u168139048
2,000
1,048,576
Given is a string S consisting of `L` and `R`. Let N be the length of S. There are N squares arranged from left to right, and the i-th character of S from the left is written on the i-th square from the left. The character written on the leftmost square is always `R`, and the character written on the rightmost square...
["import numpy as np\nimport math\nimport sys\nsys.setrecursionlimit(10000000)\n\ndef make_successive_count(S: str):\n X = []\n N = len(S)\n num = 1\n for i in range(N - 1):\n if S[i] == S[i + 1]:\n num += 1\n else:\n X.append(num)\n num = 1\n if num != 1:\n...
['Wrong Answer', 'Accepted']
['s873189582', 's475594807']
[15460.0, 15460.0]
[210.0, 394.0]
[1838, 1969]
p02954
u175590965
2,000
1,048,576
Given is a string S consisting of `L` and `R`. Let N be the length of S. There are N squares arranged from left to right, and the i-th character of S from the left is written on the i-th square from the left. The character written on the leftmost square is always `R`, and the character written on the rightmost square...
['s = input()\nn = len(s)\n\nans = [1]*n\nfor i,a in enumerate(s):\n if a =="R":\n a2 = s[i+1]\n if a2 =="R":\n ans[i+2] += ans[i]\n ans[i] = 0\n\nfor i in range(n-1,-1,-1):\n a = s[i]\n if a =="L":\n a2 = a[i-1]\n if a2 =="L":\n ans[i-2] += ans[i]\n...
['Runtime Error', 'Runtime Error', 'Runtime Error', 'Accepted']
['s469491726', 's842965079', 's929911090', 's542473298']
[3956.0, 2940.0, 2940.0, 6400.0]
[65.0, 17.0, 17.0, 121.0]
[335, 337, 337, 335]
p02954
u176645218
2,000
1,048,576
Given is a string S consisting of `L` and `R`. Let N be the length of S. There are N squares arranged from left to right, and the i-th character of S from the left is written on the i-th square from the left. The character written on the leftmost square is always `R`, and the character written on the rightmost square...
["S = input()\nN = len(S)\n\nls = []\nn = 0\nc = ['R','L']\ncn = 0\nfor s in S[1:]:\n\tn = n + 1\n\tif not s == c[cn]:\n\t\tcn = (cn + 1) % 2\n\t\tls.append(n)\n\t\tn = 0\nls.append(n+1)\n\npt = len(ls)//2\n\nans = [0] * N\npos = 0\nfor i in range(pt):\n\trn = ls[2*i]\n\tln = ls[2*i+1]\n\tpos += rn\n\tm = (rn+ln)//2\n\...
['Wrong Answer', 'Accepted']
['s216829313', 's943891104']
[5752.0, 5384.0]
[106.0, 107.0]
[476, 503]
p02954
u178192749
2,000
1,048,576
Given is a string S consisting of `L` and `R`. Let N be the length of S. There are N squares arranged from left to right, and the i-th character of S from the left is written on the i-th square from the left. The character written on the leftmost square is always `R`, and the character written on the rightmost square...
["s = input()\nn = len(s)\nans_list = [0] * n\n\ncnt_odd = 0\ncnt_even = 0\n\nfor i in range(n):\n if i == n-1:\n break\n if s[i] == 'R' and s[i+1]=='R' and i%2==0:\n cnt_odd +=1\n elif s[i] == 'R' and s[i+1]=='R' and i%2==1:\n cnt_even +=1\n elif s[i] =='R' and i%2==0:\n ans_l...
['Wrong Answer', 'Accepted']
['s365396048', 's618946228']
[10612.0, 10612.0]
[185.0, 190.0]
[1094, 1094]
p02954
u178465329
2,000
1,048,576
Given is a string S consisting of `L` and `R`. Let N be the length of S. There are N squares arranged from left to right, and the i-th character of S from the left is written on the i-th square from the left. The character written on the leftmost square is always `R`, and the character written on the rightmost square...
['import re\n\ncontent = input()\npattern = \'R+L+\'\n\nresults = re.findall(pattern, content)\n\n\nans = [0] * len(content) \npos = 0\nfor s in results:\n print(s)\n\n rcnt = s.count("R")\n lcnt = len(s)-rcnt\n\n r = l = 0\n x = rcnt//2 + lcnt//2\n r += x\n l += x\n if rcnt%2 == 1: l += 1\n ...
['Wrong Answer', 'Accepted']
['s683160686', 's098807397']
[10180.0, 9712.0]
[168.0, 141.0]
[406, 407]
p02954
u185325486
2,000
1,048,576
Given is a string S consisting of `L` and `R`. Let N be the length of S. There are N squares arranged from left to right, and the i-th character of S from the left is written on the i-th square from the left. The character written on the leftmost square is always `R`, and the character written on the rightmost square...
["S = input()\nstart_posi = [int(i) for i in range(len(S))]\ncnt = 0\n\nposi = start_posi\npre_posi = {}\nnext_posi = start_posi\nwhile not posi in pre_posi.values():\n pre_posi[cnt] = next_posi\n next_posi = []\n for i in posi:\n next_posi.append(i + 1 if S[i] == 'R' else i - 1) \n posi = ne...
['Wrong Answer', 'Accepted']
['s101218232', 's408799417']
[464260.0, 23372.0]
[2133.0, 225.0]
[706, 443]
p02954
u188366988
2,000
1,048,576
Given is a string S consisting of `L` and `R`. Let N be the length of S. There are N squares arranged from left to right, and the i-th character of S from the left is written on the i-th square from the left. The character written on the leftmost square is always `R`, and the character written on the rightmost square...
['a = input()\nprint(len(a))\ns = []\nk = a[0]\ncount = 1\nfor li in range(len(a)-1):\n i = li + 1\n if k == \'R\' and a[i] == "R":\n count = count + 1\n if k == \'L\' and a[i] == "L":\n count = count + 1\n if k == \'R\' and a[i] == "L":\n s.append(count)\n count = 1\n k =...
['Wrong Answer', 'Wrong Answer', 'Accepted']
['s249745922', 's343038168', 's246353084']
[7556.0, 7556.0, 7160.0]
[182.0, 186.0, 176.0]
[650, 650, 627]
p02954
u189487046
2,000
1,048,576
Given is a string S consisting of `L` and `R`. Let N be the length of S. There are N squares arranged from left to right, and the i-th character of S from the left is written on the i-th square from the left. The character written on the leftmost square is always `R`, and the character written on the rightmost square...
["S = input()\nN = len(S)\nans = [0]*N\n\ncnt = 0\nfor i in range(N-1):\n if S[i] == 'R':\n cnt += 1\n if S[i+1] == 'L':\n ans[i+1] += cnt//2\n ans[i] += (cnt+1)//2\n else:\n cnt = 0\n\n\ncnt = 0\nfor i in reversed(range(N-1)):\n if S[i] == 'L':\n cnt += 1\n ...
['Wrong Answer', 'Accepted']
['s794087954', 's426097597']
[6400.0, 17220.0]
[133.0, 116.0]
[425, 792]
p02954
u193927973
2,000
1,048,576
Given is a string S consisting of `L` and `R`. Let N be the length of S. There are N squares arranged from left to right, and the i-th character of S from the left is written on the i-th square from the left. The character written on the leftmost square is always `R`, and the character written on the rightmost square...
['\n s=input()\nls=len(s)\nnow=[1]*ls\nchlist=[]\nwhile(1):\n tmp=[0]*ls\n for i in range(ls):\n if s[i]=="R":\n tmp[i+1]+=now[i]\n else:\n tmp[i-1]+=now[i]\n now=tmp\n if now in chlist:\n st=chlist.index(now)\n break\n else:\n chlist.append(now)\nch=chlist[st:]\nidx=(10*100-st)%len(ch)-1...
['Runtime Error', 'Accepted']
['s815081047', 's403265533']
[2940.0, 10876.0]
[17.0, 104.0]
[350, 355]
p02954
u203843959
2,000
1,048,576
Given is a string S consisting of `L` and `R`. Let N be the length of S. There are N squares arranged from left to right, and the i-th character of S from the left is written on the i-th square from the left. The character written on the leftmost square is always `R`, and the character written on the rightmost square...
['times=10**100\nS=input()\n\nstart=-1\ncycle=-1\n\nclist=[1]*len(S)\ndic_list={}\nfor i in range(1,10): \n new_clist=[0]*len(S)\n for j,s in enumerate(S):\n if s=="L":\n new_clist[j-1]+=clist[j]\n elif s=="R":\n new_clist[j+1]+=clist[j]\n\n clist=new_clist\n #print(clist)\n \n if str(clist) in d...
['Runtime Error', 'Accepted']
['s475659089', 's030786676']
[10836.0, 10484.0]
[411.0, 94.0]
[532, 688]
p02954
u211236379
2,000
1,048,576
Given is a string S consisting of `L` and `R`. Let N be the length of S. There are N squares arranged from left to right, and the i-th character of S from the left is written on the i-th square from the left. The character written on the leftmost square is always `R`, and the character written on the rightmost square...
["for i, s in enumerate(S):\n if i != len(S)-1:\n if s == 'R':\n if S[i+1] == 'R':\n R_counter += 1\n else:\n R_counter += 1\n index_save = i\n if s == 'L':\n if S[i+1] == 'L':\n L_counter += 1\n els...
['Runtime Error', 'Accepted']
['s137037163', 's364039979']
[3064.0, 6400.0]
[17.0, 132.0]
[748, 819]
p02954
u214561383
2,000
1,048,576
Given is a string S consisting of `L` and `R`. Let N be the length of S. There are N squares arranged from left to right, and the i-th character of S from the left is written on the i-th square from the left. The character written on the leftmost square is always `R`, and the character written on the rightmost square...
['s = input()\ns_befo = s[0]\ns_ans = []\ntmp_num = 1\nfor i in s[1:]:\n if i == s_befo:\n tmp_num+=1\n else:\n s_ans.append(tmp_num)\n tmp_num=1\n s_befo = i\ns_ans.append(tmp_num)\n\nans = []\nkurikosi = 0\nis_R = True\nfor j in s_ans:\n if is_R:\n for i in range(j-1):\n ...
['Wrong Answer', 'Accepted']
['s036300734', 's870544618']
[5752.0, 11256.0]
[126.0, 142.0]
[568, 588]
p02954
u216752093
2,000
1,048,576
Given is a string S consisting of `L` and `R`. Let N be the length of S. There are N squares arranged from left to right, and the i-th character of S from the left is written on the i-th square from the left. The character written on the leftmost square is always `R`, and the character written on the rightmost square...
["n=list(str(m) for m in input())\n\nif n[1]=='L':\n n[0]=1\nelse:\n n[0]=0\n \nr_count=1\nl_count=0\nl_start=0\nfor i in range(1,len(n)-1):\n if n[i]=='R':\n r_count += 1\n n[i]=0\n if n[i+1]=='L':\n n[i]=r_count\n l_count=0\n else:\n l_count += 1\n n...
['Wrong Answer', 'Accepted']
['s481451830', 's652940581']
[10448.0, 11280.0]
[188.0, 170.0]
[962, 1155]
p02954
u223904637
2,000
1,048,576
Given is a string S consisting of `L` and `R`. Let N be the length of S. There are N squares arranged from left to right, and the i-th character of S from the left is written on the i-th square from the left. The character written on the leftmost square is always `R`, and the character written on the rightmost square...
["s=list(input())\nn=len(s)\nans=[0]*n\n\nf=0\nfor i in range(n):\n if s[i]=='R':\n f+=1\n else:\n if f>0:\n ans[i-1]+=(f+1)//2\n ans[i]+=(f-1)//2\n f=0\nf=0\nfor i in range(n):\n if s[n-1-i]=='L':\n f+=1\n else:\n if f>0:\n ans[n-i]+=(...
['Wrong Answer', 'Wrong Answer', 'Accepted']
['s269425829', 's865207519', 's206177468']
[5552.0, 5552.0, 5552.0]
[200.0, 197.0, 201.0]
[419, 420, 412]
p02954
u228223940
2,000
1,048,576
Given is a string S consisting of `L` and `R`. Let N be the length of S. There are N squares arranged from left to right, and the i-th character of S from the left is written on the i-th square from the left. The character written on the leftmost square is always `R`, and the character written on the rightmost square...
['s = input()\n\ns = s.replace(\'RL\',\'A\')\n\nr_num = 0\nl_num = 0\n\nl = []\nr = []\nprint(s)\nnow = "l"\nfor i in range(len(s)):\n if i == len(s) - 1 and s[i] == \'L\':\n l.append(l_num+1)\n if s[i] == \'A\':\n if s[i-1] == \'R\':\n r.append(r_num)\n r_num = 0\n ...
['Runtime Error', 'Accepted']
['s711879043', 's471588681']
[7892.0, 7168.0]
[156.0, 141.0]
[1181, 572]
p02954
u235376569
2,000
1,048,576
Given is a string S consisting of `L` and `R`. Let N be the length of S. There are N squares arranged from left to right, and the i-th character of S from the left is written on the i-th square from the left. The character written on the leftmost square is always `R`, and the character written on the rightmost square...
['S=input()\nnagasa=len(S)\nR_flag=0\nL_flag=0\nj=0\nn=0\nans=[0 for i in range(nagasa)]\n\nfor i in range(nagasa):\n now=S[i]\n if now=="R":\n R_flag=1\n j=i\n n=0\n while(R_flag==1):\n if j+n<nagasa-1:\n n+=1\n if S[j+n]=="L" or nagasa-1==j+n:\n R_flag=0\n break\n\n if ...
['Time Limit Exceeded', 'Wrong Answer', 'Wrong Answer', 'Accepted']
['s490091658', 's607386164', 's614461422', 's819917520']
[4976.0, 4976.0, 4856.0, 6400.0]
[2104.0, 2104.0, 2104.0, 130.0]
[910, 924, 743, 300]
p02954
u239342230
2,000
1,048,576
Given is a string S consisting of `L` and `R`. Let N be the length of S. There are N squares arranged from left to right, and the i-th character of S from the left is written on the i-th square from the left. The character written on the leftmost square is always `R`, and the character written on the rightmost square...
['S=input()\nSL=S.split(\'LR\')\n\nans=[]\nfor i in range(len(SL)):\n\n if i==0:\n arr=[0]*(len(SL[i])+1)\n mrk=SL[i].count(\'R\')-1\n elif i==len(SL)-1:\n arr=[0]*(len(SL[i])+1)\n mrk=SL[i].count(\'R\')\n else:\n arr=[0]*(len(SL[i])+2)\n mrk=SL[i].count(\'R\')\n if...
['Wrong Answer', 'Wrong Answer', 'Accepted']
['s302275836', 's486533629', 's896991429']
[11380.0, 11380.0, 6400.0]
[142.0, 152.0, 126.0]
[542, 459, 637]
p02954
u248670337
2,000
1,048,576
Given is a string S consisting of `L` and `R`. Let N be the length of S. There are N squares arranged from left to right, and the i-th character of S from the left is written on the i-th square from the left. The character written on the leftmost square is always `R`, and the character written on the rightmost square...
['S = list(input())\nL = len(S)\nr = 0\nl = 0\nans = [0 for i in range(L)]\nwhile l < L and r < L:\n if S[r] == \'R\':\n if S[r] == S[l]:\n l += 1\n else:\n ans[l] += ((l - r) // 2) + 1\n ans[l - 1] += ((l - r) // 2) + 1\n r = l\n else:\n if S[l] ==...
['Wrong Answer', 'Accepted']
['s434436770', 's882244592']
[5540.0, 10484.0]
[2104.0, 137.0]
[491, 472]
p02954
u250583425
2,000
1,048,576
Given is a string S consisting of `L` and `R`. Let N be the length of S. There are N squares arranged from left to right, and the i-th character of S from the left is written on the i-th square from the left. The character written on the leftmost square is always `R`, and the character written on the rightmost square...
["import sys\nimport math\nimport itertools\ndef input(): return sys.stdin.readline().rstrip()\n\ndef main():\n s = list(input())\n g = itertools.groupby(s)\n ans = []\n for key, group in g:\n if key == 'R':\n r = len(tuple(group))\n continue\n l = len(tuple(group))\n\n ...
['Wrong Answer', 'Accepted']
['s593687620', 's173541612']
[6436.0, 7844.0]
[151.0, 173.0]
[482, 483]
p02954
u254871849
2,000
1,048,576
Given is a string S consisting of `L` and `R`. Let N be the length of S. There are N squares arranged from left to right, and the i-th character of S from the left is written on the i-th square from the left. The character written on the leftmost square is always `R`, and the character written on the rightmost square...
['# 2019-11-16 10:55:08(JST)\nimport sys\n# import collections\n# import math\n# from string import ascii_lowercase, ascii_uppercase, digits\n# from bisect import bisect_left as bi_l, bisect_right as bi_r\n# import itertools\n# from functools import reduce\n# import operator as op\n# from scipy.misc import comb # float...
['Runtime Error', 'Accepted']
['s164552421', 's694646389']
[2940.0, 9084.0]
[17.0, 102.0]
[1393, 616]
p02954
u255673886
2,000
1,048,576
Given is a string S consisting of `L` and `R`. Let N be the length of S. There are N squares arranged from left to right, and the i-th character of S from the left is written on the i-th square from the left. The character written on the leftmost square is always `R`, and the character written on the rightmost square...
['s = input()\n\nans = []\np = s.count("LR")\nprint(p)\nfor i in range(p+1):\n k = s.find("LR")\n if k==-1:\n k=len(s)-1\n a = [0]*(k+1)\n numR = s[:k+1].count("R")\n numL = k+1-numR\n l = numR-1\n a[l] = (numR+1)//2 + (numL)//2\n a[l+1] = (numR)//2 + (numL+1)//2\n ans = ans + a\n s...
['Wrong Answer', 'Accepted']
['s776013232', 's208396409']
[11180.0, 10484.0]
[2104.0, 144.0]
[350, 528]
p02954
u255898796
2,000
1,048,576
Given is a string S consisting of `L` and `R`. Let N be the length of S. There are N squares arranged from left to right, and the i-th character of S from the left is written on the i-th square from the left. The character written on the leftmost square is always `R`, and the character written on the rightmost square...
['# Your code here!\na = input()\nb = int(len(a))\nc = []\n\nfor i in range(b):\n c.append(int(0))\n\nd = str()\n\nif a[b-1] == "L":\n d = "R"\nelse:\n d = "L"\n\na = a+d\n\ntemp = int(1)\n\nfor i in range(b):\n if a[i] == a[i+1]:\n c[i] += 0\n temp += 1\n elif a[i] != a[i+1] and a[i] == "R...
['Wrong Answer', 'Accepted']
['s225584816', 's798045075']
[10560.0, 17260.0]
[106.0, 123.0]
[487, 508]
p02954
u261646994
2,000
1,048,576
Given is a string S consisting of `L` and `R`. Let N be the length of S. There are N squares arranged from left to right, and the i-th character of S from the left is written on the i-th square from the left. The character written on the leftmost square is always `R`, and the character written on the rightmost square...
['S = input()\n\ncount = 0\nletter = "R"\n\nend = [0] * len(S)\n\nfor i, s in enumerate(S + "E"):\n if s == letter:\n count += 1\n else:\n odds = (count + 1) // 2\n evens = count // 2\n if s == "L":\n end[i] += evens\n end[i - 1] += odds\n else:\n ...
['Wrong Answer', 'Accepted']
['s211172435', 's061937198']
[4976.0, 10356.0]
[96.0, 110.0]
[415, 469]
p02954
u265506056
2,000
1,048,576
Given is a string S consisting of `L` and `R`. Let N be the length of S. There are N squares arranged from left to right, and the i-th character of S from the left is written on the i-th square from the left. The character written on the leftmost square is always `R`, and the character written on the rightmost square...
['S=list(input())\nS.append(0)\ncount=0\npeople=0\nx=[]\nx.append(-1)\ny=[]\nz=[]\nfor i in range(10**5):\n if S[i]==0:\n All = i\n y.append(0)\n break\n if S[i]==\'L\':\n if S[i+1]=="R":\n x.append(i)\n if S[i+1]==0:\n x.append(i)\n if S[i]=="R":\n ...
['Wrong Answer', 'Runtime Error', 'Runtime Error', 'Accepted']
['s015512158', 's164983236', 's649187245', 's993580722']
[7764.0, 7840.0, 7876.0, 11020.0]
[67.0, 121.0, 132.0, 149.0]
[348, 587, 830, 811]
p02954
u268318377
2,000
1,048,576
Given is a string S consisting of `L` and `R`. Let N be the length of S. There are N squares arranged from left to right, and the i-th character of S from the left is written on the i-th square from the left. The character written on the leftmost square is always `R`, and the character written on the rightmost square...
["s = input()\nr = []\nfor _ in range(s.count('LR')):\n idx = s.index('LR')+1\n tmp = s[:idx]\n s = s[idx:]\n r.append([tmp, tmp.index('RL'), tmp.count('R'), tmp.count('L')])\nr.append([s, s.index('RL'), s.count('R'), s.count('L')])\nprint(r)\nT = []\nfor i, j, R, L in r:\n tmp = [0]*len(i)\n if len(...
['Wrong Answer', 'Accepted']
['s503988332', 's633431926']
[15724.0, 14868.0]
[324.0, 304.0]
[755, 843]
p02954
u276204978
2,000
1,048,576
Given is a string S consisting of `L` and `R`. Let N be the length of S. There are N squares arranged from left to right, and the i-th character of S from the left is written on the i-th square from the left. The character written on the leftmost square is always `R`, and the character written on the rightmost square...
["def solve():\n S = input()\n\n s = [0 for _ in range(len(S))]\n for i, si in enumerate(S):\n if si == 'R':\n t = S[i:].index('L')\n if t % 2 == 0:\n s[i+t] += 1\n else:\n s[i+t-1] += 1\n else:\n t = S[:i].rfind('R')\n ...
['Wrong Answer', 'Accepted']
['s715948523', 's227594920']
[4760.0, 5516.0]
[457.0, 478.0]
[451, 452]
p02954
u277104886
2,000
1,048,576
Given is a string S consisting of `L` and `R`. Let N be the length of S. There are N squares arranged from left to right, and the i-th character of S from the left is written on the i-th square from the left. The character written on the leftmost square is always `R`, and the character written on the rightmost square...
['import math\ns = input()\nn = len(s)\nans = [0 for _ in range(n)]\n\ncount = 0\n\nfor i in range(n):\n if s[i] == "R":\n count += 1\n elif s[i] == "L" and count != 0:\n ans[i] += 1 + math.ceil((count-1)/2)\n ans[i-1] += 1 + math.floor((count-1)/2)\n count = 0\n\ncount = 0\nfor i in r...
['Wrong Answer', 'Accepted']
['s093897969', 's310199201']
[9960.0, 17172.0]
[130.0, 102.0]
[531, 495]
p02954
u278356323
2,000
1,048,576
Given is a string S consisting of `L` and `R`. Let N be the length of S. There are N squares arranged from left to right, and the i-th character of S from the left is written on the i-th square from the left. The character written on the leftmost square is always `R`, and the character written on the rightmost square...
['# ABC136d\nimport sys\nimport re\nimport math\ninput = sys.stdin.readline\nsys.setrecursionlimit(10**6)\n\ns = input()\nl = re.findall("R+L+", s)\nans = []\n\n# print(l)\n\nfor i in l:\n R = math.ceil((i.count("R")-1)/2) + math.ceil(i.count("L")/2)\n L = math.ceil(i.count("R")/2) + math.ceil((i.count("L")-1)/2)...
['Wrong Answer', 'Accepted']
['s990508726', 's569862198']
[8308.0, 11448.0]
[169.0, 135.0]
[557, 801]
p02954
u280809964
2,000
1,048,576
Given is a string S consisting of `L` and `R`. Let N be the length of S. There are N squares arranged from left to right, and the i-th character of S from the left is written on the i-th square from the left. The character written on the leftmost square is always `R`, and the character written on the rightmost square...
['s = str(input())\n\ncur = "R"\ncount = 0\nresult = [0]*len(s)\n\nfor idx, char in enumerate(s):\n if cur == "R":\n if char == "R":\n count += 1\n else:\n result[idx-1] += count // 2\n result[idx] += count - count // 2\n cur = "L"\n count = 1\n ...
['Wrong Answer', 'Time Limit Exceeded', 'Accepted']
['s065348492', 's162175191', 's063383855']
[6400.0, 5876.0, 6400.0]
[108.0, 2104.0, 111.0]
[529, 662, 752]
p02954
u282228874
2,000
1,048,576
Given is a string S consisting of `L` and `R`. Let N be the length of S. There are N squares arranged from left to right, and the i-th character of S from the left is written on the i-th square from the left. The character written on the leftmost square is always `R`, and the character written on the rightmost square...
["s = input()+'R'\ndp = [0] * (len(s))\nrr = 0\nll = 0\nfor i in range(len(s) - 2):\n if (s[i] == 'R'): rr += 1\n else: ll += 1\n if (s[i] == 'R' and s[i + 1] == 'L'):\n l = i\n r = i+1\n if (s[i] == 'L' and s[i + 1] == 'R'):\n dp[l] = (ll+rr) // 2\n dp[r] = (ll + rr) // 2\n ...
['Wrong Answer', 'Accepted']
['s396704114', 's394697213']
[6376.0, 6376.0]
[138.0, 139.0]
[626, 626]
p02954
u289288647
2,000
1,048,576
Given is a string S consisting of `L` and `R`. Let N be the length of S. There are N squares arranged from left to right, and the i-th character of S from the left is written on the i-th square from the left. The character written on the leftmost square is always `R`, and the character written on the rightmost square...
["s = input()\na = [0]*len(s)\nr, l = 0, 0\n\nfor i in range(len(s)):\n r += 1\n if s[i] == 'L':\n a[i-1] += r//2\n a[i] += (r+1)//2\n r = 0\nprint(a)\nfor j in range(len(s)-1, -1, -1):\n l += 1\n if s[j] == 'R':\n a[j+1] += l//2\n a[j] += (l+1)//2\n l = 0\n a[j]...
['Wrong Answer', 'Accepted']
['s884725624', 's426279969']
[10812.0, 10776.0]
[106.0, 102.0]
[319, 319]
p02954
u294211484
2,000
1,048,576
Given is a string S consisting of `L` and `R`. Let N be the length of S. There are N squares arranged from left to right, and the i-th character of S from the left is written on the i-th square from the left. The character written on the leftmost square is always `R`, and the character written on the rightmost square...
["import sys\ninput = sys.stdin.readline\nimport math\n\ns = input()\n\ncut_n = []\ncut_s = []\n\npre_s = 'R'\ncount = 0\nfor i in range(len(s)):\n if pre_s == s[i]:\n count += 1\n else:\n cut_n.append(count)\n cut_s.append(pre_s)\n pre_s = s[i]\n count = 1\n\ns = s[:len(s)-1]\n...
['Wrong Answer', 'Accepted']
['s997910897', 's511036138']
[6436.0, 11924.0]
[163.0, 183.0]
[660, 703]
p02954
u296518383
2,000
1,048,576
Given is a string S consisting of `L` and `R`. Let N be the length of S. There are N squares arranged from left to right, and the i-th character of S from the left is written on the i-th square from the left. The character written on the leftmost square is always `R`, and the character written on the rightmost square...
['s=input()\n#s="RRLLLLRLRRLL"\na = [0] * len(s)\nl_first = 0\nr_first = 0\n\nfor i in range(len(s)):\n ii =len(s)-i-1\n if s[ii] == "R":\n if r_first==0:\n d = len(s)-ii-1\n r_first=ii\n a[ii+1]+=int(d/2)+d%2\n a[ii]+=int(d/2)\n else:\n d = -ii...
['Runtime Error', 'Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Accepted']
['s166581487', 's346264726', 's467214089', 's635852824', 's920441082', 's922452061', 's865309988']
[4084.0, 4980.0, 4852.0, 5620.0, 3064.0, 5620.0, 10612.0]
[139.0, 142.0, 2104.0, 2104.0, 17.0, 2104.0, 162.0]
[720, 716, 406, 430, 717, 430, 735]
p02954
u296557772
2,000
1,048,576
Given is a string S consisting of `L` and `R`. Let N be the length of S. There are N squares arranged from left to right, and the i-th character of S from the left is written on the i-th square from the left. The character written on the leftmost square is always `R`, and the character written on the rightmost square...
["direction = input()\n\ndef next(direction, current):\n\toutput = [0] * len(current)\n\n\tfor i in range(len(direction)):\n\t\tif direction[i] == 'R':\n\t\t\toutput[i+1] += current[i]\n\t\tif direction[i] == 'L':\n\t\t\toutput[i-1] += current[i]\n\n\treturn output\n\ndef solve(direction):\n\toriginal = [1] * len(direc...
['Runtime Error', 'Accepted']
['s217603205', 's851789008']
[3064.0, 23164.0]
[17.0, 415.0]
[627, 1896]
p02954
u307516601
2,000
1,048,576
Given is a string S consisting of `L` and `R`. Let N be the length of S. There are N squares arranged from left to right, and the i-th character of S from the left is written on the i-th square from the left. The character written on the leftmost square is always `R`, and the character written on the rightmost square...
["import sys\nsys.setrecursionlimit(10**6)\n\ns = input()\n\nans = [0]*len(s)\n\nfor _ in range(2):\n cnt = 0\n for i in range(n):\n if s[i] == 'R': cnt += 1\n else:\n ans[i] += cnt//2\n ans[i-1] += (cnt-1)//2\n cnt = 0\n \n ans.sort()\n s = s[::-1]\n ...
['Runtime Error', 'Accepted']
['s649347978', 's594767271']
[3956.0, 6400.0]
[19.0, 173.0]
[392, 1406]
p02954
u314089899
2,000
1,048,576
Given is a string S consisting of `L` and `R`. Let N be the length of S. There are N squares arranged from left to right, and the i-th character of S from the left is written on the i-th square from the left. The character written on the leftmost square is always `R`, and the character written on the rightmost square...
['#ABC136 D\ntext = str(input())\n\n\n\nr_count = 0\nans=[]\n\n\nfor i in range(len(text)):\n if text[i]=="R" and text[i+1]!="L":\n ans.append(0)\n r_count+=1\n elif text[i]=="R" and text[i+1]=="L":\n ans.append(r_count+1)\n \n l_count = 0\n \n for j in range(i+1,l...
['Wrong Answer', 'Accepted']
['s596658625', 's715529419']
[10804.0, 17792.0]
[188.0, 115.0]
[1300, 1892]
p02954
u316464887
2,000
1,048,576
Given is a string S consisting of `L` and `R`. Let N be the length of S. There are N squares arranged from left to right, and the i-th character of S from the left is written on the i-th square from the left. The character written on the leftmost square is always `R`, and the character written on the rightmost square...
["def main():\n S = input()\n N = len(S)\n l = [0] * N\n t = 0\n for i in range(N):\n if S[i] == 'R':\n t += 1\n if S[i+1] == 'L':\n l[i] = t\n t = 0\n t = 0\n for i in range(N-1, 0, -1):\n if S[i] == 'L':\n t += 1\n ...
['Wrong Answer', 'Accepted']
['s280209731', 's047264567']
[10612.0, 10612.0]
[118.0, 95.0]
[815, 907]
p02954
u316733945
2,000
1,048,576
Given is a string S consisting of `L` and `R`. Let N be the length of S. There are N squares arranged from left to right, and the i-th character of S from the left is written on the i-th square from the left. The character written on the leftmost square is always `R`, and the character written on the rightmost square...
['S = input() + "R"\nprint(S)\nN = len(S)-1\n\nans = [0]*N\n\nnum = 0\nfor i in range(N):\n num += 1\n if S[i+1]=="L" and S[i]=="R":\n ans[i+1] += num//2\n ans[i] += num - num//2\n num = 0\n elif S[i+1]=="R" and S[i]=="L":\n ans[i-num+1] += num - num//2\n ans[i-num] += num//2...
['Wrong Answer', 'Accepted']
['s639606803', 's841240521']
[17224.0, 17220.0]
[90.0, 91.0]
[350, 352]
p02954
u325956328
2,000
1,048,576
Given is a string S consisting of `L` and `R`. Let N be the length of S. There are N squares arranged from left to right, and the i-th character of S from the left is written on the i-th square from the left. The character written on the leftmost square is always `R`, and the character written on the rightmost square...
["s = input()\nn = len(s)\nans = [ 0 for i in range(n)]\nfor j in range(2):\n cnt = 0\n for k in range(n):\n if s[k] == 'R':\n cnt += 1\n else:\n ans[k] += cnt // 2 \n ans[k-1] += -( -cnt // 2 ) \n cnt = 0\n \n ans = ans[::-1]\n s = s[::-1]\n\n ...
['Wrong Answer', 'Accepted']
['s454927441', 's564770434']
[5596.0, 7120.0]
[132.0, 169.0]
[503, 504]
p02954
u328364772
2,000
1,048,576
Given is a string S consisting of `L` and `R`. Let N be the length of S. There are N squares arranged from left to right, and the i-th character of S from the left is written on the i-th square from the left. The character written on the leftmost square is always `R`, and the character written on the rightmost square...
['s = input()\ns = list(s)\ns_rev = list(reversed(s))\nn = len(s)\n\n\nr = 0\nfor i in range(n):\n if s[i] == "R":\n r += 1\n continue\n if s[i] == "L":\n if r % 2 == 0:\n r_point[i] = r//2\n r_point[i+1] = r//2\n else:\n r_point[i] = r//2 + 1\n ...
['Runtime Error', 'Accepted']
['s243680572', 's533237556']
[4776.0, 6408.0]
[39.0, 150.0]
[776, 628]
p02954
u330661451
2,000
1,048,576
Given is a string S consisting of `L` and `R`. Let N be the length of S. There are N squares arranged from left to right, and the i-th character of S from the left is written on the i-th square from the left. The character written on the leftmost square is always `R`, and the character written on the rightmost square...
['s = input() + "R"\nv = [0 for i in range(len(s)-1)]\n\neven = 0\nodd = 0\nlrpos = 0\nlr = "R"\n\nfor i in range(len(s)):\n if lr != s[i]:\n if lr == "R":\n if even == odd:\n v[i-1] += even\n v[i] += odd\n else:\n v[i] += even\n ...
['Runtime Error', 'Accepted']
['s455081292', 's359190394']
[4092.0, 10484.0]
[98.0, 123.0]
[689, 388]
p02954
u332906195
2,000
1,048,576
Given is a string S consisting of `L` and `R`. Let N be the length of S. There are N squares arranged from left to right, and the i-th character of S from the left is written on the i-th square from the left. The character written on the leftmost square is always `R`, and the character written on the rightmost square...
["S = input()\nlS, ans = len(S), [0] * len(S)\n\nfor i in range(lS):\n if S[i:i + 2] == 'RL':\n r = i\n if S[i] == 'L':\n ans[r + ((i - r) % 2)] += 1\n if S[(lS - i - 2):(lS - i)] == 'RL':\n l = (lS - i - 1)\n if S[(lS - i - 1)] == 'R':\n ans[l - ((i - l + 1) % 2)] += 1\n\nprint(...
['Wrong Answer', 'Accepted']
['s586244215', 's203436530']
[10484.0, 10612.0]
[145.0, 141.0]
[330, 335]
p02954
u339199690
2,000
1,048,576
Given is a string S consisting of `L` and `R`. Let N be the length of S. There are N squares arranged from left to right, and the i-th character of S from the left is written on the i-th square from the left. The character written on the leftmost square is always `R`, and the character written on the rightmost square...
['S = input()\nres = [0] * len(S)\n\nchildlen = 0\nfor i in range(len(S)):\n if S[i] == "R":\n childlen += 1\n else:\n tmp = (childlen + int(childlen % 2 == 1)) // 2\n res[i - 1] += tmp\n res[i] += childlen - tmp\n \n childlen = 0\n\nfor i in reversed(range(len(S))):\n ...
['Wrong Answer', 'Accepted']
['s338677143', 's688644920']
[10256.0, 10652.0]
[95.0, 111.0]
[543, 544]
p02954
u343454379
2,000
1,048,576
Given is a string S consisting of `L` and `R`. Let N be the length of S. There are N squares arranged from left to right, and the i-th character of S from the left is written on the i-th square from the left. The character written on the leftmost square is always `R`, and the character written on the rightmost square...
['S=input()\nN=len(S)\n\npos=[1]*N\n\nfor i in range(10**100):\n for j in range(N):\n for k in range(pos[j]):\n if S[j]=="R":\n pos[j]-=1\n pos[j+1]+=1\n elif S[j]=="L":\n pos[j]-=1\n pos[j-1]+=1\n\nprint(" ".join(pos))', 'S=lis...
['Time Limit Exceeded', 'Accepted']
['s734317085', 's911246063']
[3956.0, 11176.0]
[2104.0, 106.0]
[294, 449]
p02954
u347813515
2,000
1,048,576
Given is a string S consisting of `L` and `R`. Let N be the length of S. There are N squares arranged from left to right, and the i-th character of S from the left is written on the i-th square from the left. The character written on the leftmost square is always `R`, and the character written on the rightmost square...
["S = input()\n\ncnt = 1\nmaxV = 0\nfor i in range(1,len(S)):\n if S[i] == S[i-1]:\n cnt += 1\n maxV = max(cnt, maxV)\n else:\n cnt = 1\n# print(maxV)\n\nA = []\nb = [1] * len(S)\nans = 0\nfor i in range(1, 100005):\n \n a = [0] * len(S)\n\n for j in range(len(S)):\n if S[j] =...
['Wrong Answer', 'Accepted']
['s304792134', 's618777306']
[103296.0, 10672.0]
[2208.0, 102.0]
[628, 427]
p02954
u348868667
2,000
1,048,576
Given is a string S consisting of `L` and `R`. Let N be the length of S. There are N squares arranged from left to right, and the i-th character of S from the left is written on the i-th square from the left. The character written on the leftmost square is always `R`, and the character written on the rightmost square...
['S = input()\nc = 0\nd = ""\nrunlength = []\nfor i in range(len(S)):\n if d == "":\n d = S[i]\n c += 1\n if d == S[i]:\n c += 1\n else:\n runlength.append([d,c])\n d = ""\n c = 0\nans = [0]*len(S)\nind = -1\nfor rl in runlength:\n if rl[0] == "R":\n ind += r...
['Runtime Error', 'Accepted']
['s450530929', 's042338184']
[8948.0, 16624.0]
[93.0, 187.0]
[483, 495]
p02954
u357949405
2,000
1,048,576
Given is a string S consisting of `L` and `R`. Let N be the length of S. There are N squares arranged from left to right, and the i-th character of S from the left is written on the i-th square from the left. The character written on the leftmost square is always `R`, and the character written on the rightmost square...
['DEBUG = False\n\nS = input()\n\nborders = []\n\npre_char = S[0]\nfor i in range(1, len(S)):\n next_char = S[i]\n if pre_char == "R" and next_char == "L":\n borders.append(i-1)\n pre_char = next_char\n\nif DEBUG:\n print("borders: {}".format(borders))\n\nright_cusums = [0] * len(S)\nright_cusums[0] ...
['Wrong Answer', 'Wrong Answer', 'Accepted']
['s534861953', 's826610345', 's337573894']
[11248.0, 11136.0, 7160.0]
[171.0, 169.0, 146.0]
[1261, 1431, 809]
p02954
u360116509
2,000
1,048,576
Given is a string S consisting of `L` and `R`. Let N be the length of S. There are N squares arranged from left to right, and the i-th character of S from the left is written on the i-th square from the left. The character written on the leftmost square is always `R`, and the character written on the rightmost square...
["S = list(input())\nn = len(S)\nans = [0] * n\nc = 0\nfor i in range(n):\n if S[i] == 'R':\n c += 1\n else:\n ans[i] += c // 2\n ans[i - 1] += (c + 1) // 2\n c = 0\n\nS.reverse()\nans.reverse()\n\nc = 0\nfor i in range(n):\n if S[i] == 'L':\n c += 1\n else:\n ans[i...
['Wrong Answer', 'Accepted']
['s716287923', 's018582535']
[5548.0, 11180.0]
[89.0, 97.0]
[385, 405]
p02954
u364862909
2,000
1,048,576
Given is a string S consisting of `L` and `R`. Let N be the length of S. There are N squares arranged from left to right, and the i-th character of S from the left is written on the i-th square from the left. The character written on the leftmost square is always `R`, and the character written on the rightmost square...
['S = list(input())\nans = [0]*len(S)\n\ni = 0\nwhile i < len(S):\n Rcount=0\n while S[i]=="R":\n Rcount += 1\n i += 1\n ans[i]+=Rcount//2\n ans[i-1]+=Rcount//2+Rcount%2\n\n terminal = i\n Lcount=0\n while i < len(S) and S[i]=="L":\n Lcount+=1\n i += 1\n ans[terminal]...
['Wrong Answer', 'Accepted']
['s096509299', 's661769655']
[5548.0, 11180.0]
[107.0, 113.0]
[366, 384]
p02954
u365364616
2,000
1,048,576
Given is a string S consisting of `L` and `R`. Let N be the length of S. There are N squares arranged from left to right, and the i-th character of S from the left is written on the i-th square from the left. The character written on the leftmost square is always `R`, and the character written on the rightmost square...
["s = input()\nn = len(s)\ns0 = s[0]\nnumr = 1\nnuml = 0\nans = [0 for _ in range(n)]\nfor i in range(1, n):\n s1 = s[i]\n if s1 == 'R':\n numr += 1\n elif s1 == 'L':\n numl += 1\n\n if s0 == 'R' and s1 == 'L':\n ir = i - 1\n il = i\n ans[ir] += (numr + 1) // 2\n an...
['Wrong Answer', 'Accepted']
['s350537676', 's145286203']
[4860.0, 6408.0]
[117.0, 147.0]
[491, 490]
p02954
u366482170
2,000
1,048,576
Given is a string S consisting of `L` and `R`. Let N be the length of S. There are N squares arranged from left to right, and the i-th character of S from the left is written on the i-th square from the left. The character written on the leftmost square is always `R`, and the character written on the rightmost square...
['import numpy as np\na = input()\nb = np.zeros(len(a),int)\ncount =0\nevenR=0\noddR=0\nevenL=0\noddR=0\nfor i in range(len(a)):\n if i==0:\n count+=1\n oddR+=1\n continue\n if a[i]=="R" and a[i-1]=="R":\n count+=1\n if count%2==0:\n evenR+=1\n else:\n oddR+=1\n if a[i]=="L" and a[i-1]=="...
['Wrong Answer', 'Accepted']
['s429310069', 's537536195']
[18884.0, 19668.0]
[787.0, 1266.0]
[617, 504]
p02954
u367866606
2,000
1,048,576
Given is a string S consisting of `L` and `R`. Let N be the length of S. There are N squares arranged from left to right, and the i-th character of S from the left is written on the i-th square from the left. The character written on the leftmost square is always `R`, and the character written on the rightmost square...
['s=input().split()\nplace=[]\nfor i in range(len(s)-1):\n if s[i]!=s[i+1]:\n place.append(i)\nans=[0 for i in range(len(s))]\ncur_p=place[0]\ncur_p_i=0\nfor i in range(len(s)):\n if i>=cur_p:\n cur_p_i+=1\n cur_p=place[cur_p_i]\n if (i-cur_p)%2=0:\n ans[cur_p]+=1\n else:\n ans[cur_p+1]+=1\nprint(" "...
['Runtime Error', 'Runtime Error', 'Accepted']
['s438626907', 's515760404', 's788635121']
[2940.0, 3188.0, 18744.0]
[17.0, 18.0, 111.0]
[313, 314, 389]
p02954
u371763408
2,000
1,048,576
Given is a string S consisting of `L` and `R`. Let N be the length of S. There are N squares arranged from left to right, and the i-th character of S from the left is written on the i-th square from the left. The character written on the leftmost square is always `R`, and the character written on the rightmost square...
['from bisect import bisect_left, bisect_right\n\ns = input()\ncnt = [0]*len(s)\nl = [i for i in range(len(s)) if s[i]=="L"]\nr = [i for i in range(len(s)) if s[i]=="R"]\nfor i in range(len(s)):\n if s[i] == "R": \n if abs((l[bisect_left(l, i)] - i))%2==0:\n cnt[l[bisect_left(l, i)]]+=1\n e...
['Wrong Answer', 'Accepted']
['s350407202', 's794720505']
[8824.0, 10356.0]
[198.0, 224.0]
[618, 620]
p02954
u372102441
2,000
1,048,576
Given is a string S consisting of `L` and `R`. Let N be the length of S. There are N squares arranged from left to right, and the i-th character of S from the left is written on the i-th square from the left. The character written on the leftmost square is always `R`, and the character written on the rightmost square...
['\nS = input()\n#Slist = list(S)\n#A = list(map(int, input().split()))\nanswer = ()\nchinpo = True\n\nwhile True:\n \n kintama = S.find("RL")\n\n if (int(kintama) % 2 == 0):\n for i in range(int(kintama)-2):\n print("0")\n print(int(kintama)-1)\n print("0")\n S[int(k...
['Time Limit Exceeded', 'Accepted']
['s731487918', 's105523535']
[12408.0, 10240.0]
[2104.0, 144.0]
[440, 901]
p02954
u374765578
2,000
1,048,576
Given is a string S consisting of `L` and `R`. Let N be the length of S. There are N squares arranged from left to right, and the i-th character of S from the left is written on the i-th square from the left. The character written on the leftmost square is always `R`, and the character written on the rightmost square...
['count = 10**100\n\n\nS = input()\nn = [1]*len(S)\n\n\nfor j in range(count):\n for i in range(len(S)):\n if S[i] == "R":\n if n[i] >0:\n \n n[i+1] += 1\n n[i] -=1\n if S[i] == "L":\n if n[i] >0:\n n[i-1] += 1\n ...
['Time Limit Exceeded', 'Runtime Error', 'Accepted']
['s441721163', 's463874323', 's659153176']
[3956.0, 3956.0, 6376.0]
[2104.0, 19.0, 112.0]
[325, 307, 244]
p02954
u382423941
2,000
1,048,576
Given is a string S consisting of `L` and `R`. Let N be the length of S. There are N squares arranged from left to right, and the i-th character of S from the left is written on the i-th square from the left. The character written on the leftmost square is always `R`, and the character written on the rightmost square...
["s = input()\nn = len(s)\n\ndef solve(s, c1, c2):\n res = [0] * (n)\n odd = 0\n even = 0\n for i in range(n):\n if s[i] == c1:\n if i % 2 == 1:\n odd += 1\n else:\n even += 1\n if s[i] == c2:\n if i % 2 == 1:\n res[...
['Wrong Answer', 'Accepted']
['s891300542', 's264668088']
[6376.0, 12132.0]
[103.0, 113.0]
[573, 593]
p02954
u388370899
2,000
1,048,576
Given is a string S consisting of `L` and `R`. Let N be the length of S. There are N squares arranged from left to right, and the i-th character of S from the left is written on the i-th square from the left. The character written on the leftmost square is always `R`, and the character written on the rightmost square...
["# -*- coding: utf-8 -*-\n\n\ndef main():\n s = input()\n r = [0] * len(s)\n prev = 'L'\n rl_point = -1\n st = [0, 0]\n st_point = 0\n\n for i, c in enumerate(s):\n if prev == 'L' and c == 'R':\n \n st = [0, 0]\n rl_point = -1\n st_point = 0\n ...
['Wrong Answer', 'Wrong Answer', 'Accepted']
['s105066742', 's951904093', 's396717414']
[10484.0, 4852.0, 10596.0]
[74.0, 64.0, 90.0]
[883, 863, 970]
p02954
u396824275
2,000
1,048,576
Given is a string S consisting of `L` and `R`. Let N be the length of S. There are N squares arranged from left to right, and the i-th character of S from the left is written on the i-th square from the left. The character written on the leftmost square is always `R`, and the character written on the rightmost square...
['S = input()\n\nN = len(S)\nchi = [1] * N\n\nret = 0\nret_temp = 0\n\nfor s in S:\n if s == "L":\n ret_temp += 1\n else:\n ret = max(ret, ret_temp)\n \nif ret % 2 == 1:\n ret += 1\n\nfor i in range(ret):\n temp = [0] * N\n for j in range(N):\n if S[j] == "R":\n tem...
['Wrong Answer', 'Accepted']
['s992786711', 's850945457']
[4852.0, 8304.0]
[2104.0, 139.0]
[390, 357]
p02954
u401452016
2,000
1,048,576
Given is a string S consisting of `L` and `R`. Let N be the length of S. There are N squares arranged from left to right, and the i-th character of S from the left is written on the i-th square from the left. The character written on the leftmost square is always `R`, and the character written on the rightmost square...
["import sys\ninput = sys.stdin.readline\ns = input()\ns += 'R'\nn = len(s)\n\nans = [0 for i in range(n-1)]\n\ndef move(block):\n #print(block, restart)\n blen = len(block)\n lidx = block.find('L')\n if lidx ==-1:\n return\n ans[restart+lidx] = blen//2\n ans[restart+lidx-1] = blen//2\n if b...
['Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Accepted']
['s011663132', 's233581005', 's489190932', 's615965576', 's618022398', 's657616461', 's694561923', 's747284258', 's164228190']
[6400.0, 4888.0, 19668.0, 4888.0, 16984.0, 16984.0, 10624.0, 10144.0, 9712.0]
[255.0, 2104.0, 2109.0, 2104.0, 2109.0, 2109.0, 239.0, 152.0, 156.0]
[594, 357, 505, 395, 418, 430, 612, 563, 564]
p02954
u401487574
2,000
1,048,576
Given is a string S consisting of `L` and `R`. Let N be the length of S. There are N squares arranged from left to right, and the i-th character of S from the left is written on the i-th square from the left. The character written on the leftmost square is always `R`, and the character written on the rightmost square...
['s = input()\nn = len(s)\nnum = [1]*n\ncnt = 0\nfor i in range(n):\n pre = s[i]\n if pre == "R" :\n cnt+=1\n num[i] -=1\n if pre == "L" :\n num[i] += cnt\n cnt = 0\nfor i in range(n-1,-1,-1):\n pre = s[i]\n if pre == "L" :\n cnt+=1\n num[i] -=1\n if pre == "R...
['Wrong Answer', 'Accepted']
['s163069490', 's783225559']
[4852.0, 6400.0]
[95.0, 175.0]
[355, 518]
p02954
u408375121
2,000
1,048,576
Given is a string S consisting of `L` and `R`. Let N be the length of S. There are N squares arranged from left to right, and the i-th character of S from the left is written on the i-th square from the left. The character written on the leftmost square is always `R`, and the character written on the rightmost square...
["s = input()\nr_cnt = 0\nl_cnt = 0\nlst = [0 for _ in range(len(s))]\n s += 'R'\nfor i in range(len(s)-1):\n if s[i] == 'R' and l_cnt == 0:\n r_cnt += 1\n elif s[i] == 'L' and r_cnt > 0:\n l_cnt += 1\n if r_cnt % 2 == 0:\n lst[i] += r_cnt // 2\n lst[i-1] += r_cnt // 2\n else:\n lst[i] += ...
['Runtime Error', 'Runtime Error', 'Wrong Answer', 'Wrong Answer', 'Accepted']
['s065388122', 's284114085', 's506670863', 's620493285', 's261808018']
[2940.0, 2940.0, 6420.0, 6420.0, 6408.0]
[17.0, 17.0, 136.0, 136.0, 137.0]
[639, 638, 626, 574, 652]
p02954
u411353821
2,000
1,048,576
Given is a string S consisting of `L` and `R`. Let N be the length of S. There are N squares arranged from left to right, and the i-th character of S from the left is written on the i-th square from the left. The character written on the leftmost square is always `R`, and the character written on the rightmost square...
['def main():\n S = list(input())\n num_r = 0\n num_l = 0\n agg = []\n pos = [0 for _ in range(len(S))]\n for i in range(len(S)-1):\n\n if S[i] == "R":\n num_r += 1\n\n elif S[i] == "L":\n num_l += 1\n\n if S[i] == "R" and S[i+1] == "L":\n agg.appe...
['Wrong Answer', 'Accepted']
['s725393045', 's542154991']
[17288.0, 17296.0]
[144.0, 156.0]
[896, 922]
p02954
u413165887
2,000
1,048,576
Given is a string S consisting of `L` and `R`. Let N be the length of S. There are N squares arranged from left to right, and the i-th character of S from the left is written on the i-th square from the left. The character written on the leftmost square is always `R`, and the character written on the rightmost square...
["s = [i for i in list(input())]\nx = 0\ni = 0\na = []\nresult = []\nwhile x < len(s)-1:\n while s[x] == s[i]:\n i += 1\n a.append([s[x],int(i-x)])\n x = i\nif a[-1][0] == 'L':\n a[-1][1] += 1\nelse:\n a.append(['L', int(1)])\nfor p in range(len(a)):\n if a[p][0] == 'R':\n n = 0\n ...
['Runtime Error', 'Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Accepted']
['s154692903', 's174595757', 's775837053', 's778013494', 's851943290', 's045017217']
[21404.0, 21396.0, 63008.0, 5400.0, 5404.0, 21312.0]
[274.0, 268.0, 2104.0, 2104.0, 2104.0, 253.0]
[697, 584, 682, 389, 391, 626]
p02954
u414376763
2,000
1,048,576
Given is a string S consisting of `L` and `R`. Let N be the length of S. There are N squares arranged from left to right, and the i-th character of S from the left is written on the i-th square from the left. The character written on the leftmost square is always `R`, and the character written on the rightmost square...
["s = str(input()) + 'E'\nans = [0] * (len(s)-1)\nnow = 0\n\nfor i in range(len(s)-1):\n now += 1\n if s[i] == s[i+1]:\n ans[i] += 0\n else:\n if s[i] == 'R':\n ans[i] += (now // 2 + now % 2)\n ans[i+1] += (now // 2)\n now = 0\n else:\n ans[i- now] += (now // 2)\n ans[i- now + 1] +=...
['Wrong Answer', 'Accepted']
['s619673229', 's503761525']
[10336.0, 17144.0]
[84.0, 92.0]
[355, 374]
p02954
u415154163
2,000
1,048,576
Given is a string S consisting of `L` and `R`. Let N be the length of S. There are N squares arranged from left to right, and the i-th character of S from the left is written on the i-th square from the left. The character written on the leftmost square is always `R`, and the character written on the rightmost square...
["char_list = list(input())\nprint(char_list)\nchar_list_num = len(char_list)\ncount_list = [0] * char_list_num\n\ndef f(first_char,n):\n if first_char == char_list[n+1]:\n return f(first_char,n+1)\n else:\n return n+1\n\ndef f2(first_char,n):\n if first_char == char_list[n-1]:\n return f2...
['Runtime Error', 'Runtime Error', 'Accepted']
['s020298582', 's127077130', 's851444830']
[12236.0, 11428.0, 90636.0]
[2104.0, 156.0, 156.0]
[900, 962, 1145]
p02954
u417014669
2,000
1,048,576
Given is a string S consisting of `L` and `R`. Let N be the length of S. There are N squares arranged from left to right, and the i-th character of S from the left is written on the i-th square from the left. The character written on the leftmost square is always `R`, and the character written on the rightmost square...
['S = list(input())\nR =[0 for i in range(len(S))]\nL =[0 for i in range(len(S))]\nans=[0 for i in range(len(S))]\nr_cnt=0\nl_cnt=0\nfor i in range(len(S)):\n if S[i]=="R":\n r_cnt+=1\n else:\n if r_cnt!=0:\n R[i]+=r_cnt//2\n R[i-1]+=r_cnt-r_cnt//2\n r_cnt=0\nS.reve...
['Wrong Answer', 'Accepted']
['s501782345', 's631278040']
[7208.0, 8632.0]
[122.0, 157.0]
[555, 556]
p02954
u418502493
2,000
1,048,576
Given is a string S consisting of `L` and `R`. Let N be the length of S. There are N squares arranged from left to right, and the i-th character of S from the left is written on the i-th square from the left. The character written on the leftmost square is always `R`, and the character written on the rightmost square...
["S = input()\nans = [0 for i in range(len(S))]\n\n_Ls = [0 for i in range(len(S))]\n_Rs = [0 for i in range(len(S))]\nlast_L = -1\nlast_R = -1\nfor i,s in enumerate(S):\n _Ls[i] = i - last_L-1\n _Rs[i] = i - last_R-1\n if s == 'L':\n last_L = i\n else:\n last_R = i\n\nLs_ = [0 for i in range(...
['Wrong Answer', 'Accepted']
['s006871755', 's488347335']
[14420.0, 20692.0]
[194.0, 216.0]
[803, 829]
p02954
u419963262
2,000
1,048,576
Given is a string S consisting of `L` and `R`. Let N be the length of S. There are N squares arranged from left to right, and the i-th character of S from the left is written on the i-th square from the left. The character written on the leftmost square is always `R`, and the character written on the rightmost square...
['import itertools\ns = input()\nn = len(s)\nkeep = []\nnum = 0\nans = [0] * len(s)\ngr = itertools.groupby(s)\nfor key, group in gr:\n keep.append([key, len(list(group))])\nprint(keep)\nans_num = 0\nfor i in range(len(keep)):\n if keep[i][0] == "R":\n if ans_num + keep[i][1] == n:\n ans[n - 1] ...
['Wrong Answer', 'Accepted']
['s769070682', 's544678776']
[20448.0, 19144.0]
[461.0, 479.0]
[771, 759]
p02954
u422590714
2,000
1,048,576
Given is a string S consisting of `L` and `R`. Let N be the length of S. There are N squares arranged from left to right, and the i-th character of S from the left is written on the i-th square from the left. The character written on the leftmost square is always `R`, and the character written on the rightmost square...
["import sys\n\nsys.setrecursionlimit(10 ** 7)\n\nS = list(input())\n\nis_hole = [None for _ in S]\nis_s = [None for _ in S]\n\ns_1 = None\nfor i, s in enumerate(S):\n if s_1 == 'R' and s == 'L':\n is_hole[i - 1] = 'R'\n is_hole[i] = 'L'\n if s_1 == 'L' and s == 'R':\n is_s[i] = 'S' \n s_...
['Wrong Answer', 'Accepted']
['s684612209', 's694563503']
[7212.0, 13224.0]
[130.0, 149.0]
[1077, 1130]
p02954
u422885735
2,000
1,048,576
Given is a string S consisting of `L` and `R`. Let N be the length of S. There are N squares arranged from left to right, and the i-th character of S from the left is written on the i-th square from the left. The character written on the leftmost square is always `R`, and the character written on the rightmost square...
['def copy(l):\n l1=[]\n for i in l:\n l1.append(i)\n return l1\ns = input()\nn = len(s)\nl = [1]*n\nk = 0\nc = 1\nfor i in range(len(s)-1):\n if k<c:\n k = c\n if(s[i+1]==s[i]):\n c+=1\n else:\n c = 0\n \nif k%2 ==1:\n k+=1\nfor _ in range(k):\n l1 = copy(l)\n ...
['Time Limit Exceeded', 'Wrong Answer', 'Accepted']
['s107671496', 's132037652', 's397868427']
[5716.0, 5628.0, 11276.0]
[2104.0, 2108.0, 97.0]
[543, 544, 874]
p02954
u424776185
2,000
1,048,576
Given is a string S consisting of `L` and `R`. Let N be the length of S. There are N squares arranged from left to right, and the i-th character of S from the left is written on the i-th square from the left. The character written on the leftmost square is always `R`, and the character written on the rightmost square...
["def split_list(l, n):\n for idx in range(0, len(l), n):\n yield l[idx:idx + n]\n\ndef main():\n s = input()\n n = [1]\n j = 0\n for i in range(len(s)):\n if i + 1 < len(s):\n if s[i] == s[i+1]:\n n[j] += 1\n else:\n n.append(1)\n ...
['Wrong Answer', 'Accepted']
['s600236920', 's705397572']
[17136.0, 16452.0]
[186.0, 135.0]
[2330, 2311]
p02954
u428397309
2,000
1,048,576
Given is a string S consisting of `L` and `R`. Let N be the length of S. There are N squares arranged from left to right, and the i-th character of S from the left is written on the i-th square from the left. The character written on the leftmost square is always `R`, and the character written on the rightmost square...
["# -*- coding: utf-8 -*-\n\nS = input()\nS = S + 'R'\n\nN = len(S)\n\nans = [0] * N\nkids = 0\ndirection = 'R'\nfor i in range(N):\n c = S[i]\n\n if direction == 'R':\n if c == 'L':\n idx = i\n ans[idx - 1] += kids // 2 + kids % 2\n ans[idx] += kids // 2\n kids ...
['Wrong Answer', 'Accepted']
['s701155460', 's655947675']
[105860.0, 10980.0]
[2104.0, 101.0]
[573, 538]
p02954
u441254033
2,000
1,048,576
Given is a string S consisting of `L` and `R`. Let N be the length of S. There are N squares arranged from left to right, and the i-th character of S from the left is written on the i-th square from the left. The character written on the leftmost square is always `R`, and the character written on the rightmost square...
["s = input()\nn = len(s)\n\nans=[0] * n\n\ncnt_r = 0\ncnt_l = 0\n\n\n\nfor i in range(n):\n if s[i] == 'R':\n cnt_r += 1\n else:\n if cnt_r % 2 == 0:\n ans[i] += cnt_r // 2\n ans[i-1] += cnt_r // 2\n else:\n ans[i] += (cnt_r - 1) // 2\n ans[i-1] += cnt_r // 2\n cnt_r = 0\n\n\nfor i in...
['Wrong Answer', 'Accepted']
['s075866121', 's521188076']
[10484.0, 10484.0]
[104.0, 108.0]
[583, 583]
p02954
u449863068
2,000
1,048,576
Given is a string S consisting of `L` and `R`. Let N be the length of S. There are N squares arranged from left to right, and the i-th character of S from the left is written on the i-th square from the left. The character written on the leftmost square is always `R`, and the character written on the rightmost square...
["S = input()\nN = len(S)\nleft_R = [0] * N\nright_L = [N-1] * N\n\nfor i, s in enumerate(S[1:], 1):\n left_R[i] = i if s == 'R' else left_R[i-1]\n\nfor i, s in enumerate(S[N-2::-1], 1):\n i = N-1-i\n right_L[i] = i if s == 'L' else right_L[i+1]\n\nanser = [0] * N\nfor i, (s, R, L) in enumerate(zip(S, left_R, right_...
['Runtime Error', 'Accepted']
['s713231805', 's109922174']
[8692.0, 15396.0]
[74.0, 154.0]
[485, 486]
p02954
u451017206
2,000
1,048,576
Given is a string S consisting of `L` and `R`. Let N be the length of S. There are N squares arranged from left to right, and the i-th character of S from the left is written on the i-th square from the left. The character written on the leftmost square is always `R`, and the character written on the rightmost square...
["S = input()\nans = [0] * len(S)\n\nidx = []\nfor i in range(len(S)-1):\n s1, s2 = S[i], S[i+1]\n if s1 == 'R' and s2 == 'L':\n idx.append(i)\n ans[i] += 1\n ans[i+1] += 1\n\nfor i in idx:\n if i == 0:\n counter = 0\n for j in range(i-1,-1,-1):\n if S[j] == 'L':\n...
['Wrong Answer', 'Accepted']
['s407496797', 's297531717']
[8280.0, 8288.0]
[173.0, 207.0]
[702, 702]
p02954
u454524105
2,000
1,048,576
Given is a string S consisting of `L` and `R`. Let N be the length of S. There are N squares arranged from left to right, and the i-th character of S from the left is written on the i-th square from the left. The character written on the leftmost square is always `R`, and the character written on the rightmost square...
['s = input()\nans = [0 for _ in range(len(s))]\ncnt = 0\nb = 0\nfor i in range(1, len(s)):\n if b == 0:\n cnt += 1\n if s[i] == "R": continue\n else:\n b = 1\n i1 = i - 1\n i2 = i\n if b == 1 and s[i] == "L":\n cnt += 1\n if (b == 1 and s[i] == "R")...
['Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Accepted']
['s147434887', 's162998289', 's516913548', 's216430032']
[4988.0, 4872.0, 4872.0, 6400.0]
[103.0, 159.0, 149.0, 124.0]
[532, 559, 866, 547]
p02954
u463775490
2,000
1,048,576
Given is a string S consisting of `L` and `R`. Let N be the length of S. There are N squares arranged from left to right, and the i-th character of S from the left is written on the i-th square from the left. The character written on the leftmost square is always `R`, and the character written on the rightmost square...
["s = list(str(input()))\nl = int(len(s))\na = list(range(l))\nfor i in range(l):\n a[i] = 1\na = [int(j) for j in a]\nfor i in range(l-2):\n if s[i] == s[i+1] == 'R':\n a[i+2] += a[i]\n a[i] = 0\nfor i in range(l)[::-1]:\n if s[i] == s[i-1] == 'L':\n a[i-2] += a[i]\n a[i] = 0\nprin...
['Wrong Answer', 'Accepted']
['s286568106', 's171249736']
[7852.0, 11132.0]
[109.0, 120.0]
[308, 327]
p02954
u464627439
2,000
1,048,576
Given is a string S consisting of `L` and `R`. Let N be the length of S. There are N squares arranged from left to right, and the i-th character of S from the left is written on the i-th square from the left. The character written on the leftmost square is always `R`, and the character written on the rightmost square...
["s = list(input())\n\nN = len(s)\n\nRL = []\nLR = [-1]\nfor i in range(N-1):\n if s[i] == 'R' and s[i+1] == 'L':\n RL.append(i)\n if s[i] == 'L' and s[i+1] == 'R':\n LR.append(i)\n\nLR.append(N-1)\n\n_num = []\nfor i in range(len(LR)-1):\n _num.append(LR[i+1] - LR[i])\n# _num[0] = _num[0] + 1\n\...
['Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Accepted']
['s471906702', 's948760841', 's979936865', 's670882779']
[9884.0, 9928.0, 9928.0, 15520.0]
[120.0, 131.0, 118.0, 142.0]
[715, 1065, 1049, 735]
p02954
u472534477
2,000
1,048,576
Given is a string S consisting of `L` and `R`. Let N be the length of S. There are N squares arranged from left to right, and the i-th character of S from the left is written on the i-th square from the left. The character written on the leftmost square is always `R`, and the character written on the rightmost square...
['S=list(input())\nSa=[1]*len(S)\nif len(S)%2 != 0:\n turn=len(S)+1\nelse:\n turn=len(S)\n\nfor i in range(turn):\n print(i)\n Sb=[0]*len(S) \n for j in range(len(S)):\n if j == 0:\n if S[j+1]==\'L\':\n Sb[j]=Sa[j+1]\n elif j==len(S)-1:\n if S[j-1]==\'R\...
['Wrong Answer', 'Accepted']
['s966703407', 's625244040']
[7428.0, 6400.0]
[2108.0, 124.0]
[559, 463]
p02954
u474423089
2,000
1,048,576
Given is a string S consisting of `L` and `R`. Let N be the length of S. There are N squares arranged from left to right, and the i-th character of S from the left is written on the i-th square from the left. The character written on the leftmost square is always `R`, and the character written on the rightmost square...
["S = input()\nans = [0]*len(S)\ncnt = 1\ntmp = S[0]\npos = 0\nfor n,i in enumerate(S[1:],1):\n if i == tmp:\n cnt += 1\n if i == 'R' and i != tmp:\n ans[pos] = cnt\n cnt = 1\n tmp = i\n if i == 'L' and i != tmp:\n ans[n] = cnt\n pos = n-1\n cnt = 1\n tmp...
['Wrong Answer', 'Accepted']
['s578133789', 's991176843']
[17048.0, 17064.0]
[97.0, 103.0]
[549, 579]
p02954
u474925961
2,000
1,048,576
Given is a string S consisting of `L` and `R`. Let N be the length of S. There are N squares arranged from left to right, and the i-th character of S from the left is written on the i-th square from the left. The character written on the leftmost square is always `R`, and the character written on the rightmost square...
['if set(s[l[i]:l[i+1]])=={"L"}:\n ans[l[i]]=p\n if set(s[l[i]:l[i+1]])=={"R"}:\n ans[l[i+1]-1]=p\n', 's=input()\n\nl=[0]\nans=[0]*(len(s))\nfor i in range(len(s)-1):\n if s[i]=="L" and s[i+1]=="R":\n l.append(i+1)\n \nn=len(l)+1\nl.append(len(s))\n#print(set(s[l[0]:l[1]]))\...
['Runtime Error', 'Accepted']
['s570936087', 's364684780']
[3064.0, 8260.0]
[18.0, 444.0]
[122, 761]
p02954
u480130675
2,000
1,048,576
Given is a string S consisting of `L` and `R`. Let N be the length of S. There are N squares arranged from left to right, and the i-th character of S from the left is written on the i-th square from the left. The character written on the leftmost square is always `R`, and the character written on the rightmost square...
["s = input() + 'R'\n\nans = [0] * len(s)\ncntR = cntL = 0\n\nfor i in range(len(s) - 1):\n if s[i] == 'R':\n cntR += 1\n if s[i + 1] == 'L':\n RtoL = i\n if s[i] == 'L':\n cntL += 1\n if s[i + 1] == 'R':\n ans[RtoL] += -(-cntR // 2) + cntL // 2\n ans[R...
['Wrong Answer', 'Accepted']
['s811802944', 's554819805']
[6400.0, 6400.0]
[112.0, 118.0]
[391, 397]
p02954
u480200603
2,000
1,048,576
Given is a string S consisting of `L` and `R`. Let N be the length of S. There are N squares arranged from left to right, and the i-th character of S from the left is written on the i-th square from the left. The character written on the leftmost square is always `R`, and the character written on the rightmost square...
['s = input()\nr_count = 0\nl_count = 0\nf = False\n\nfor letter in s:\n if letter == "R":\n if f:\n rl = r_count + l_count\n if rl % 2 == 0:\n for i in range(rl):\n if i == r_count - 1:\n print(rl // 2, end=" ")\n ...
['Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Accepted']
['s029767565', 's266685436', 's580677418', 's177602489']
[4096.0, 4208.0, 4096.0, 10804.0]
[195.0, 197.0, 200.0, 98.0]
[1334, 1798, 1572, 805]
p02954
u480887263
2,000
1,048,576
Given is a string S consisting of `L` and `R`. Let N be the length of S. There are N squares arranged from left to right, and the i-th character of S from the left is written on the i-th square from the left. The character written on the leftmost square is always `R`, and the character written on the rightmost square...
['S=input()\nl=[0 for x in range(len(list(S)))]\nfor i in range(len(list(S))):\n p_i=i\n p_l=[]\n for j in range(len(list(S))):\n if S[p_i]=="R":\n p_i+=1\n elif S[p_i]=="L":\n p_i-=1\n l[p_i]+=1\n\nprint(*l)', 's=input()\ns="L"+s+"R"\nN=len(s)\na=[1]*N\nfor i in range(1,...
['Wrong Answer', 'Accepted']
['s005008204', 's788362082']
[6756.0, 6376.0]
[2104.0, 112.0]
[242, 243]
p02954
u482157295
2,000
1,048,576
Given is a string S consisting of `L` and `R`. Let N be the length of S. There are N squares arranged from left to right, and the i-th character of S from the left is written on the i-th square from the left. The character written on the leftmost square is always `R`, and the character written on the rightmost square...
['s = input()\ncons = 0\nans = [0]*(len(s))\nleft = 0\nright = 0\ncheck1 = True\ncheck2 = False\nfor i in range(len(s)):\n if check1 == True and s[i] == "L":\n cons = i\n check1 = False\n check2 = True\n if check2 == True and (s[i] == "R" or i == len(s)-1):\n right = i-1\n if i ...
['Wrong Answer', 'Accepted']
['s515468303', 's736890972']
[10536.0, 17172.0]
[101.0, 106.0]
[714, 733]