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
u490084374
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 -*-\ns = input()\ns = 'RRRLLRLLRRRLLLLL'\nli = []\nr_cnt = 0\nl_cnt = 0\nfor n, a in enumerate(s):\n if a == 'R':\n if l_cnt > 0:\n li.append([r_cnt, l_cnt])\n r_cnt = 1\n l_cnt = 0\n else:\n r_cnt += 1\n else:\n l_cnt += 1\n if n + 1 == len(s):\n li.append([...
['Wrong Answer', 'Accepted']
['s386617822', 's058436169']
[3188.0, 8728.0]
[18.0, 160.0]
[540, 517]
p02954
u499381410
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...
["li=input().split()[0]\nchild_li=[1]*len(li)\nfor i in range(len(li)):\n new_child_li=[0]*len(li)\n for j in range(len(li)):\n\n if li[j]=='R':\n new_child_li[j+1]+=child_li[j]\n else:\n new_child_li[j-1]+=child_li[j]\n child_li=new_child_li\n\n\nrl_list=[(i,i+1) for i in r...
['Runtime Error', 'Accepted']
['s185177898', 's374466631']
[4724.0, 6400.0]
[2104.0, 125.0]
[542, 478]
p02954
u503228842
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 = list(input())\nr_cnt = 0\nl_cnt = 0\nans = [0]*len(S)\nfor i,s in enumerate(S):\n if s == 'R':\n if r_cnt == 0:\n r_cnt += 1\n if i == 0:\n continue\n ans[i - l_cnt] += math.ceil(l_cnt/2)\n ans[i - l_cnt - 1] +=l_cnt - math.ceil(l_c...
['Wrong Answer', 'Accepted']
['s554636278', 's136756891']
[5668.0, 7088.0]
[143.0, 174.0]
[704, 705]
p02954
u505830998
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\n#+++++\n\n\ndef gh(n):\n\treturn n // 2 + n % 2\n\t\ndef gn(n):\n\treturn n // 2\n\t\t\t\ndef main():\n\tl = list(input())\n\tret = [0 for _ in l]\n\tn=len(l)\n\t\n\tp=\'L\'\n\tcount=0\n\tfor i, (c, nc) in enumerate(zip(l,l[1:])):\n\t\tif p==\'L\' and c == \'R\':\n\t\t\tcount=0\n\t\t\n\t\tif c == \'R\'...
['Wrong Answer', 'Accepted']
['s589202613', 's547901457']
[11140.0, 11140.0]
[128.0, 124.0]
[976, 993]
p02954
u509911932
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 copy\nS = input()\n# S="R"*(10**5-1)+"L"\n\npairs = []\nindex = 0\nR_ren = []\nL_ren = []\nstart = 0\ntugi_L_sagasu = True\nwhile True:\n if tugi_L_sagasu:\n index = S.find("L", start)\n R_ren.append((start, index-1))\n start = index\n tugi_L_sagasu = False\n else:\n in...
['Wrong Answer', 'Wrong Answer', 'Accepted']
['s207229598', 's718646756', 's732875685']
[18828.0, 20956.0, 18792.0]
[173.0, 215.0, 168.0]
[856, 852, 856]
p02954
u514894322
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\ndef getindexlist(s):\n l = []\n for i in range(0,len(s)-2):\n if s[i:i+2] == 'RL':\n l.append(i)\n return l\n\nl = getindexlist(s)\nans = [0]*len(s)\nsearching = 0\nfor i in l:\n while True:\n if searching >= len(s):\n break\n if searching > i and s[searching] == 'R':\n brea...
['Wrong Answer', 'Accepted']
['s284941571', 's602920229']
[12508.0, 12508.0]
[119.0, 117.0]
[451, 451]
p02954
u522293645
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...
["li = list(input())\n\nn = len(li)\n\nans = [0 for _ in range(n)]\n\nrcnt = 0\nlcnt = 0\nridx = 0\nlidx = 0\n\nfor i in range(1,n):\n if li[i-1]=='R':\n rcnt += 1\n if li[i]=='L':\n ridx = i-1\n lidx = i\n if li[i-1]=='L':\n lcnt += 1\n if li[i]=='R' or i==n-1:\n...
['Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Accepted']
['s471700173', 's742747792', 's763347398', 's316587502']
[11568.0, 11196.0, 10468.0, 11476.0]
[99.0, 84.0, 78.0, 101.0]
[493, 492, 481, 692]
p02954
u523545435
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)\n#print(S,N)\n\nT=[0 for _ in range(N)]\n\nfor i in range(N):\n if S[i]=='R':\n j=i\n while S[j]=='R':\n j+=1\n if (j-i)%2==0:\n T[j]+=1\n elif (j-i)%==1:\n T[j-1]+=1\n else:\n j=i\n while S[j]=='L':\n ...
['Runtime Error', 'Time Limit Exceeded', 'Accepted']
['s703069108', 's912951691', 's910020264']
[2940.0, 5288.0, 16504.0]
[17.0, 2104.0, 192.0]
[408, 449, 518]
p02954
u525227429
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)\nc = [1 for _ in range(N)]\n\ndic = {}\nfreq = 0\nstart = 0\nfor i in range(int(N ** 0.5)):\n tmp = [0 for _ in range(N)]\n for j in range(N):\n if j > 0 and S[j - 1] == "R":\n tmp[j] += c[j - 1]\n if j < N - 1 and S[j + 1] == "L":\n tmp[j] += c[j + 1]\n c = tmp\n if str(c)...
['Runtime Error', 'Wrong Answer', 'Runtime Error', 'Accepted']
['s143724708', 's469149632', 's560768673', 's291203118']
[15972.0, 5516.0, 2940.0, 8684.0]
[2104.0, 351.0, 17.0, 348.0]
[675, 481, 674, 564]
p02954
u533039576
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 = s.replace("LR", "L R").split()\nprint(s)\n\nans = []\nfor ss in s:\n a = b = 0\n c = d = 0\n for i in range(len(ss)):\n if ss[i] == \'R\':\n a += 1\n else:\n b += 1\n\n if a % 2 == 0:\n c += a // 2\n d += a // 2\n else:\n c += (a...
['Wrong Answer', 'Accepted']
['s659364283', 's317733610']
[14092.0, 13728.0]
[153.0, 153.0]
[542, 533]
p02954
u535171899
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\n#RRLRL=(R2L),(RL)\n\n\nv=[]\ndef RLE(s,v):\n for i in range(len(s)):\n if len(v)==0 or v[-1][0]!=s[i]:\n v.append([s[i],1])\n else:\n v[-1][1]+=1\n return v\nrle_li = RLE(s,v)\n\nstring_li = [0]*n\nfor i in range(n-1):\n if s[i-1]=='R' and s[i]==...
['Wrong Answer', 'Accepted']
['s722722381', 's139357552']
[14068.0, 6400.0]
[1641.0, 121.0]
[869, 225]
p02954
u537782349
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 = "S" + input() + "E"\nc = [0] * len(a)\nri = 1\nle = 1\ncnt = 1\nfor i in range(1, len(a)):\n if a[i] != a[i-1]:\n if a[i] == "L":\n c[i-1] = i - ri\n le = i\n ri = i - 1\n elif a[i] == "E" and a[i-1] == "R":\n c[i-1] = i - ri\n else:\n ...
['Wrong Answer', 'Wrong Answer', 'Accepted']
['s558635623', 's906017046', 's890933532']
[10660.0, 10660.0, 10660.0]
[125.0, 118.0, 111.0]
[829, 755, 406]
p02954
u537905693
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...
["#!/usr/bin/env python\n# coding: utf-8\n\ndef ri():\n return int(input())\n\ndef rl():\n return list(input().split())\n\ndef rli():\n return list(map(int, input().split()))\n\ndef main():\n s = input()\n ans = [1 for _ in range(len(s))]\n for i in range(len(s)-2):\n if s[i] == 'R' and s[i+1] ...
['Wrong Answer', 'Accepted']
['s817862815', 's780739455']
[4860.0, 14616.0]
[61.0, 131.0]
[553, 862]
p02954
u538774896
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...
['\nimport sys\nimport math\n\ndef main():\n cells = sys.stdin.readline().strip()\n results = [0 for i in range(len(cells))]\n current = 0\n for index in range(len(cells)):\n if cells[index] == \'R\':\n current += 1\n elif cells[index] == \'L\':\n results[index - 1] += in...
['Wrong Answer', 'Accepted']
['s995085749', 's419522390']
[4984.0, 10492.0]
[127.0, 140.0]
[730, 759]
p02954
u550943777
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()\noe = [0,0]\ncnt = [0]*(len(s))\nfor i in range(len(s)):\n if s[i] == 'L':\n cnt[i] += oe[0]\n cnt[i-1] += oe[1]\n oe = [0,0]\n else:\n oe[0] += 1\n oe.reverse()\noe = [0,0]\nfor i in range(len(s))[::-1]:\n if s[i] == 'R':\n print(oe)\n cnt[i] += o...
['Wrong Answer', 'Accepted']
['s237865832', 's309832265']
[7024.0, 6400.0]
[246.0, 140.0]
[415, 397]
p02954
u556225812
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())\nrcnt = 0\nlcnt = 0\nflag = 0\nans = [0]*(len(s)-1)\nrpos = 0\nlpos = 0\n\nfor i in range(len(s)):\n if s[i] == 'R':\n if flag == 1:\n if rcnt % 2 == 0:\n ans[rpos] += rcnt//2\n ans[lpos] += rcnt//2\n else:\n ans[rpos] += rc...
['Wrong Answer', 'Accepted']
['s469642621', 's524950334']
[6400.0, 6400.0]
[123.0, 120.0]
[755, 770]
p02954
u556849401
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"""\nCreated on Mon Oct 7 08:53:00 2019\n\n@author: avina\n"""\n\ns = input()\nn = len(s)\nl = []\nfor i in range(n):\n l.append(0)\ne = \'R\';initial = 0\nindex = 1\nfor i in range(1,n):\n if e == s[i]:\n index+=1\n else:\n e = s[i]\n if s[i-1] == \'R\':\n ...
['Wrong Answer', 'Accepted']
['s991172863', 's011745473']
[6408.0, 6408.0]
[153.0, 171.0]
[700, 871]
p02954
u561992253
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...
["words = lambda t : list(map(t, input().split()))\ns = input()\n\np = []\ni = 0\nwhile i < len(s):\n # s[i] == 'R'\n r = 0\n l = 0\n while s[i] == 'R':\n r += 1\n i += 1\n while i < len(s) and s[i] == 'L':\n l += 1\n i += 1\n p.append((r,l))\nprint(p)\n\n\nans = []\nfor r,...
['Wrong Answer', 'Wrong Answer', 'Accepted']
['s069129931', 's434350025', 's638744676']
[8936.0, 14816.0, 14068.0]
[149.0, 161.0, 151.0]
[446, 465, 466]
p02954
u565711859
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\n\nS = input()\n\nr = [0] * len(S)\nS += 'R'\nlast = 0\ncount = 0\nfor i in range(0, len(S)-1):\n count += 1\n if S[i] != S[i+1]:\n \n if S[i] == 'R':\n r[i] += math.ceil(count/2)\n r[i+1] += math.floor(count/2)\n last = i\n else:\n r[...
['Wrong Answer', 'Accepted']
['s714554512', 's796645300']
[4852.0, 10484.0]
[133.0, 136.0]
[424, 445]
p02954
u567053725
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\ns = str(input())\nchild = [1] * len(s)\n# for j in range(len(s)):\n# \tchild[j] = 1\n\nfor j in range(100):\n\tafter = [0] * len(s)\n\tfor i in range(len(s)):\n\t\t# print(i)\n\t\tif child[i] != 0:\n\t\t\tif s[i] == 'R':\n\t\t\t\tafter[i+1] = after[i+1] + child[i]\n\t\t\t\t# child[i] = 0\n\t\t\telif s...
['Wrong Answer', 'Time Limit Exceeded', 'Wrong Answer', 'Runtime Error', 'Accepted']
['s307088164', 's573808173', 's603602270', 's689714087', 's592875418']
[4724.0, 6740.0, 5492.0, 3064.0, 10484.0]
[2104.0, 2108.0, 125.0, 17.0, 103.0]
[383, 389, 366, 479, 1038]
p02954
u571445182
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 copy\n\nS = input()\nnN = len(S)\nnAns = [ 1 for i in range(nN)]\nnAnsC = [ 0 for i in range(nN)]\n\nfor j in range(10**100):\n nAnsT = [ 0 for i in range(nN)]\n for i in range(nN):\n sTmp = S[i]\n \n if nAns[i]==0:\n continue\n nNum = nAns[i]\n nAns[i] = 0\n if sTmp =='R':\n nTmp...
['Time Limit Exceeded', 'Time Limit Exceeded', 'Accepted']
['s844055898', 's899651191', 's132747581']
[8772.0, 11032.0, 12400.0]
[2104.0, 2104.0, 171.0]
[743, 633, 915]
p02954
u575239123
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)\nrl_list=[]\nrl=s[0]\nc=0\nfor ts in s[1:]:\n c+=1\n if rl!=ts:\n rl_list.append(c)\n rl=ts\n c=0\nrl_list.append(c+1)\nfor i in range(0,len(rl_list),2):\n index=sum(rl_list[:i+1])\n num=rl_list[i]//2\n if rl_list[i]%2==0:\n ans[index]+=num\n ans[index-1]+=num\n else:\n ...
['Wrong Answer', 'Accepted']
['s505682992', 's572614237']
[5000.0, 9016.0]
[2104.0, 151.0]
[552, 547]
p02954
u578462133
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)\nans = [1]*len(s)\n\nfor i in range(n-1):\n if s[i] == 'R' and s[i+1] == 'R':\n ans[i+2] += ans[i]\n ans[i] = 0\n\nfor i in range(n-1, 0, -1):\n if s[i] == 'L' and s[i-1] == 'L':\n ans[i-2] += ans[i]\n ans[i] = 0\n \nprint(ans)", 's = input()\n\nn = l...
['Wrong Answer', 'Accepted']
['s814569636', 's663365109']
[4852.0, 10484.0]
[82.0, 99.0]
[279, 315]
p02954
u578850957
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))\nS.append('R')\nR_start = 0\nR_end = 0\nL_start = 0\nL_end = 0\nR_count = 1\nL_count = 1\nfor i in range(0,len(S)-1):\n if S[i]=='R':\n if S[i]==S[i+1]:\n R_count+=1\n else:\n R_end = i\n L_start = i+1\n L_count = 1\n\n...
['Wrong Answer', 'Accepted']
['s864015270', 's353492855']
[5672.0, 10796.0]
[99.0, 124.0]
[1021, 1093]
p02954
u580904613
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)\ntmp = []\ncnt = 1;\n\nfor i in range(len(S)-1):\n if(S[i] == S[i+1]):\n cnt += 1\n else:\n tmp.append(cnt)\n cnt = 1\ntmp.append(cnt)\n\ncnt = 0\nfor i in range(len(tmp)-1):\n cnt += tmp[i]\n if(i % 2 == 0):\n if((tmp[i] - tmp[i+1])%2 == 0):\n ans[cnt-1] = int((tmp[...
['Wrong Answer', 'Accepted']
['s293310201', 's611114667']
[7280.0, 7280.0]
[147.0, 167.0]
[928, 927]
p02954
u581094488
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\nchildren = [0] * N\n\nturn_position = list()\n\nfor i in range(N-1):\n\tif S[i]=='R' and S[i+1]=='L':\n\t\tturn_position.append(i)\n\nfor turn_i in range(len(turn_position) - 1):\n\tturn_pos = turn_position[turn_i]\n\tturn_pos_next = turn_position[turn_i + 1]\n\n\tchildren[turn_pos] += 1\n\...
['Wrong Answer', 'Accepted']
['s664368173', 's019009819']
[6780.0, 6400.0]
[78.0, 124.0]
[1067, 336]
p02954
u586662847
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\n\nS = 'RRRLLRLLRRRLLLLL' # input()\n\n\ndef solve():\n ans = []\n ss = itertools.groupby(S)\n\n for key, groups in ss:\n groups = list(groups)\n groups_cnt = len(groups)\n nothing_cnt = [0] * (groups_cnt - 1)\n\n even_cnt = groups_cnt // 2\n odd_cnt = gro...
['Wrong Answer', 'Accepted']
['s170041183', 's986901125']
[3064.0, 12148.0]
[17.0, 149.0]
[627, 606]
p02954
u589969467
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 f(r,l):\n # 3,2\n tmp = [0 for i in range(r+l)]\n if (r+l)%2==0:\n tmp[r-1]=(r+l)//2\n tmp[r]=(r+l)//2\n else:\n if r%2==0:\n tmp[r-1]=(r+l)//2\n tmp[r]=(r+l)//2+1\n else:\n tmp[r-1]=(r+l)//2+1\n tmp[r]=(r+l)//2\n return tmp\n\...
['Wrong Answer', 'Accepted']
['s865733440', 's685115645']
[10492.0, 10504.0]
[85.0, 109.0]
[714, 767]
p02954
u593019570
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 = list(input())\nb = np.array([1 for i in range(len(a))])\nprint(a)\nkeep1 = np.array([0 for i in range(len(a))])\nkeep2 = np.array([0 for i in range(len(a))])\nhako = np.array([0 for i in range(len(a))])\nfor j in range(1000000000):\n hako = np.array([0 for i in range(len(a))])\n print(b,...
['Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Accepted']
['s102535098', 's136323346', 's628795320', 's828666779', 's989350452']
[23508.0, 13180.0, 13848.0, 36176.0, 13976.0]
[2109.0, 2104.0, 139.0, 2104.0, 143.0]
[692, 464, 462, 518, 462]
p02954
u594803920
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 = []\ncount_r = 0\ncount_l = 0\nfor i in range(len(s)):\n if s[i] == 'R':\n if i == 0:\n count_r += 1\n ans.append(0)\n elif s[i-1] == 'L':\n if (count_r + count_l) % 2 == 0:\n ans.pop()\n ans.append((count_r+count_l)//2)\n ans.append((count_r+count_l)...
['Runtime Error', 'Accepted']
['s391594693', 's347370332']
[3064.0, 7268.0]
[17.0, 143.0]
[1249, 2004]
p02954
u594956556
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)\nkodomo=[0 for i in range(n)]\ncr1=0\ncr2=0\nrflag=False\nrlflag=False\nfor i in range(n):\n if s[i]=='R':\n rlflag=False\n if rflag:\n cr2+=1\n rflag=False\n else:\n cr1+=1\n rflag=True\n else:\n if rlflag:\n continue\n else:\n rlflag=True\n if ...
['Wrong Answer', 'Accepted']
['s546980702', 's327301019']
[4992.0, 10496.0]
[105.0, 119.0]
[946, 966]
p02954
u597509593
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\nS = input()\n\nl = []\nfor m in re.finditer(r'(R+)(L+)', S):\n part = ''.join(m.groups())\n print(part)\n lst = [0] * len(part)\n idx = re.search(r'RL', part).start()\n if len(part) % 2:\n lst[idx] = len(part) // 2 + (idx + 1) % 2\n lst[idx + 1] = len(part) // 2 + idx % 2\n ...
['Wrong Answer', 'Accepted']
['s891203223', 's170608796']
[11764.0, 11636.0]
[240.0, 186.0]
[427, 429]
p02954
u598812605
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()\ncnt = 0\ncnt_lis = []\nfor i in range(len(s) - 1):\n if s[i] == s[i + 1]:\n cnt += 1\n else:\n cnt_lis.append(cnt + 1)\n cnt = 0\ncnt_lis.append(cnt + 1)\ncnt2_lis = []\nflg = 0\nfor i in range(len(cnt_lis)):\n if i % 2 == 0:\n c_f = cnt_lis[i]\n else:\n c_s...
['Wrong Answer', 'Accepted']
['s506523209', 's070822617']
[10620.0, 6392.0]
[263.0, 137.0]
[1080, 219]
p02954
u600195339
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 = []\n\ndef latterCount(idx, s):\n if len(s) == 0:\n return 0\n if s[idx] != 'L':\n return 0\n\n count = 1\n for i in range(idx+1, len(s)):\n if s[i] == 'L' and s[i] == s[i-1]:\n count += 1\n else:\n break\n return count\n\ndef formerCo...
['Runtime Error', 'Wrong Answer', 'Wrong Answer', 'Runtime Error', 'Accepted']
['s165663710', 's435416988', 's561630618', 's660928841', 's849069478']
[3064.0, 10992.0, 10832.0, 10648.0, 10648.0]
[17.0, 2104.0, 2104.0, 84.0, 123.0]
[1188, 981, 618, 982, 1198]
p02954
u604398799
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"""\nCreated on Sat Apr 20 20:47:47 2019\n\n@author: Owner\n"""\n\nimport numpy as np\nimport sys\nimport collections\nimport scipy.misc\nimport math\nfrom operator import itemgetter\nimport itertools\nimport copy\nimport bisect\nimport heapq\nfrom collections import deque\n\n\ndef prime_deco...
['Wrong Answer', 'Accepted']
['s786925594', 's493948605']
[20828.0, 20828.0]
[282.0, 285.0]
[5940, 5933]
p02954
u608088992
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 play(S, i):\n if S[i] == "L": return i - 1\n else: return i + 1\n\ndef solve():\n S = input()\n N = len(S)\n move = 10 ** 100\n \n leftL, rightR = [N-1] * N, [0] * N\n for i in range(1, N):\n if S[i] == "R": rightR[i] = i\n else: rightR[i] = rightR[i-1]\n if S[N-i-1] =...
['Wrong Answer', 'Accepted']
['s839973652', 's938374658']
[17476.0, 15296.0]
[120.0, 100.0]
[896, 691]
p02954
u614875193
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)\nS = list(S)\nChildren = [0]*N\nRL = []\nLR = []\n\nA = [0]*N\nfor i in range(N):\n if S[i] =='L':\n A[i] = 1\n elif S[i] == 'R':\n A[i] = 2\n\nfor i in range(N-1):\n if A[i] == 2 and A[i+1] == 1:\n RL.append(i+1)\n\nfor i in range(N-1):\n if A[i] == 1 and A[i+...
['Wrong Answer', 'Accepted']
['s709461156', 's715899825']
[11760.0, 7056.0]
[2104.0, 170.0]
[1273, 902]
p02954
u619819312
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()\nt=[0]*len(s)\np=0\nfor i in range(len(s)):\n if s[i]=="R":\n p+=1\n else:\n if p%2==0:\n t[i-1]+=p//2\n t[i]+=p//2\n else:\n t[i-1]+=p//2\n t[i]+=p//2+1\n p=0\nt=t[::-1]\ns=s[::-1]\nfor i in range(len(s)):\n if s[i]=="L":\n ...
['Wrong Answer', 'Accepted']
['s614345235', 's867869408']
[6504.0, 6504.0]
[122.0, 127.0]
[478, 478]
p02954
u623687794
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+="2"\na=[]\nc=0\nfor i in range(len(s)-1):\n c+=1\n if s[i]!=s[i+1]:\n a.append(c)\n c=0\nansl=[]\nfor i in range(len(a)//2):\n t1=a[i]//2;r1=a[i]-t1\n t2=a[i+1]//2;r2=a[i]-t2\n flag=["0" for i in range(a[i]-1)]+[str(r1+t2)]+[str(r2+t1)]+["0" for i in range(a[i+1]-1)]\n ansl+=flag\nprin...
['Wrong Answer', 'Wrong Answer', 'Accepted']
['s297828038', 's550751550', 's385010914']
[11560.0, 12256.0, 11560.0]
[182.0, 201.0, 189.0]
[320, 336, 335]
p02954
u625554679
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\nLRpos = [s.start() for s in re.finditer('LR', S)]\nLRpos.insert(0, -1)\nLRpos.append(len(S))\n\nfinal_state = [0]*len(S)\n\nfor i in range(len(LRpos)-1):\n part_str = S[LRpos[i]+1:LRpos[i+1]+1]\n RLpos = part_str.find('RL')\n num_R = RLpos+1\n num_L = len(part_str) - num_R\n\n final_st...
['Runtime Error', 'Wrong Answer', 'Accepted']
['s326245769', 's378931870', 's322332167']
[3188.0, 7496.0, 12660.0]
[17.0, 107.0, 125.0]
[433, 455, 675]
p02954
u638714542
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())\nn = len(s)\nans = [0] * n\ntmp = -1\nfor i in range(n-1):\n if s[i]=='R' and s[i+1]=='L':\n a=i-tmp \n if i==n-2:\n a+=1\n tmp=i\n ans[i]+=-(-a//2)\n ans[i+1]+=a//2\n elif s[i]=='L' and s[i+1]=='R':\n a=i-tmp\n ans[tmp]+= a//2\n ans[tmp+1]+= -(-a//2)\n tmp=i\n e...
['Wrong Answer', 'Accepted']
['s013482054', 's402997001']
[4852.0, 6528.0]
[98.0, 126.0]
[383, 391]
p02954
u642874916
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...
["maps = [s for s in str(input())]\npeople = [{'pos': i, 'prev': -1, 'loop': -1} for i in range(len(maps))]\nmax_count = 10**100\n\n\ndef update(people, index):\n for person in people:\n if person['loop'] > 0:\n continue\n\n if maps[person['pos']] == 'R':\n if person['prev'] == pe...
['Wrong Answer', 'Accepted']
['s006725658', 's713192372']
[48100.0, 6400.0]
[2106.0, 140.0]
[1229, 517]
p02954
u645250356
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,fractions\na = input()\nn = len(a)\nt = []\nans = [0] * n\ncnt = 0\ntmp = a[0]\nfor i in range(n):\n if a[i] == tmp:\n cnt += 1 \n else:\n t.append(cnt)\n tmp = a[i]\n cnt = 1\nt.append(cnt)\nprint(t)\nN = len(t)\nlen = 0\nfor i in range(N)[::2]:\n tmp_len = t[i] + t[i+1...
['Wrong Answer', 'Wrong Answer', 'Accepted']
['s689060363', 's826721072', 's590399670']
[14224.0, 9176.0, 12056.0]
[192.0, 151.0, 112.0]
[538, 1023, 767]
p02954
u663230781
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().rstrip("\\n")\n\nmode = \'R\'\n\nimport re\npattern = "(R+)(L+)"\n\nresult = len(s) * ["0"]\nindex = 0\nfor r, l in re.findall(pattern, s):\n r_len = len(r)\n l_len = len(l)\n r_len_half,r_len_mod = divmod(r_len, 2)\n l_len_half,l_len_mod = divmod(l_len, 2)\n \n \n r_left = r_len_half...
['Wrong Answer', 'Accepted']
['s857497467', 's894757134']
[13252.0, 13252.0]
[114.0, 114.0]
[562, 569]
p02954
u665038048
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 = [1]*(len(s))\nans_list = []\nfor i in range(100):\n ans_n = [1]*(len(s))\n for j in range(1, len(s)-1):\n if s[j+1] == 'R' and s[j-1] == 'L':\n ans_n[j] = 0\n elif s[j+1] == 'R' and s[j-1] == 'R':\n ans_n[j] = ans[j-1]\n elif s[j+1] == 'L' and ...
['Wrong Answer', 'Accepted']
['s846310228', 's422667831']
[36616.0, 11180.0]
[2106.0, 108.0]
[696, 279]
p02954
u665452497
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)\nli_p=[1]*n\nli_pp=li_p\n\nfor i in range(n):\n li_tmp=[0]*n\n for i in range(n):\n if s[i]=='R':\n li_tmp[i+1]+=li_p[i]\n else:\n li_tmp[i-1]+=li_p[i]\n \n #print(li_tmp)\n \n if li_tmp==li_p:\n print(' '.join(map(str, li_tmp)))\n ...
['Wrong Answer', 'Accepted']
['s583431440', 's082909177']
[11972.0, 17072.0]
[2104.0, 78.0]
[521, 867]
p02954
u669173971
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)\nb=[0]*n\nsec=-1\nsec_=0\nr=0\nl=0\nri=0\nli=0\nchild=0\n\nfor i in range(n):\n if i!=n-1:\n if s[i]=="R" and s[i+1]=="L":\n ri=i\n li=i+1\n if s[i]=="L" and s[i+1]=="R":\n sec_=sec\n sec=i\n child=sec-sec_\n if (ri-sec_+1)%2==1:\n ...
['Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Accepted']
['s200581542', 's357241806', 's789770896', 's932787825', 's748407620']
[7092.0, 7092.0, 7088.0, 7096.0, 7088.0]
[133.0, 123.0, 120.0, 129.0, 134.0]
[654, 476, 469, 569, 650]
p02954
u673361376
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 sys import stdin\n\ndef move(line, kids):\n for index in range(len(line)):\n if line[kids[index]] == "R":\n kids[index] += 1\n else:\n kids[index] -= 1\n return kids\n\ndef ans(len_line, kids):\n ans = [0 for i in range(len_line)]\n for i in range(len_line):\n ans[kids[i]]+=1\n \n print(...
['Wrong Answer', 'Time Limit Exceeded', 'Wrong Answer', 'Accepted']
['s079224889', 's174946165', 's659223404', 's213814713']
[18040.0, 7292.0, 14616.0, 10492.0]
[220.0, 2104.0, 251.0, 73.0]
[616, 427, 421, 573]
p02954
u677267454
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'\nN = len(S)\nans = [0 for _ in range(N - 1)]\nswitch = 'R'\ncountR = 0\ncountL = 0\npoint = 0\nfor i in range(N):\n if S[i] == switch:\n if switch == 'R':\n countR += 1\n else:\n countL += 1\n else:\n if switch == 'L':\n switch = 'R'\n ...
['Wrong Answer', 'Accepted']
['s399509077', 's975002546']
[10492.0, 10492.0]
[84.0, 88.0]
[754, 915]
p02954
u682271925
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\nright = 0\nleft = 0\n\nli = []\ncount = 0\nli_count = [0]\n\nfor i in s:\n if i == "R" and left == 0:\n right += 1\n elif i == "R":\n li.append([right,left])\n li_count.append(count)\n right = 1\n left = 0\n elif i == "L":\n left += 1\n count += 1\n...
['Wrong Answer', 'Accepted']
['s562046732', 's027558179']
[11896.0, 13464.0]
[136.0, 170.0]
[590, 591]
p02954
u686036872
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\n\nans = [0]*(len(S))\ncnt = 0\nfor i in range(len(S)-1):\n cnt += 1\n if S[i] == "R" and S[i+1] =="L":\n ans[i] += -(-cnt//2)\n ans[i+1] += cnt//2\n x = i\n cnt = 0\n if S[i] == "L" and S[i+1] =="R" or :\n ans[x] += cnt//2\n ans[x+1] += -(-cnt//2)\n ...
['Runtime Error', 'Runtime Error', 'Accepted']
['s136028150', 's943423564', 's650436825']
[2940.0, 2940.0, 6400.0]
[17.0, 17.0, 140.0]
[432, 432, 422]
p02954
u686230543
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\ni = 0\nis_r = True\nrl_list = []\nr, l = 0, 0\nidx = None\nfor i in range(n)\n if s[i] == 'R':\n if not is_r:\n rl_list.append((r, l, idx))\n is_r = True\n r, l = 0, 0\n r += 1\n else:\n if is_r:\n is_r = False\n idx = i - 1\n l += 1\nrl_list.append((r...
['Runtime Error', 'Accepted']
['s413487538', 's849821489']
[2940.0, 16096.0]
[17.0, 102.0]
[473, 474]
p02954
u687053495
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)\n\nans = [0] * N\nR = 1\nL = 0\ntmp = -1\n\nfor i in range(1, N):\n if S[i] == "R":\n R += 1\n else:\n L += 1\n\n if S[i-1] == "R" and S[i] == "L":\n ans[i-1] += math.ceil(R / 2)\n ans[i] += math.floor(R / 2)\n\n R = 0\n tmp = i\n elif (S[i-1] == "L" and S[i]...
['Wrong Answer', 'Accepted']
['s251000568', 's471504740']
[6400.0, 6400.0]
[168.0, 173.0]
[431, 469]
p02954
u687574784
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\n\n\n\nimport bisect\n\nl = []\nx = 0\nfor s1, s2 in zip(S[0] + S, S):\n if s1 != s2:\n x += 1\n l.append(x)\n\nprint(l)\nans = [0] * len(S)\nfor i in range(len(S)):\n if S[i] == 'R':\n target = bisect.bisect_left(l, l[i]+1, lo=i)\n else:\n target = bisect.bisect_right(l...
['Wrong Answer', 'Accepted']
['s936183649', 's478593167']
[14740.0, 14568.0]
[172.0, 166.0]
[725, 716]
p02954
u688375653
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...
['tile=input()\n\n\nNOW_CHAR="R"\nsplit_index=[0]\n\nfor i,s in enumerate(tile):\n if s!=NOW_CHAR:\n if NOW_CHAR=="L":\n split_index.append(i)\n NOW_CHAR=s\nsplit_index.append(len(tile))\n\n\nparse_tile=[]\n\nfor i in range(len(split_index)-1):\n parse_tile.append(tile[split_index[i]:spli...
['Wrong Answer', 'Accepted']
['s247362847', 's936056965']
[8568.0, 15224.0]
[168.0, 168.0]
[821, 822]
p02954
u693007703
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\ncounter = []\ncnt_dict = {'R':0, 'L':0}\nfor i in range(len(S)):\n l = S[i]\n if l == 'R':\n if cnt_dict['L'] == 0:\n cnt_dict[l] += 1\n else :\n counter.append(cnt_dict)\n cnt_dict = {'R':0, 'L':0}\n cnt_dict[l] += 1\n else :\n ...
['Runtime Error', 'Accepted']
['s647090784', 's877161487']
[29352.0, 29204.0]
[131.0, 139.0]
[833, 837]
p02954
u693716675
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\nleft = 0\ni = 0\n\nwhile(left<n):\n while s[i]=="R":\n i+=1\n right=i\n while s[right]=="L":\n right +=1\n if right==n-1:\n right += 1\n break\n\n for k in range(left, right):\n if (i-k) % 2==0:\n ans[i] += 1\n else:\n ans[i-1] += 1\n\n ...
['Runtime Error', 'Accepted']
['s272413697', 's254340790']
[6400.0, 6400.0]
[107.0, 128.0]
[334, 349]
p02954
u694665829
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 collections import Counter\n\nS=input()\nn=len(S)\ndp=[[0]*n for _ in range(20)]\n\nfor i,s in enumerate(S):\n dp[0][i]=i-1 if s =='L' else i+1\n\nfor k in range(19):\n for i in range(n):\n dp[k+1][i]=dp[k][dp[k][i]]\n\nC=Counter(dp[-1])\nprint(dp[-1])\nprint(C)\nprint(*[C[i] for i in range(n)])", "...
['Wrong Answer', 'Accepted']
['s193103473', 's381719155']
[48048.0, 29440.0]
[559.0, 475.0]
[298, 255]
p02954
u698176039
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 = list(input())\nN = len(S)\n\ndef solver(n,m,idx):\n N = n+m\n if (n-m)%2 == 0:\n ans = [0] * N\n ans[idx[0]] = (n+m)//2\n ans[idx[1]] = (n+m)//2\n else:\n ans = [0] * N\n if m%2 == 1:\n ans[idx[1]] = (n+m)//2 + 1\n ...
['Runtime Error', 'Runtime Error', 'Wrong Answer', 'Accepted']
['s340706097', 's448673039', 's998993251', 's665074244']
[3316.0, 3316.0, 7088.0, 7092.0]
[17.0, 17.0, 116.0, 119.0]
[840, 774, 772, 774]
p02954
u698868214
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 = [1]*N\n\nfor i in range(N):\n if S[i] == "R" and S[i+1] == "L":\n continue\n \n elif S[i] == "R":\n for j in range(i+2,N):\n if S[j] == "L":\n if (j-i)%2 == 0:\n ans[j-1] += ans[i]\n else:\n ans[j] += ans[i]\n ans[i] = 0\n \n...
['Wrong Answer', 'Accepted']
['s119128069', 's697767943']
[9888.0, 10760.0]
[2206.0, 93.0]
[496, 236]
p02954
u701438499
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\n\n\n\n\n\nimport sys\nimport re\na = sys.stdin.readline().strip();\npattern = 'RL'\n\n\n\n\np1 = []\np2 = [-1]\n\nfor m in re.finditer(r'RL', a, re.MULTILINE):\n\tp1.append(m.start(0))\n\n# \nfor m in re.finditer(r'LR', a, re.MULTILINE):\n\tp2.append(m.start(0))\np2.append(len(a)-1)\n\n\n# print(p1)\n# print(p2)\...
['Wrong Answer', 'Wrong Answer', 'Accepted']
['s608367368', 's637280041', 's049271381']
[14452.0, 14708.0, 14708.0]
[111.0, 112.0, 127.0]
[834, 835, 1025]
p02954
u707870100
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#ABC136C\nimport copy\nimport sys\nimport math\n\nn = int(input())\ntmp = input().split()\nhoge = list(map(lambda a: int(a), tmp))\nminhoge=hoge[n-1]\nfor i in range(1,n):\n\tt=n-1-i\n\tif(hoge[t]>minhoge+1):\n\t\tprint("No")\n\t\tsys.exit()\n\telif(hoge[t]<minhoge):\n\t\tminhoge=hoge[t]\n\ti...
['Runtime Error', 'Wrong Answer', 'Accepted']
['s227747872', 's776901011', 's009909366']
[3700.0, 5420.0, 5108.0]
[22.0, 165.0, 163.0]
[344, 478, 464]
p02954
u708255304
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\nRLcontinue = []\n\nright = 1\nnow = S[0]\nleft = 0\nfor i in range(1, len(S)):\n if now == S[i]:\n if S[i] == \'R\':\n right += 1\n if i == (len(S)-1):\n RLcontinue.append(right)\n elif S[i] == \'L\':\n left += 1\n if i ==...
['Wrong Answer', 'Accepted']
['s515545997', 's860680098']
[11380.0, 11260.0]
[121.0, 173.0]
[1804, 1398]
p02954
u728615412
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('R')\ncounter = 1\nNum = [0]*len(S)\nfor i in range(len(S)-1):\n if S[i] == S[i+1]:\n counter += 1\n elif S[i] == 'R' and S[i+1] == 'L':\n if counter % 2 == 1:\n Num[i] += (counter//2) + 1\n Num[i+1] += counter // 2\n counter = 1\n print(1)\n else:\n Num...
['Wrong Answer', 'Accepted']
['s212092766', 's298419024']
[7328.0, 7092.0]
[211.0, 134.0]
[668, 609]
p02954
u733608212
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 = input()\nans = [0 for _ in n]\ncount = 0\nfor i in range(len(n)):\n print(ans)\n count += 1\n if n[i] == "L":\n if loop_pos %2 == i % 2:\n ans[loop_pos] += 1\n else:\n ans[loop_pos+1] += 1 \n count = 0 \n elif n[i] != n[i+1]: \n ans[i] = count /...
['Wrong Answer', 'Accepted']
['s038447957', 's118443091']
[102060.0, 10492.0]
[2104.0, 97.0]
[464, 452]
p02954
u735891571
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()\ncount = 0\nflag = 0\nAns = [0] * len(S)\nfor i in range(0, len(S)):\n if flag == 0:\n if S[i] == "R":\n count += 1\n elif S[i] == "L":\n count += 1\n flag = 1\n r_place = i-1\n elif flag == 1:\n if S[i] == "R":\n flag = ...
['Wrong Answer', 'Runtime Error', 'Wrong Answer', 'Accepted']
['s641816706', 's872788936', 's911249071', 's630184415']
[10612.0, 4212.0, 10612.0, 10612.0]
[94.0, 63.0, 102.0, 107.0]
[932, 1690, 1219, 1708]
p02954
u741397536
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)\nN = [1 for i in range(len(S))]\n\n\npre = ""\ntmp_r = 0\ntmp_l = 0\nRi = 0\nLi = 0\n\nfor i in range(len(S)):\n if pre == "":\n pre = S[i]\n elif i == len(S)-1:\n tmp_l += 1\n N[i] = 0\n N[Ri] += (tmp_r // 2) + (tmp_l // 2 + tmp_l % 2)\n N[Li] += (tmp...
['Wrong Answer', 'Accepted']
['s508738515', 's255205436']
[5584.0, 5584.0]
[248.0, 234.0]
[966, 1194]
p02954
u756514276
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\n\nS = input()\nN = len(S)\nchl = [0] * N\n\npeo = 0\nfor i in range(0, N, 1):\n if(S[i] == "R"):\n peo += 1\n else:\n chl[i-1] += (peo+1)//2\n chl[i] += peo//2\n peo = 0\n\npeo = 0\nfor i in reversed(range(0, N, 1)):\n if(S[i] == "L"):\n peo += 1\n else:\n ...
['Runtime Error', 'Runtime Error', 'Accepted']
['s707478680', 's821068564', 's134640421']
[3956.0, 3956.0, 10484.0]
[66.0, 62.0, 101.0]
[389, 389, 350]
p02954
u756518877
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 -*-\nS=input()\nswitch=0\ntemp=[0]\nj=0\nans=[0]*(len(S))\nfor i in range(len(S)):\n if S[i]=="L" and switch==0:\n switch=1\n temp.append(i)\n j=j+1\n ans[i-1]=ans[i-1]+(i-1-temp[j-1])//2+1\n ans[i]=ans[i]+(i-temp[j-1])//2+1\n elif S[i]=="R" and switch==1:\...
['Wrong Answer', 'Accepted']
['s684996326', 's229077490']
[8900.0, 14532.0]
[133.0, 151.0]
[789, 817]
p02954
u756604554
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\ndef input():\n return sys.stdin.readline()[:-1]\n\nS = list(input())\nS.append('R')\n\nans = []\n\nR_count = 0\nL_count = 0\nbefore = 'R'\n\nfor R_L in S:\n if before == 'L' and R_L == 'R':\n ans.extend([0]*(R_count-1))\n total = R_count + L_count\n if total % 2 == 0:\n ...
['Wrong Answer', 'Accepted']
['s593267840', 's556813101']
[5668.0, 7116.0]
[108.0, 148.0]
[757, 758]
p02954
u758411830
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\nS = list(input())\ncnts = [0]*len(S)\nc = 0\nfor idx in range(len(S)):\n if S[idx] == 'R':\n c += 1\n else:\n cnts[idx] += np.floor(c / 2)\n cnts[idx-1] += np.ceil(c / 2)\n\nc = 0\nfor i in range(len(S)):\n idx = len(S)-i-1\n if S[idx] == 'L':\n c += 1\n ...
['Wrong Answer', 'Accepted']
['s615711331', 's028561195']
[23980.0, 23260.0]
[926.0, 855.0]
[424, 466]
p02954
u759721333
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()))\nn = len(s)\ngaki_rside = 0\ngaki_lside = 0\nans = [0] * n\ni = 0\nwhile i < n-2:\n if s[i:i+2] == ['R', 'R']:\n gaki_rside += 1\n i += 1\n elif s[i:i+2] == ['R', 'L']:\n gaki_rside += 1\n for j in range(i+1, n):\n if s[j] == 'L' and j < n-1:\n ...
['Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Accepted']
['s578380913', 's638578825', 's826746729', 's828205447']
[11176.0, 12588.0, 11180.0, 11180.0]
[147.0, 151.0, 157.0, 143.0]
[947, 922, 922, 922]
p02954
u767664985
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 runLength(str):\n \n res = []\n data, count = str[0], 1\n for i in range(1, len(str)):\n if str[i] == data:\n count += 1\n else:\n res.append((data, count))\n data, count = str[i], 1\n res.append((data, count))\n return res\n\nS = input() # S[0] ==...
['Wrong Answer', 'Wrong Answer', 'Accepted']
['s242009985', 's860455250', 's654873561']
[11132.0, 13304.0, 11124.0]
[139.0, 194.0, 137.0]
[728, 748, 792]
p02954
u776338097
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 import sys\n input = sys.stdin.readline\n \n s = input()\n n = len(s)\n arr = [0] * n\n for i in range(n - 1):\n if s[i] == \'R\' and s[i + 1] == \'L\':\n arr[i] = arr[i + 1] = -1\n j = i - 1\n while j >= 0 and s[j] == \'R\':\n ...
['Wrong Answer', 'Accepted']
['s959179279', 's141759432']
[8868.0, 8704.0]
[118.0, 113.0]
[852, 857]
p02954
u780962115
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...
['st=list(input())\nst.append("E")\nuselistR=[]\ncnt=0\nfor i in range(len(st)):\n if st[i]=="R" :\n cnt+=1\n if st[i]!="R" and cnt>=1:\n uselistR.append(cnt)\n cnt=0\n else:\n continue\nuselistL=[] \nfor i in range(len(st)):\n if st[i]=="L" :\n cnt+=1\n if st[i]...
['Wrong Answer', 'Wrong Answer', 'Accepted']
['s086958324', 's841818039', 's660921875']
[7884.0, 6992.0, 7884.0]
[210.0, 261.0, 204.0]
[1356, 1378, 1354]
p02954
u781755665
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\ninput = sys.stdin.readline\n\nS = input().strip()\nN = len(S)\n\ncrs = list(map(len, S.split('R')))\ncls = list(map(len, S.split('L')))\nconverges=[0] * N\n\ncurrent_index = 0\nfor cr in crs:\n if cr == 0:\n current_index += 1\n else:\n odd = cr // 2\n even = cr - odd\n ...
['Wrong Answer', 'Accepted']
['s063144687', 's613342073']
[12024.0, 11884.0]
[90.0, 94.0]
[704, 705]
p02954
u781758937
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)\nS = "x"+S+"x"\nL = [1]*N\n\ncnt = 0\nm1 = [0]*N\nm2 = [0]*N\nwhile m2 != L:\n m2 = m1[:]\n m1 = L[:]\n tmp = L[:]\n for i in range(N):\n if L[i] == 0:\n pass\n elif S[i+1] == "R" and S[i+2]!="x":\n tmp[i] -= L[i]\n tmp[i+1] += L[i]\n elif S[i+1] == "L" and S[i]!="x...
['Wrong Answer', 'Accepted']
['s528083715', 's193455922']
[35508.0, 6400.0]
[2104.0, 117.0]
[474, 278]
p02954
u784022244
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())\nT = [1 for i in range(len(S))]\n\n\nfor i in range(10**(5)):\n U = [0 for k in range(len(S))]\n U[1]+=T[0]\n U[len(S)-2]+=T[len(S)-1]\n for j in range(1,len(S)-1):\n if S[j]=='R':\n U[j+1]+=T[j]\n else:\n U[j-1]+=T[j]\n T = U\n \nfor i in T:\n print(i, end=' ')", "S = list(in...
['Time Limit Exceeded', 'Time Limit Exceeded', 'Accepted']
['s421712679', 's779952593', 's663511537']
[5544.0, 5544.0, 6400.0]
[2104.0, 2104.0, 187.0]
[287, 289, 716]
p02954
u786793781
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\nimport re\n\ns = input().strip()\nanswer = [0 for _ in range(len(s))]\n\n\n\n\n\n#\n\n\n\nm = re.findall('R+L+', s)\n\nprint('substr', m)\n\n# m = ['RRL', 'RL']\nidx = 0\nfor substr in m:\n \n\n \n substr_len = len(substr)\n if idx % 2 == 0:\n gu = (substr_len + 1) // 2\n...
['Wrong Answer', 'Accepted']
['s092589309', 's227905851']
[9972.0, 9712.0]
[129.0, 130.0]
[1357, 1337]
p02954
u790922244
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...
['R="R"\nL="L"\n\ndef f(r, l):\n ans_r = (r // 2) + (l // 2) + (l % 2)\n ans_l = (r // 2) + (r % 2) + (l // 2)\n return (ans_r, ans_l)\n\nS=input()\nN=len(S)\nans=[0]*N\n\nr_begin = 0\nr_end = 0\nl_begin = 0\nl_end = 0\nfor i in range(N):\n if S[i] == R:\n if r_end == 0:\n continue\n ...
['Wrong Answer', 'Accepted']
['s897422500', 's246367629']
[6400.0, 6400.0]
[114.0, 121.0]
[801, 805]
p02954
u794250528
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()\ncounter = [0] * len(s)\nfor i in range(len(s)):\n c = s[i]\n d = 1 if c == 'R' else -1\n j = i\n while s[j] == c:\n j += d\n\n if abs(i - j) % 2 == 0:\n counter[j] += 1\n else:\n counter[j - d] += 1\n\nprint(counter)", "s = input()\n\nn = len(s)\nd = [0] * n\n\nx = ...
['Wrong Answer', 'Accepted']
['s594181764', 's588673968']
[4852.0, 14452.0]
[2104.0, 126.0]
[254, 582]
p02954
u798260206
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=len(S)\nans=[1]*l\nfor i in range(l-2):\n if s[i]==s[i+1]=="R":\n ans[i+2]+=ans[i]\n ans[i]=0\nfor i in range(l-1,1,-1):\n if s[i]==s[i-1]=="L":\n ans[i-2]+=ans[i]\n ans[i]=0\nprint(*ans)', 's = input()\nl=len(s)\nans=[1]*l\nfor i in range(l-1):\n if s[i]==s[i+1]=="...
['Runtime Error', 'Accepted']
['s628346271', 's362799700']
[3956.0, 6400.0]
[18.0, 123.0]
[225, 225]
p02954
u802772880
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())+['0']\nn=len(s)\ncnt=0\nj=0\nRL=[0]\nans=[0]*n\nfor i in range(n):\n if s[i]=='R' and s[i+1]=='L':\n RL[j]+=1\n \n elif s[i]=='L' and s[i+1]=='R':\n RL[j]+=1\n RL+=[0]\n j+=1\n else:\n RL[j]+=1\nRL[-1]-=1\nj=0\nfor i in range(n-1):\n if s[i]=='R' a...
['Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Accepted']
['s026002043', 's085379960', 's093461352', 's612743307', 's910838993', 's419816126']
[11540.0, 11428.0, 11416.0, 12192.0, 22616.0, 21668.0]
[122.0, 121.0, 126.0, 131.0, 250.0, 223.0]
[556, 578, 566, 571, 964, 952]
p02954
u802963389
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\nimport math\n\n\nans = [0] * len(s)\nstart = 0\nfor i in range(len(s) - 1):\n if (s[i]=="L" and s[i+1]=="R") or i == len(s) - 2:\n ss = s[start:i+1]\n start = i+1\n# print(ss)\n\n rlpos = ss.find("RL")\n if len(ss) % 2 == 0:\n ans[i-len(ss)+rlpos+1] = len(ss)/2\n ans[i-len(ss)...
['Wrong Answer', 'Runtime Error', 'Accepted']
['s535599055', 's601403393', 's334053894']
[7468.0, 3188.0, 6400.0]
[153.0, 18.0, 132.0]
[825, 341, 598]
p02954
u810625173
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 copy\nN = list(input())\nnums = len(N)\nmass = [1 for _ in range(nums)]\n\nprev = N[0]\ndicr = {}\ndicl = {}\nfor i in range(1, len(N)):\n if prev == "R" and N[i] == "L":\n dicr[i-1] = True\n dicl[i] = True\n prev = N[i]\nprint(dicl)\nprint(dicr)\nfor i in range(len(N)):\n if i not in dicr and i not i...
['Wrong Answer', 'Accepted']
['s728740121', 's257335791']
[22984.0, 20552.0]
[2104.0, 150.0]
[799, 764]
p02954
u814986259
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)\ntmp=[]\nfor i in range(len(s)):\n tmp.append(s[i])\n if i < len(s)-1:\n if s[i:i+2]=="LR":\n tmp="".join(tmp)\n x = len(tmp)\n k = tmp.index("RL")\n if x%2==0:\n ans[i-x+k]=x//2\n ans[i-x+k+1]=x//2\n else:\n if max(k,x-(k+2))%2==0:\n ...
['Runtime Error', 'Wrong Answer', 'Accepted']
['s518875989', 's932493553', 's266579400']
[11388.0, 11108.0, 10996.0]
[83.0, 140.0, 144.0]
[471, 718, 407]
p02954
u821284362
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()\nmax_ind = len(s)-1\ncount_l = 0\ncount_r = 0\ntmp_ind = 0\nlast_ind = -1\nkey_ind = 0\nflag = True\ntext = ""\n\nfor i,c in enumerate(s):\n if flag == True: \n if c == "R":\n count_r+=1\n else:\n flag = False\n key_ind = i\n count_l = 1\n ...
['Wrong Answer', 'Accepted']
['s563570697', 's813255129']
[4720.0, 3956.0]
[205.0, 134.0]
[1059, 1003]
p02954
u823609854
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 lst = [0] * len(s)\n for i, c in enumerate(s):\n if c == 'R':\n for j, t in enumerate(s[i+1:]):\n if t == 'L':\n if (j + 1) % 2 == 0:\n lst[i+j+1] += 1\n break\n el...
['Wrong Answer', 'Accepted']
['s651647108', 's281391618']
[10356.0, 10484.0]
[2104.0, 118.0]
[762, 517]
p02954
u825385578
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...
["#!/usr/bin/env python\n# -*- coding: utf-8 -*-\n\nfrom sys import stdin\nimport math\nimport copy\n\n\n\n# for j in range(length):\n# if rl_list[j] == 'R':\n# now_child_list[j+1] += before_child_list[j]\n# now_child_list[j] -= before_child_list[j]\n## 'L'\n# else:\n# ...
['Wrong Answer', 'Accepted']
['s587498959', 's623590997']
[8448.0, 8448.0]
[189.0, 192.0]
[1461, 1447]
p02954
u829859091
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\neven = 1\nodd = 0\nres = [0]*len(S)\npre_s = 'R'\nRL_count = 1\nfor idx, cur_s in enumerate(S[1:]):\n idx+=1\n\n if pre_s == 'R' and cur_s == 'L':\n RL_points = (idx-1, idx)\n elif pre_s == 'L' and cur_s == 'R':\n res[RL_points[0]] += even\n res[RL_points[1]] += odd\...
['Wrong Answer', 'Accepted']
['s740356199', 's655739335']
[7188.0, 12564.0]
[124.0, 188.0]
[533, 693]
p02954
u830054172
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))]\nRL_ind = []\n\nfor i in range(len(s)-2):\n if s[i:i+2] == "RL":\n RL_ind.append(i)\nif s[-2:] == "RL":\n RL_ind.append(len(s)-2)\n\nfor i in range(len(s)):\n if s[i] == "R":\n ans_R = [j for j in RL_ind if j >= i]\n if (min(ans_R)-i)%2 == 0:...
['Wrong Answer', 'Accepted']
['s874481660', 's802546475']
[6756.0, 7088.0]
[2104.0, 133.0]
[569, 664]
p02954
u830400188
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)\nc = 0\nfor i in range(len(s)):\n if s[i] == 'R':\n c += 1\n if s[i] == 'L' and s[i-1] == 'R':\n if c % 2 == 0:\n ans[i] += c // 2\n ans[i-1] += c // 2\n else:\n ans[i] += c//2\n ans[i-1] += c//2 + 1\n c = 0\...
['Wrong Answer', 'Runtime Error', 'Runtime Error', 'Accepted']
['s659642157', 's673850617', 's946342533', 's406835813']
[4852.0, 3064.0, 3064.0, 10504.0]
[118.0, 17.0, 17.0, 127.0]
[596, 640, 624, 627]
p02954
u837342248
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 = [1 if x == "R" else -1 for x in input()]\nans = [0]*len(s)\ni = 0\nwhile i < len(s)-1:\n locate = i\n while s[locate+1] == s[i]:\n locate += 1\n if locate >= len(s)-1:\n break\n count = locate - i + 1\n tmp = math.ceil(count/2)\n if s[i] == 1:\n ans[loca...
['Wrong Answer', 'Accepted']
['s921514903', 's296199216']
[7076.0, 7080.0]
[180.0, 185.0]
[448, 488]
p02954
u840988663
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=len(S)\nx=[1]*len(S)\nfor i in range(L-2):\n if S[i] == S[i+1] == "R":\n x[i+2] += x[i]\n x[i]=0\nfor i in range(L-1,-1,-1):\n if S[i] == S[i-1] =="L":\n x[i-2] += x[i]\n x[i]=0\n\nprint(x)', 'S=input()\nL=len(S)\nx=[1]*len(S)\nfor i in range(L-2):\n if S[i] == S[i+1]...
['Wrong Answer', 'Accepted']
['s700388640', 's029649828']
[4852.0, 10484.0]
[90.0, 104.0]
[224, 271]
p02954
u842747358
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 rle(t):\n tmp2, count, ans = t[0], 1, []\n for i in range(1, len(t)):\n if tmp2 == t[i]:\n count += 1\n else:\n ans.append([tmp2, count])\n tmp2 = t[i]\n count = 1\n ans.append([tmp2, count])\n return ans\n\n\nS = list(input())\ns = []\ntmp = '...
['Wrong Answer', 'Accepted']
['s084967524', 's338289290']
[30904.0, 29768.0]
[273.0, 230.0]
[955, 942]
p02954
u846226907
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())\nprint(S)\n\nN = len(S)\n\nans = [0]*N\n\nfor _ in range(2):\n cnt = 0\n for i in range(len(S)):\n if S[i] =='R':cnt +=1\n else:\n ans[i] += int(cnt/2)\n ans[i-1] += int((cnt+1)/2)\n cnt = 0\n\n S.reverse()\n ans.reverse()\n for i in ran...
['Wrong Answer', 'Accepted']
['s794442504', 's940795099']
[7524.0, 7092.0]
[181.0, 180.0]
[407, 398]
p02954
u860002137
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(map(str, input().rstrip()))\n\n\ndef solve(s, d):\n arr = [0] * len(s)\n\n if d == "L":\n s = s[::-1]\n\n cnt = 0\n for i in range(len(s) - 1):\n if s[i] == d:\n cnt += 1\n elif cnt > 0:\n arr[i - 1] = cnt // 2 + cnt % 2\n arr[i] = cnt // 2\n ...
['Wrong Answer', 'Accepted']
['s964119928', 's056030687']
[7072.0, 7072.0]
[102.0, 108.0]
[453, 445]
p02954
u862569952
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 = list(input())\nr = [0] * len(S)\nr_count = 1\nl_count = 0\npre_s = "R"\nfor i,s in enumerate(S[1:len(S)]):\n print(i,s)\n if s == "R":\n if l_count > 0:\n # calc\n r[i-l_count+1] = r_count/2 + math.ceil(l_count/2)\n r[i-l_count] = math.ceil(r_count/2) + l...
['Wrong Answer', 'Accepted']
['s153423458', 's319017157']
[10092.0, 7060.0]
[390.0, 300.0]
[701, 731]
p02954
u864013199
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\n\n#S G S\n#RRR..RLL...LRR...\n\ns = list(input())\nleng = len(s)\ntmp = "R"\ns[0] = "S"\n\nfor i in range(1,leng):\n if s[i] == "L":\n if tmp == "R":\n s[i] = "G"\n tmp = "L"\n else:\n if tmp == "L":\n s[i] = "S"\n tmp = "R"\n\nlis = [0]*(le...
['Runtime Error', 'Runtime Error', 'Accepted']
['s119431053', 's339860873', 's000843878']
[10224.0, 10772.0, 10228.0]
[138.0, 140.0, 142.0]
[785, 794, 843]
p02954
u865413330
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)\nchild = [1] * N\n\n\ncount = 0\nfor i in range(N):\n count += 1\n if S[i] == "R" and S[i+1] == "L":\n if count % 2 != 0:\n child[0] -= 1\n child[i] += 1\n else:\n child[0] -= 1\n child[i+1] += 1\n break\n\nfor i in r...
['Wrong Answer', 'Wrong Answer', 'Accepted']
['s056486209', 's886188729', 's006808050']
[5712.0, 42404.0, 15140.0]
[2104.0, 2106.0, 121.0]
[1624, 757, 830]