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 | u872887731 | 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 = []\nr_ = 0 \nl_ = 0\nflag = 0\nfor i in range(len(S)):\n if flag == 0:\n if S[i]=="R":\n r_ = r_ +1\n continue\n elif i != len(S) -1:\n flag = 1\n l_ = l_ +1\n continue\n else:\n l_ = l_ +1\n al = l_ ... | ['Wrong Answer', 'Wrong Answer', 'Accepted'] | ['s069097893', 's507614135', 's951430781'] | [11412.0, 11412.0, 11436.0] | [163.0, 156.0, 168.0] | [932, 780, 1015] |
p02954 | u882209234 | 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\nrs = [0] * (N+1)\nls = [0] * (N+1)\n\nfor i in range(N):\n if S[i] == 'R':\n rs[i+1] = rs[i] + 1\n if S[N-1-i] == 'L':\n ls[N-1-i] = ls[N-i] + 1\n\nrs = rs[1:]\nls = ls[:N]\n\nprint(rs)\nprint(ls)\n\nans = [0] * N\nfor i in range(N-1):\n if S[i:i+2] == 'RL':\n ... | ['Wrong Answer', 'Accepted'] | ['s637202241', 's247243706'] | [16868.0, 16196.0] | [155.0, 143.0] | [745, 749] |
p02954 | u884692162 | 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 fractions\nimport math\nimport re\nfrom collections import defaultdict\n\nsr = lambda: sys.stdin.readline().rstrip()\nS = sr()\nr = True\nc = 0\nans = [0 for _ in range(len(S))]\nr = 0\nrll = [m.start() for m in re.finditer("RL", S)]\nlrl = [m.start() for m in re.finditer("LR", S)]\n\nfor i in rang... | ['Wrong Answer', 'Accepted'] | ['s621854639', 's992237206'] | [16636.0, 16636.0] | [120.0, 118.0] | [785, 763] |
p02954 | u888721916 | 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())\nbefore = "R"\nnum = 0\nnlist = []\nfor ch in S:\n if ch == before:\n num += 1\n else:\n nlist.append(num)\n num = 1\n before = ch\nelse:\n nlist.append(num)\nprint("nlist("+str(len(nlist))+"):"+str(nlist))\nans = []\nfor i in range(len(nlist)):\n print(i)\n if... | ['Wrong Answer', 'Accepted'] | ['s531508732', 's036355345'] | [13016.0, 11944.0] | [263.0, 159.0] | [644, 583] |
p02954 | u888965338 | 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 __name__ == '__main__':\n h = list(input())\n n = len(h)\n count = 0\n isR = True\n posL = 0\n res = [0 for i in range(0, n)]\n for i in range(0, n):\n count += 1\n if isR:\n if h[i] == 'L':\n res[i - 1] = count // 2\n res[i] = count // 2\... | ['Wrong Answer', 'Accepted'] | ['s444727192', 's640378986'] | [5544.0, 11176.0] | [85.0, 92.0] | [728, 747] |
p02954 | u891217808 | 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)\nrslt = [0] * n\ndic = {0:0, 1:1}\nfor i in range(1, n):\n if s[i] == 'L':\n rslt[i] += dic[(i+1)%2]\n rslt[i-1] += dic[i%2]\n dic[1] = 0\n dic[0] = 0\n else:\n dic[(i+1)%2] += 1\nfor i in range(n-1, 0, -1):\n if s[i] == 'R':\n rslt[i] += dic[... | ['Runtime Error', 'Wrong Answer', 'Accepted'] | ['s343635045', 's346935439', 's031785136'] | [4084.0, 4852.0, 10484.0] | [117.0, 124.0, 114.0] | [439, 429, 418] |
p02954 | u892687772 | 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)\nplist = [-1]\nans = [0 for _ in range(n)]\nr = 0\nl = 0\nfor i in range(n-1):\n if S[i]=="L" and S[i+1]=="R":\n plist.append(i)\n if S[i]=="R" and S[i+1]=="L":\n plist.append(i)\nplist.append(n-1)\nfor i in range(len(plist)-1):\n if i%2 == 0:\n a = (plist[i+1]-pl... | ['Wrong Answer', 'Wrong Answer', 'Accepted'] | ['s005953411', 's691788431', 's141459880'] | [8780.0, 10048.0, 10432.0] | [138.0, 148.0, 166.0] | [721, 734, 722] |
p02954 | u896451538 | 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)\nimport math\nlst = []\nswitch = "R"\ntmp = ""\nfor i in range(len(S)):\n\tif S[i]==switch:\n\t\ttmp += S[i]\n\t\tif i==len(S)-1:\n\t\t\tlst.append(tmp)\n\telse:\n\t\tlst.append(tmp)\n\t\ttmp = S[i]\n\t\tif i==len(S)-1:\n\t\t\tlst.append(tmp)\n\t\tif switch is "R":\n\t\t\tswitch = "L"\n\t\tel... | ['Time Limit Exceeded', 'Accepted'] | ['s130967007', 's091637745'] | [11416.0, 10484.0] | [2104.0, 145.0] | [679, 290] |
p02954 | u898080410 | 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)\nrslt = [0]*n\n# rslt = [0 for _ in range(n)]\nruiseki=0\n\nfor i in range(n-1):\n if s[i]=='R':\n ruiseki+=1\n if s[i+1]=='L':\n rslt[i+1]=ruiseki//2\n rslt[i]=(ruiseki+1)//2\n else:\n ruiseki=0\n\n\nruiseki=0\n\nfor i in range(n-1, 0, -1):\n ... | ['Wrong Answer', 'Accepted'] | ['s496089112', 's652815635'] | [4852.0, 6400.0] | [96.0, 126.0] | [478, 479] |
p02954 | u898967808 | 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 = [0]*(len(s)+1)\nstart=0\n\nn = len(s)\ncount=0\nfor i in range(n): \n if s[i]=='R':\n count+=1\n else:\n ans[i-1]=count\n count=0\n\ncount=0 \nfor i in range(n-1,-1,-1): \n if s[i]=='L':\n count+=1\n else:\n if ans[i+1] ==0:\n ans[i+1]=count\n count=0 \n\ni = ... | ['Wrong Answer', 'Accepted'] | ['s846471691', 's614230063'] | [11372.0, 15224.0] | [124.0, 114.0] | [674, 420] |
p02954 | u901582103 | 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()\nn=len(S)\nL=[0]*n\nflag=0\nc=1\nfor i in range(n-1):\n if S[i]==S[i+1]:\n c+=1\n else:\n if flag==0:\n L[i]+=c//2 if c%2==0 else c//2+1\n L[i+1]+=c//2\n else:\n L[i-c+1]+=c//2 if c%2==0 else c//2+1\n ... | ['Wrong Answer', 'Accepted'] | ['s124461018', 's763624940'] | [10636.0, 6424.0] | [115.0, 169.0] | [480, 237] |
p02954 | u905582793 | 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... | ['W = input()\nS = list(W)\nRL = [0]\nLR = [0]\nans = []\n\nfor i in range(len(S)-1):\n if S[i] == "R" and S[i+1] == "L":\n RL.append(i+1)\n elif S[i] == "L" and S[i+1] == "R":\n LR.append(i+1)\n\nLR.append(len(S))\n\nfor j in range(1, len(RL)):\n sep = LR[j-1]\n LR_d = LR[j]-sep\n RL_d = R... | ['Wrong Answer', 'Accepted'] | ['s841809737', 's027931166'] | [11248.0, 11248.0] | [159.0, 161.0] | [958, 958] |
p02954 | u908349502 | 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)\nb=[]\nb2=[]\nans=[0 for i in range(n)]\n\nfor i in range(n-1):\n if s[i]=='R' and s[i+1]=='L':\n b.append(i)\n if s[i]=='L' and s[i+1]=='R':\n b2.append(i)\n \nb2.append(n-1)\n\ncnt=0\nfor i in range(len(b2)):\n if i==0:\n for j in range(b2[i]+1):\n ... | ['Wrong Answer', 'Accepted'] | ['s651636342', 's378151431'] | [14060.0, 14104.0] | [215.0, 147.0] | [824, 665] |
p02954 | u910632349 | 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()\ndef rr(a): \n ll,l=[],1\n for i in range(len(a)-1):\n if a[i]==a[i+1]:\n l+=1\n else:\n ll.append([l,a[i]])\n l=1\n ll.append([l,a[-1]])\n return ll\nss=rr(s)\nprint(ss)\nans=[0]*len(s)\ncount=0\nfor i in range(0,len(ss),2):\n r,l=ss[i][0],ss[i+... | ['Wrong Answer', 'Wrong Answer', 'Accepted'] | ['s621346760', 's770124075', 's476984478'] | [19272.0, 19396.0, 19284.0] | [141.0, 168.0, 117.0] | [438, 453, 428] |
p02954 | u917092881 | 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 \nl_arr = _s.split("L")\nr_arr = _s.split("R")\nl_max = max([len(x) for x in l_arr])\nr_max = max([len(x) for x in r_arr])\nt = max(l_max, r_max)\nif t % 2 != 0:\n t -= 1\n \ns = list(_s)\n \nlg = len(s)\narr = [1 for i in range(lg)]\n \nfor i in range(t):\n next_arr = [0 for i in range(lg)]... | ['Runtime Error', 'Accepted'] | ['s271167176', 's575473571'] | [3316.0, 11180.0] | [19.0, 130.0] | [1175, 427] |
p02954 | u917558625 | 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()\nlist=[]\ndef roopR(l,n):\n if list[l]==-1:\n if n%2==0:\n return l\n else:\n return l-1\n else:\n return roopR(l+1,n+1)\n \ndef roopL(l,n):\n if list[l]==1:\n if n%2==0:\n return l\n else:\n return l+1\n else:\n return roopL(l-1,n+1)\n\na=len(s)\nfor i in range(a)... | ['Runtime Error', 'Runtime Error', 'Runtime Error', 'Accepted'] | ['s260873764', 's382763943', 's520713102', 's838264697'] | [4092.0, 4860.0, 5872.0, 10768.0] | [35.0, 2104.0, 1864.0, 92.0] | [555, 587, 544, 248] |
p02954 | u917872021 | 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 move(s, i, count, before):\n if s[i] == before:\n if s[i] == 'R':\n return move(s, i+1, count+1, s[i])\n else:\n return move(s, i-1, count+1, s[i])\n else:\n if count % 2 == 0:\n return i\n else:\n if s[i] == 'R':\n retur... | ['Runtime Error', 'Accepted'] | ['s406968144', 's010121344'] | [5696.0, 8616.0] | [2104.0, 122.0] | [578, 996] |
p02954 | u917874190 | 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 python3\n# -*- coding:utf-8 -*-\n\ndef generate_children(num_children, pl):\n children = ["0"]*num_children\n if num_children == 0: return []\n if num_children%2 == 0:\n children[pl-1] = str(int(num_children/2))\n children[pl] = str(int(num_children/2))\n else:\n if (n... | ['Runtime Error', 'Accepted'] | ['s998057936', 's314959703'] | [3316.0, 9716.0] | [18.0, 102.0] | [1088, 1052] |
p02954 | u918601425 | 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... | ['text = input()\nresult=[0]*len(text)\nN=len(text)\n\n\n\n\n\n\ns=0\ni=0\nj=0\nwhile j<N :\n while text[i]=="R" :\n i+=1\n j=i+1\n while (j<N and text[j]=="L") :\n j+=1\n if (j-s)%2==0:\n result[i-1]=(j-s)//2\n result[i]=(j-s)//2\n else:\n result[i-1]=(j-s-1)//2\n result[i]=(j-s-1)//2\n resul... | ['Wrong Answer', 'Accepted'] | ['s980261424', 's919750285'] | [4852.0, 10484.0] | [74.0, 80.0] | [542, 562] |
p02954 | u922449550 | 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... | ["\ndef count_RL(S):\n RL = ['R', 'L']\n pos = [0, 0] # [end, start]\n mode = 0\n N = len(S)\n c = 0\n out = [0 for i in range(N)]\n for i in range(N):\n if S[i] == RL[mode]:\n c += 1\n else:\n pos[0] = i - 1\n out[pos[mode]] = c\n mode = (mode + 1) % 2\n pos[1] = i\n c = 1\n ... | ['Wrong Answer', 'Accepted'] | ['s781657553', 's107565508'] | [4860.0, 10268.0] | [92.0, 120.0] | [705, 446] |
p02954 | u936985471 | 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)\nchilds=[1]*N\nresult=[0]*N\n\nfor i in range(N):\n if S[i]=="R": \n \n j = i\n count = 0 \n for j in range(j+1,N): \n count = count + 1\n if S[j] == "L":\n \n if count%2 == 0:\n result[j] = result[j] + 1\n \n else:\n result[j-1]... | ['Time Limit Exceeded', 'Wrong Answer', 'Accepted'] | ['s142031854', 's693119465', 's736024879'] | [11644.0, 6436.0, 6424.0] | [2104.0, 177.0, 164.0] | [1223, 308, 298] |
p02954 | u941645670 | 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... | ['#136_d\ns = input()\nimport re\nimport math\nans = [0]*len(s)\na = [i.start() for i in re.finditer("RL",s)]\n\nl_side = 0\nr_side = 0\nfor i in range(len(a)-1):\n \n \n if s[a[i]+2:a[i+1]].find("R") != -1:\n r_side = a[i]+1 + s[a[i]+2:a[i+1]].find("R") \n ans[a[i]+1] =math.ceil((a[i] - l_side) ... | ['Wrong Answer', 'Accepted'] | ['s481879174', 's788221752'] | [12956.0, 19912.0] | [101.0, 114.0] | [828, 856] |
p02954 | u945181840 | 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\neven = 0\nodd = 0\nl = S.index('L')\nr = S.index('R')\nans = [0] * len(S)\n\nfor i in range(len(S) - 1):\n if i % 2 == 0:\n even += 1\n else:\n odd += 1\n if S[i] == 'R' and S[i + 1] == 'L':\n l = i\n r = i + 1\n if i % 2 == 0:\n ans[i] += even\n ... | ['Wrong Answer', 'Accepted'] | ['s884452679', 's421904379'] | [10376.0, 10612.0] | [119.0, 126.0] | [862, 863] |
p02954 | u952467214 | 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\n\nrside=0\nlside=0\n\nrpoint=0\nlpoint=0\n\nradd = 0\nladd = 0\n\nleft = 0\nright=0\nwhile right<n:\n if right == n-1:\n ladd = (rpoint - left + 1 ) // 2 +1\n radd = rpoint - left + 1 - ladd\n\n radd += (right - lpoint + 1) // 2 + 1\n ladd += (r... | ['Wrong Answer', 'Accepted'] | ['s100347846', 's982980571'] | [4980.0, 6512.0] | [125.0, 151.0] | [872, 873] |
p02954 | u959149013 | 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\nans = [0] * len(s) \n\nt = -1\n\nwhile len(s) > 0:\n r = re.search('R*', s)\n\n r_e = r.end()\n\n s = s[r_e:]\n\n l = re.search('L*', s)\n\n l_e = l.end()\n\n s = s[l_e:]\n\n r_ind = r_e + t\n\n l_ind = r_ind + 1\n\n ans[r_ind] = (r_e + 1) // 2 + l_e // 2\n an... | ['Wrong Answer', 'Accepted'] | ['s807440485', 's169358001'] | [4212.0, 6640.0] | [527.0, 567.0] | [348, 361] |
p02954 | u960552358 | 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\n\n\n\nrMatch = re.findall('R{1,}', s)\nlMatch = re.findall('L{1,}', s)\nrMatch.sort(reverse=True)\nlMatch.sort(reverse=True)\nintegrateCnt = len(rMatch[0]) if len(rMatch[0]) > len(lMatch[0]) else len(lMatch[0])\naddCnt = (10**100 - integrateCnt) % 2\n\nsList = list(s)\nn = [1] * len(s)\nre... | ['Wrong Answer', 'Accepted'] | ['s396877539', 's578765386'] | [8532.0, 11180.0] | [2104.0, 129.0] | [842, 567] |
p02954 | u961674365 | 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)\nt=s[::-1]\nr=[0 for i in range(n)]\nl=r[:]\nc,d=1,1\nfor i in range(1,n):\n if s[i]=='R':\n c+=1\n else:\n r[i-1]=c\n c=0\n if t[i]=='L':\n d+=1\n else:\n l[i-1]=d\n d=0\nl=l[::-1]\nb=[]\nv=0\nfor i in range(n):\n v=r[i]+l[i]\n b.append(v)\nans=[0 for i in range(n)]\nx=0\... | ['Wrong Answer', 'Wrong Answer', 'Accepted'] | ['s092215055', 's264053935', 's380519165'] | [7396.0, 7260.0, 8804.0] | [173.0, 150.0, 133.0] | [449, 576, 755] |
p02954 | u970197315 | 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 - Gathering Children\nS = input()\n\nright = []\nleft = []\nidx = []\n\nr_cnt = 0\nl_cnt = 0\ns_tmp = 'R'\n\nfor i,s in enumerate(S):\n\n if s_tmp == 'R':\n if S[i:i+1] == S[i+1:i+2]:\n r_cnt += 1\n else:\n r_cnt += 1\n right.append(r_cnt)\n idx.... | ['Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Accepted'] | ['s396400870', 's618978998', 's754991526', 's842912131', 's152132136'] | [9988.0, 6432.0, 9964.0, 9144.0, 9244.0] | [188.0, 166.0, 173.0, 169.0, 172.0] | [1667, 832, 1348, 1328, 1673] |
p02954 | u970809473 | 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()\narr = [0]*len(s)\ntmp_r = 0\ntmp_l = 0\nflg = 0\nfor i in range(len(s)-1):\n if s[i:i+2] == 'RL':\n if flg != 0:\n arr[flg] += (tmp_l + 1)//2\n arr[flg+1] += tmp_l//2\n tmp_l = 0\n arr[i] = tmp_r//2 + 1\n arr[i+1] = (tmp_r+1)//2 + 1\n tmp_r = 0\n flg = i\n elif s[i] == 'R'... | ['Wrong Answer', 'Accepted'] | ['s280909142', 's367699985'] | [6400.0, 6400.0] | [138.0, 134.0] | [451, 470] |
p02954 | u974679980 | 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 = [complex(0) for _ in range(N)]\n\nfor i in range(0,N-1): # 0,1,,,,N-2\n if S[i] == S[i+1] and S[i]=='R':\n ans[i+1] += 1j +ans[i]\n ans[i] = 0j\n elif S[i] != S[i+1] and S[i]=='R':\n ans[i] += 1+0j\n\nfor i in range(N-1,1,-1): # N-1,N-2,,,,1\n ... | ['Wrong Answer', 'Accepted'] | ['s800086316', 's191646843'] | [11100.0, 10612.0] | [289.0, 256.0] | [969, 861] |
p02954 | u981931040 | 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()\nright_count = 0\nleft_count = 0\nright_index = 0\nleft_index = 0\ncounter = 0\nans = [0] * len(S)\neven_flag = 1\n\ntmp = 0\nfor i in range(len(S) - 1):\n counter += 1\n if S[i] == \'R\' and S[i + 1] == \'L\':\n right_index = i + 1\n left_index = i\n tmp_max1 = i - tmp - 1\n ... | ['Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Accepted'] | ['s082803640', 's470914315', 's533408281', 's981442905', 's648320694'] | [4864.0, 4864.0, 4864.0, 4864.0, 10268.0] | [229.0, 197.0, 204.0, 200.0, 151.0] | [885, 628, 700, 581, 666] |
p02954 | u983311472 | 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の長さ\nN = len(S)\n\nC = [0] * N\n\nc = 0\n\n\nfor i in range(N):\n \n if S[i] == 'R':\n c = i\n \n \n else:\n C[c + (i - c) % 2] += 1\n\n\nfor i in range(N - 1, -1, -1):\n if S[i] == 'L':\n c = i\n else:\n C[c - (c-i) % 2] += 1\nprint(' '.join([str() for ... | ['Wrong Answer', 'Accepted'] | ['s625710181', 's898651196'] | [4724.0, 11880.0] | [75.0, 119.0] | [959, 270] |
p02954 | u987164499 | 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#s = stdin.readline().rstrip()\ns = "RRRLLRLLRRRLLLLL"\n\nli = [0 for _ in range(len(s))]\n\nprint(s)\ns = "L" + s + "R"\n\n\nzenkai = 0\nR = 0\nRL = 0\nL = 0\nLR = 0\n\nfor i in range(1,len(s)-1):\n if s[i:i+2] == "RL":\n RL = 0\n R = 0\n RL = i-1\n if zenkai == ... | ['Wrong Answer', 'Accepted'] | ['s970167484', 's398698298'] | [3064.0, 6632.0] | [17.0, 153.0] | [1009, 1073] |
p02954 | u989345508 | 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()\nn=len(s)\n\nd=0\na=[]\nax=[0]\n\nfor i in range(n):\n l=len(ax)\n if l==1:\n if s[i]=="L":\n ax.append(i-1)\n ax.append(i)\n elif l==3:\n if s[i]=="R":\n ax.append(i-1)\n a.append(ax)\n ax=[i]\n elif i==n-1:\n ... | ['Wrong Answer', 'Accepted'] | ['s706284521', 's701922136'] | [22756.0, 22796.0] | [142.0, 147.0] | [828, 897] |
p02954 | u993435350 | 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 bisect\n\nS = input()\nN = [0] * len(S)\nRL = [0] * len(S)\nID = []\n\nfor i in range(len(S) - 1):\n if S[i] == "R" and S[i + 1] == "L":\n RL[i] += 1\n RL[i + 1] += 1\n ID.append(i)\n ID.append(i + 1)\n \nfor i in range(len(S)):\n if RL[i] == 0:\n if S[i] == "R":\n n = bisect.bisect_le... | ['Wrong Answer', 'Accepted'] | ['s308689585', 's915379382'] | [9596.0, 11128.0] | [133.0, 156.0] | [572, 573] |
p02954 | u994988729 | 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 #R\nnow="R"\nidx=[[],[]]\n\ndef goukei(left,right):\n l=0\n r=0\n if left%2==0:\n l+=int(left/2)\n r+=int(left/2)\n else:\n l+=int(left/2)+1\n r+=int(left/2)\n if right%2==0:\n l+=int(right/2)\n r+=int(right/2)\n else:\n l+=in... | ['Wrong Answer', 'Accepted'] | ['s616927480', 's144982425'] | [15888.0, 19816.0] | [232.0, 131.0] | [1033, 638] |
p02954 | u996486717 | 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))]\nrl=[]\nfor i in range(1,len(s)):\n if s[i-1]=='R' and s[i]=='L': rl.append(i)\nni=0\nfor i in range(len(s)):\n if rl[ni]<i and s[i]=='R': ni+=1\n if s[i]=='R':\n if (rl[ni]-i)%2==0:ans[rl[ni]]+=1\n else:ans[rl[ni]-1]+=1\n else:\n if (i-rl[ni]... | ['Wrong Answer', 'Accepted'] | ['s203487861', 's881288707'] | [6884.0, 12516.0] | [103.0, 114.0] | [368, 396] |
p02954 | u998880072 | 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\nRL_index = []\nL_last_index = []\nfor i in range(N):\n if i == N-1:\n break\n if S[i] == "L" and S[i+1] == "R":\n L_last_index.append(i)\n if S[i] == "R" and S[i+1] == "L":\n RL_index.append(i)\nL_last_index.append(N-1)\n# print("RL_ind: ", RL_index)\n# print("... | ['Wrong Answer', 'Accepted'] | ['s285525276', 's048977035'] | [14464.0, 14436.0] | [131.0, 119.0] | [693, 1550] |
p02954 | u999406210 | 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)\npool=[0]*n\nfor i in range(n-1):\n if s[i]==\'R\' and s[i+1]==\'L\':\n pool[i]=1\n pool[i+1]=2\nfinal=[0]*n\nfor i in range(n):\n index=i\n flag=0\n while pool[index]==0:\n if s[index]==\'R\':\n flag=1-flag\n index+=1\n else:\n ... | ['Time Limit Exceeded', 'Accepted'] | ['s448630373', 's794965281'] | [5616.0, 15612.0] | [2104.0, 112.0] | [587, 689] |
p02955 | u074230519 | 2,000 | 1,048,576 | We have a sequence of N integers: A_1, A_2, \cdots, A_N. You can perform the following operation between 0 and K times (inclusive): * Choose two integers i and j such that i \neq j, each between 1 and N (inclusive). Add 1 to A_i and -1 to A_j, possibly producing a negative element. Compute the maximum possible pos... | ['# -*- coding: utf-8 -*-\n\nN, K = map(int, input().split())\nA = list(map(int, input().split()))\n\nsum_a = sum(A)\n\ndc_list = [x for x in reversed(range(1, sum_a + 1)) if sum_a % x == 0]\n\nfor d in dc_list:\n mods = [a % d for a in A]\n if sum(mods) % d != 0:\n continue\n mods = sorted(mods)\n m... | ['Wrong Answer', 'Accepted'] | ['s249786445', 's079768310'] | [3064.0, 3188.0] | [2108.0, 148.0] | [734, 793] |
p02955 | u082446606 | 2,000 | 1,048,576 | We have a sequence of N integers: A_1, A_2, \cdots, A_N. You can perform the following operation between 0 and K times (inclusive): * Choose two integers i and j such that i \neq j, each between 1 and N (inclusive). Add 1 to A_i and -1 to A_j, possibly producing a negative element. Compute the maximum possible pos... | ['def make_divisors(n):\n divisors = []\n for i in range(1, int(n**0.5)+1):\n if n % i == 0:\n divisors.append(i)\n if i != n // i:\n divisors.append(n//i)\n\n divisors.sort(reverse=True)\n return divisors\n\ndef checker(A,k):\n if sum(A[sum(A) // d:]) <= k:\n ... | ['Wrong Answer', 'Wrong Answer', 'Runtime Error', 'Wrong Answer', 'Runtime Error', 'Accepted'] | ['s007620522', 's338713096', 's528022288', 's792627840', 's891369940', 's794105976'] | [3064.0, 3064.0, 3188.0, 6644.0, 3188.0, 3064.0] | [113.0, 110.0, 20.0, 162.0, 21.0, 203.0] | [575, 655, 658, 654, 687, 600] |
p02955 | u160459241 | 2,000 | 1,048,576 | We have a sequence of N integers: A_1, A_2, \cdots, A_N. You can perform the following operation between 0 and K times (inclusive): * Choose two integers i and j such that i \neq j, each between 1 and N (inclusive). Add 1 to A_i and -1 to A_j, possibly producing a negative element. Compute the maximum possible pos... | ['import math\nn, k = map(int,input().split())\na = list(map(int, input().split()))\n\nasum = sum(a)\ngcdmax = int(math.sqrt(asum))\nli = [i for i in range(2,gcdmax+1)]\nfor i in range(gcdmax,0,-1):\n if asum%i==0:\n li.append(asum//i)\n\n\nans = 1\nprint(li)\n\nfor i in li:\n b = [a[ii] % i for ii in rang... | ['Wrong Answer', 'Accepted'] | ['s198896598', 's789104136'] | [4340.0, 3188.0] | [2104.0, 333.0] | [599, 640] |
p02955 | u209337527 | 2,000 | 1,048,576 | We have a sequence of N integers: A_1, A_2, \cdots, A_N. You can perform the following operation between 0 and K times (inclusive): * Choose two integers i and j such that i \neq j, each between 1 and N (inclusive). Add 1 to A_i and -1 to A_j, possibly producing a negative element. Compute the maximum possible pos... | ['def make_divisors(n):\n divisors = []\n for i in range(1, int(n**0.5)+1):\n if n % i == 0:\n divisors.append(i)\n if i != n // i:\n divisors.append(n//i)\n\n \n return divisors\n\ninput1 = input()\ninput2 = input()\n\nN = int(input1.split()[0])\nK = int(input1.s... | ['Wrong Answer', 'Accepted'] | ['s724212574', 's952453426'] | [3188.0, 3064.0] | [146.0, 146.0] | [621, 619] |
p02955 | u218843509 | 2,000 | 1,048,576 | We have a sequence of N integers: A_1, A_2, \cdots, A_N. You can perform the following operation between 0 and K times (inclusive): * Choose two integers i and j such that i \neq j, each between 1 and N (inclusive). Add 1 to A_i and -1 to A_j, possibly producing a negative element. Compute the maximum possible pos... | ['from math import sqrt\nn, k = map(int, input().split())\na = list(map(int, input().split()))\ns = sum(a)\ndiv = []\nfor i in range(1, int(sqrt(s)+1)):\n\tif s%i == 0:\n\t\tif i*i != s:\n\t\t\tdiv.append(s//i)\n\t\tdiv.append(i)\ndiv.sort(reverse=True)\n#print(div)\n\nfor d in div:\n\tb = [x for x in a if x%d != 0]\n\... | ['Wrong Answer', 'Accepted'] | ['s366250004', 's261008098'] | [3188.0, 3064.0] | [643.0, 637.0] | [484, 486] |
p02955 | u223663729 | 2,000 | 1,048,576 | We have a sequence of N integers: A_1, A_2, \cdots, A_N. You can perform the following operation between 0 and K times (inclusive): * Choose two integers i and j such that i \neq j, each between 1 and N (inclusive). Add 1 to A_i and -1 to A_j, possibly producing a negative element. Compute the maximum possible pos... | ['import sys\nfrom itertools import accumulate\nN, K = map(int, input().split())\n*A, = map(int, input().split())\nS = sum(A)\n\n\ndiv_small = []\ndiv_large = []\nfor p in range(1, int(S**0.5)+1):\n if S % p == 0:\n div_small.append(p)\n if S // p != p:\n div_large.append(S//p)\ndiv_large +=... | ['Wrong Answer', 'Accepted'] | ['s027957560', 's895805588'] | [3064.0, 3188.0] | [141.0, 258.0] | [504, 619] |
p02955 | u233588813 | 2,000 | 1,048,576 | We have a sequence of N integers: A_1, A_2, \cdots, A_N. You can perform the following operation between 0 and K times (inclusive): * Choose two integers i and j such that i \neq j, each between 1 and N (inclusive). Add 1 to A_i and -1 to A_j, possibly producing a negative element. Compute the maximum possible pos... | ['import math\na,b=map(int,input().split())\nc=list(map(int,input().split()))\n\ndef make_divisors(n):\n divisors = []\n for i in range(1, int(n**0.5)+1):\n if n % i == 0:\n divisors.append(i)\n if i != n // i:\n divisors.append(n//i)\n\n divisors.sort()\n return ... | ['Wrong Answer', 'Accepted'] | ['s964196686', 's563655464'] | [3188.0, 3188.0] | [121.0, 429.0] | [431, 669] |
p02955 | u261260430 | 2,000 | 1,048,576 | We have a sequence of N integers: A_1, A_2, \cdots, A_N. You can perform the following operation between 0 and K times (inclusive): * Choose two integers i and j such that i \neq j, each between 1 and N (inclusive). Add 1 to A_i and -1 to A_j, possibly producing a negative element. Compute the maximum possible pos... | ['import sys\nimport math\n\nn, k = map(int, input().split())\na = list(map(int, input().split()))\n\n\ndef ok(x):\n b = []\n for an in a:\n b.append(an % x)\n b.sort(reverse=True)\n print(x, a, b, file=sys.stderr)\n t = int(sum(b) / x)\n print(t, file=sys.stderr)\n if t == 0:\n retur... | ['Wrong Answer', 'Accepted'] | ['s163381916', 's833103055'] | [3064.0, 3188.0] | [269.0, 146.0] | [576, 482] |
p02955 | u263830634 | 2,000 | 1,048,576 | We have a sequence of N integers: A_1, A_2, \cdots, A_N. You can perform the following operation between 0 and K times (inclusive): * Choose two integers i and j such that i \neq j, each between 1 and N (inclusive). Add 1 to A_i and -1 to A_j, possibly producing a negative element. Compute the maximum possible pos... | ['N, K = map(int, input().split())\nA = list(map(int, input().split()))\n# A.sort()\ntotalA = sum(A)\n# print (totalA)\n\ndef make_divisors(n): \n import math\n divisors = []\n for i in range(1, int(math.sqrt(n)) + 1):\n if n % i == 0: \n divisors.append(i)\n if i != n//i:\n ... | ['Wrong Answer', 'Accepted'] | ['s031115941', 's461308749'] | [3064.0, 3188.0] | [420.0, 493.0] | [911, 899] |
p02955 | u268183312 | 2,000 | 1,048,576 | We have a sequence of N integers: A_1, A_2, \cdots, A_N. You can perform the following operation between 0 and K times (inclusive): * Choose two integers i and j such that i \neq j, each between 1 and N (inclusive). Add 1 to A_i and -1 to A_j, possibly producing a negative element. Compute the maximum possible pos... | ['import numpy as np\n\ndef getDivisor(n):\n divisor = []\n tmp = n\n for i in range(2, int(n**0.5)+1):\n cnt = 1\n d = [1,]\n while tmp%i == 0:\n d.append(i**cnt)\n tmp //= i\n cnt += 1\n if cnt > 1:\n divisor.append(d)\n if tmp != 1:\n divisor.append([1,tmp])\n if divisor == []... | ['Wrong Answer', 'Accepted'] | ['s973270126', 's514505015'] | [13188.0, 14408.0] | [231.0, 234.0] | [870, 1020] |
p02955 | u316464887 | 2,000 | 1,048,576 | We have a sequence of N integers: A_1, A_2, \cdots, A_N. You can perform the following operation between 0 and K times (inclusive): * Choose two integers i and j such that i \neq j, each between 1 and N (inclusive). Add 1 to A_i and -1 to A_j, possibly producing a negative element. Compute the maximum possible pos... | ['def main():\n N, K = map(int, input().split())\n A = list(map(int, input().split()))\n m = sum(A)\n d = []\n for i in range(1, int(m**0.5)+1):\n if m % i == 0:\n d.append(i)\n if i != m // i:\n d.append(m//i)\n d.sort(reverse=True)\n for j in d:\n ... | ['Wrong Answer', 'Accepted'] | ['s088358915', 's947970922'] | [3188.0, 3064.0] | [171.0, 161.0] | [833, 544] |
p02955 | u326609687 | 2,000 | 1,048,576 | We have a sequence of N integers: A_1, A_2, \cdots, A_N. You can perform the following operation between 0 and K times (inclusive): * Choose two integers i and j such that i \neq j, each between 1 and N (inclusive). Add 1 to A_i and -1 to A_j, possibly producing a negative element. Compute the maximum possible pos... | ['import numpy as np\nimport sys\n# from numba import njit\n\n\ndef solve(A, K, div):\n for d in range(div.shape[0] - 1, 0, -1):\n res = div[d]\n B = np.sort(A % res)\n if B[B.shape[0] - 1] == 0:\n return res\n i = 0\n j = B.shape[0] - 1\n sreqired = B[i]\n ... | ['Wrong Answer', 'Accepted'] | ['s034425941', 's708744545'] | [14540.0, 12504.0] | [153.0, 690.0] | [883, 1233] |
p02955 | u334712262 | 2,000 | 1,048,576 | We have a sequence of N integers: A_1, A_2, \cdots, A_N. You can perform the following operation between 0 and K times (inclusive): * Choose two integers i and j such that i \neq j, each between 1 and N (inclusive). Add 1 to A_i and -1 to A_j, possibly producing a negative element. Compute the maximum possible pos... | ["# -*- coding: utf-8 -*-\nimport bisect\nimport heapq\nimport math\nimport random\nimport sys\nfrom collections import Counter, defaultdict, deque\nfrom decimal import ROUND_CEILING, ROUND_HALF_UP, Decimal\nfrom functools import lru_cache, reduce\nfrom itertools import combinations, combinations_with_replacement, prod... | ['Wrong Answer', 'Accepted'] | ['s096173450', 's421731614'] | [5456.0, 6216.0] | [39.0, 478.0] | [1351, 1868] |
p02955 | u380524497 | 2,000 | 1,048,576 | We have a sequence of N integers: A_1, A_2, \cdots, A_N. You can perform the following operation between 0 and K times (inclusive): * Choose two integers i and j such that i \neq j, each between 1 and N (inclusive). Add 1 to A_i and -1 to A_j, possibly producing a negative element. Compute the maximum possible pos... | ['import numpy as np\n\n\ndef divisors(num):\n array = []\n limit = int(num ** 0.5) + 1\n for i in range(1, limit):\n if num % i == 0:\n div1 = i\n div2 = num//i\n array.append(div1)\n if div1 != div2:\n array.append(div2)\n array.sort(rever... | ['Wrong Answer', 'Runtime Error', 'Accepted'] | ['s305182796', 's865693130', 's496713321'] | [21376.0, 12512.0, 21516.0] | [327.0, 156.0, 314.0] | [667, 669, 662] |
p02955 | u392319141 | 2,000 | 1,048,576 | We have a sequence of N integers: A_1, A_2, \cdots, A_N. You can perform the following operation between 0 and K times (inclusive): * Choose two integers i and j such that i \neq j, each between 1 and N (inclusive). Add 1 to A_i and -1 to A_j, possibly producing a negative element. Compute the maximum possible pos... | ['N, K = map(int, input().split())\nA = list(map(int, input().split()))\nsumA = sum(A)\n\n\ndef divisors(n):\n divisors = []\n for i in range(1, int(n**0.5)+1):\n if n % i == 0:\n divisors.append(i)\n if i != n // i:\n divisors.append(n//i)\n divisors.sort(reverse = ... | ['Wrong Answer', 'Accepted'] | ['s438915800', 's572245689'] | [3188.0, 3064.0] | [109.0, 211.0] | [547, 547] |
p02955 | u492026192 | 2,000 | 1,048,576 | We have a sequence of N integers: A_1, A_2, \cdots, A_N. You can perform the following operation between 0 and K times (inclusive): * Choose two integers i and j such that i \neq j, each between 1 and N (inclusive). Add 1 to A_i and -1 to A_j, possibly producing a negative element. Compute the maximum possible pos... | ['import sys\nn,k=map(int,input().split())\na=list(map(int,input().split()))\n\ndef make_divisors(n):\n divisors = []\n for i in range(1, int(n**0.5)+1):\n if n % i == 0:\n divisors.append(i)\n if i != n // i:\n divisors.append(n//i)\n\n divisors.sort(reverse=True)\n... | ['Wrong Answer', 'Accepted'] | ['s329291301', 's448589889'] | [3188.0, 3188.0] | [310.0, 423.0] | [585, 843] |
p02955 | u504836877 | 2,000 | 1,048,576 | We have a sequence of N integers: A_1, A_2, \cdots, A_N. You can perform the following operation between 0 and K times (inclusive): * Choose two integers i and j such that i \neq j, each between 1 and N (inclusive). Add 1 to A_i and -1 to A_j, possibly producing a negative element. Compute the maximum possible pos... | ['N,K = map(int, input().split())\nA = [int(a) for a in input().split()]\n\nList = []\nList2 = []\nA_sum = sum(A)\nfor i in range(1,int(A_sum**0.5)):\n if A_sum%i == 0:\n List.append(i)\nfor j in range(len(List)):\n a = A_sum//List[-1-j]\n if a in List:\n a = 0\n else:\n List2.append(a)... | ['Wrong Answer', 'Wrong Answer', 'Accepted'] | ['s114515552', 's122251265', 's134524178'] | [3188.0, 3188.0, 3064.0] | [492.0, 188.0, 687.0] | [616, 494, 765] |
p02955 | u528899139 | 2,000 | 1,048,576 | We have a sequence of N integers: A_1, A_2, \cdots, A_N. You can perform the following operation between 0 and K times (inclusive): * Choose two integers i and j such that i \neq j, each between 1 and N (inclusive). Add 1 to A_i and -1 to A_j, possibly producing a negative element. Compute the maximum possible pos... | ["import sys\nimport math\n\ndef get_divisor(n):\n divisors = []\n for i in range(1, int(n**0.5)+1):\n if n % i == 0:\n divisors.append(i)\n if i != n // i:\n divisors.append(n//i)\n\n divisors.sort(reverse=True)\n return divisors\n\ndef main():\n N, K = map(in... | ['Wrong Answer', 'Accepted'] | ['s025312426', 's958663865'] | [3064.0, 3188.0] | [137.0, 283.0] | [763, 761] |
p02955 | u538774896 | 2,000 | 1,048,576 | We have a sequence of N integers: A_1, A_2, \cdots, A_N. You can perform the following operation between 0 and K times (inclusive): * Choose two integers i and j such that i \neq j, each between 1 and N (inclusive). Add 1 to A_i and -1 to A_j, possibly producing a negative element. Compute the maximum possible pos... | ['\nimport sys\nimport math\n\ndef main():\n N, K = [int(i) for i in sys.stdin.readline().strip().split()]\n numbers = [int(i) for i in sys.stdin.readline().strip().split()]\n print(solve(N, K, numbers))\n\n\ndef solve(N, K, numbers):\n\n total = sum(numbers)\n ans = 1\n candidates = []\n candidate... | ['Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Accepted'] | ['s047316207', 's313975189', 's387487674', 's573217388', 's807105103', 's059928634'] | [3064.0, 3064.0, 3064.0, 3064.0, 3064.0, 3192.0] | [2107.0, 188.0, 188.0, 188.0, 485.0, 189.0] | [1219, 959, 958, 1008, 1021, 966] |
p02955 | u612975321 | 2,000 | 1,048,576 | We have a sequence of N integers: A_1, A_2, \cdots, A_N. You can perform the following operation between 0 and K times (inclusive): * Choose two integers i and j such that i \neq j, each between 1 and N (inclusive). Add 1 to A_i and -1 to A_j, possibly producing a negative element. Compute the maximum possible pos... | ['import numpy as np\n\ndef make_divisors(n):\n lower_divisors , upper_divisors = [], []\n i = 1\n while i*i <= n:\n if n % i == 0:\n lower_divisors.append(i)\n if i != n // i:\n upper_divisors.append(n//i)\n i += 1\n return lower_divisors + upper_divisors[... | ['Wrong Answer', 'Accepted'] | ['s361195183', 's747123640'] | [27184.0, 27284.0] | [123.0, 150.0] | [776, 858] |
p02955 | u620084012 | 2,000 | 1,048,576 | We have a sequence of N integers: A_1, A_2, \cdots, A_N. You can perform the following operation between 0 and K times (inclusive): * Choose two integers i and j such that i \neq j, each between 1 and N (inclusive). Add 1 to A_i and -1 to A_j, possibly producing a negative element. Compute the maximum possible pos... | ['# ABC 136 E\nimport math\n\nN, K = map(int,input().split())\nA = list(map(int,input().split()))\nS = sum(A)\n\nP = [1,S]\nfor k in range(2,math.floor(math.sqrt(S))+1):\n if S % k == 0:\n P.append(k)\n P.append(S//k)\nP = sorted(P)[::-1]\n\nfor e in P:\n t = []\n u = []\n for a in A:\n ... | ['Wrong Answer', 'Accepted'] | ['s009496137', 's877990517'] | [6772.0, 3188.0] | [796.0, 761.0] | [774, 757] |
p02955 | u637175065 | 2,000 | 1,048,576 | We have a sequence of N integers: A_1, A_2, \cdots, A_N. You can perform the following operation between 0 and K times (inclusive): * Choose two integers i and j such that i \neq j, each between 1 and N (inclusive). Add 1 to A_i and -1 to A_j, possibly producing a negative element. Compute the maximum possible pos... | ['import math,string,itertools,fractions,heapq,collections,re,array,bisect,sys,copy,functools\nimport time,random\n\nsys.setrecursionlimit(10**7)\ninf = 10**20\neps = 1.0 / 10**10\nmod = 10**9+7\nmod2 = 998244353\ndd = [(-1,0),(0,1),(1,0),(0,-1)]\nddn = [(-1,0),(-1,1),(0,1),(1,1),(1,0),(1,-1),(0,-1),(-1,-1)]\n\ndef LI(... | ['Runtime Error', 'Accepted'] | ['s254783651', 's388856072'] | [30984.0, 5588.0] | [485.0, 382.0] | [2753, 1651] |
p02955 | u638282348 | 2,000 | 1,048,576 | We have a sequence of N integers: A_1, A_2, \cdots, A_N. You can perform the following operation between 0 and K times (inclusive): * Choose two integers i and j such that i \neq j, each between 1 and N (inclusive). Add 1 to A_i and -1 to A_j, possibly producing a negative element. Compute the maximum possible pos... | ['def divisors(N):\n return sorted(sum((list({n, N // n}) for n in range(1, int(N ** 0.5) + 1) if not N % n), []))\nN, K = map(int, input().split())\nA = map(int, input().split())\nD = divisors(sum(A))\nans = 0\nfor d in D:\n L = sorted(a % d for a in A)\n if not sum(L):\n ans = d\n continue\n ... | ['Wrong Answer', 'Accepted'] | ['s038107052', 's608637271'] | [3188.0, 3064.0] | [21.0, 703.0] | [842, 867] |
p02955 | u677267454 | 2,000 | 1,048,576 | We have a sequence of N integers: A_1, A_2, \cdots, A_N. You can perform the following operation between 0 and K times (inclusive): * Choose two integers i and j such that i \neq j, each between 1 and N (inclusive). Add 1 to A_i and -1 to A_j, possibly producing a negative element. Compute the maximum possible pos... | ['N, K = map(int, input().split())\nA = list(map(int, input().split()))\n\nsumA = sum(A)\ndivisors = []\nfor i in range(1, sumA + 1):\n if i * i > sumA:\n break\n if sumA % i != 0:\n continue\n divisors.append(i)\n if sumA // i != i:\n divisors.append(sumA // i)\n\ndivisors.sort(reverse... | ['Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Accepted'] | ['s125516856', 's197238911', 's863352012', 's616289414'] | [3064.0, 3064.0, 3064.0, 3064.0] | [236.0, 148.0, 148.0, 151.0] | [617, 1309, 1313, 1301] |
p02955 | u741397536 | 2,000 | 1,048,576 | We have a sequence of N integers: A_1, A_2, \cdots, A_N. You can perform the following operation between 0 and K times (inclusive): * Choose two integers i and j such that i \neq j, each between 1 and N (inclusive). Add 1 to A_i and -1 to A_j, possibly producing a negative element. Compute the maximum possible pos... | ['N, K = map(int, input().split())\nA = list(map(int, input().split()))\n\nS = sum(A)\nM = max(A)\n\ndef divisor(n):\n res = []\n rn = int(n**0.5) + 1 \n for i in range(1, rn):\n if n % i == 0:\n res.append(i)\n if i != n / i:\n res.append(int(n / i))\n return sor... | ['Wrong Answer', 'Wrong Answer', 'Accepted'] | ['s244769026', 's863866782', 's776476377'] | [3188.0, 3188.0, 3188.0] | [177.0, 176.0, 819.0] | [485, 476, 756] |
p02955 | u895515293 | 2,000 | 1,048,576 | We have a sequence of N integers: A_1, A_2, \cdots, A_N. You can perform the following operation between 0 and K times (inclusive): * Choose two integers i and j such that i \neq j, each between 1 and N (inclusive). Add 1 to A_i and -1 to A_j, possibly producing a negative element. Compute the maximum possible pos... | ['import sys\nimport math\nimport heapq\nsys.setrecursionlimit(10**7)\nINTMAX = 9223372036854775807\nINTMIN = -9223372036854775808\nDVSR = 1000000007\ndef POW(x, y): return pow(x, y, DVSR)\ndef INV(x, m=DVSR): return pow(x, m - 2, m)\ndef DIV(x, y, m=DVSR): return (x * INV(y, m)) % m\ndef LI(): return [int(x) for x in ... | ['Wrong Answer', 'Runtime Error', 'Accepted'] | ['s698318492', 's953607475', 's142359154'] | [3192.0, 3316.0, 3192.0] | [809.0, 24.0, 484.0] | [1335, 1650, 1289] |
p02955 | u969708690 | 2,000 | 1,048,576 | We have a sequence of N integers: A_1, A_2, \cdots, A_N. You can perform the following operation between 0 and K times (inclusive): * Choose two integers i and j such that i \neq j, each between 1 and N (inclusive). Add 1 to A_i and -1 to A_j, possibly producing a negative element. Compute the maximum possible pos... | ['def yakusu(n):\n lower_divisors , upper_divisors = [], []\n i = 1\n while i*i <= n:\n if n % i == 0:\n lower_divisors.append(i)\n if i != n // i:\n upper_divisors.append(n//i)\n i += 1\n return lower_divisors + upper_divisors[::-1]\nN,K=map(int,input().sp... | ['Wrong Answer', 'Accepted'] | ['s131006455', 's721649618'] | [9256.0, 9300.0] | [37.0, 264.0] | [981, 978] |
p02956 | u075532540 | 2,000 | 1,048,576 | We have a set S of N points in a two-dimensional plane. The coordinates of the i-th point are (x_i, y_i). The N points have distinct x-coordinates and distinct y-coordinates. For a non-empty subset T of S, let f(T) be the number of points contained in the smallest rectangle, whose sides are parallel to the coordinate ... | ['import sys\nimport array\n\nfrom operator import itemgetter\n\ndef main():\n\n\n\n\tinput = sys.stdin.readline\n\n\n\tmd = 998244353\n\tn = int(input())\n\ttl=n+1\n\t\n\tft=[0]*tl\n\n\txy = [[0]*2 for _ in range(n)]\n\tfor i in range(n):\n\t\txy[i] = [int(item) for item in input().split()]\n\txy.sort(key=itemgetter(0... | ['Runtime Error', 'Accepted'] | ['s312022439', 's690690614'] | [75212.0, 75028.0] | [2107.0, 1982.0] | [919, 913] |
p02956 | u226155577 | 2,000 | 1,048,576 | We have a set S of N points in a two-dimensional plane. The coordinates of the i-th point are (x_i, y_i). The N points have distinct x-coordinates and distinct y-coordinates. For a non-empty subset T of S, let f(T) be the number of points contained in the smallest rectangle, whose sides are parallel to the coordinate ... | ['import sys\ndef solve():\n readline = sys.stdin.readline\n N = int(readline())\n P = [list(map(int, readline().split())) for i in range(N)]\n\n P.sort()\n\n Y = [y for x, y in P]\n\n def compress(X):\n *XS, = set(X)\n XS.sort()\n return list(map({e: i for i, e in enumerate(XS)}.... | ['Runtime Error', 'Accepted'] | ['s247557493', 's230631968'] | [85772.0, 85900.0] | [2109.0, 1975.0] | [1144, 1065] |
p02956 | u941407962 | 2,000 | 1,048,576 | We have a set S of N points in a two-dimensional plane. The coordinates of the i-th point are (x_i, y_i). The N points have distinct x-coordinates and distinct y-coordinates. For a non-empty subset T of S, let f(T) be the number of points contained in the smallest rectangle, whose sides are parallel to the coordinate ... | ['import sys\ninput = sys.stdin.readline\nmod = 998244353\n\ndef sub(a, b):\n return (a % mod + mod - b % mod) % mod\n\nsys.setrecursionlimit(pow(10, 8))\n\ndef power(x, y):\n if y == 0 : return 1\n elif y == 1 : return x % mod\n elif y % 2 == 0 : return power(x, y//2)**2 % mod\n else ... | ['Wrong Answer', 'Accepted'] | ['s484104872', 's274985535'] | [41928.0, 47292.0] | [2106.0, 1852.0] | [2554, 1059] |
p02957 | u000274293 | 2,000 | 1,048,576 | We have two distinct integers A and B. Print the integer K such that |A - K| = |B - K|. If such an integer does not exist, print `IMPOSSIBLE` instead. | ["inputs = input().split()\na = int(inputs[0])\nb = int(inputs[1])\nif abs(a - b) % 2 = 0:\n print( (a + b) / 2 )\nelse:\n print('IMPOSSIBLE')\n", "inputs = input().split()\na = int(inputs[0])\nb = int(inputs[1])\nif (a - b) % 2 == 0:\n print( (a + b) / 2 )\nelse:\n print('IMPOSSIBLE')\n", "inputs = input().split()... | ['Runtime Error', 'Wrong Answer', 'Runtime Error', 'Accepted'] | ['s025053869', 's133212925', 's781438897', 's295502168'] | [2940.0, 2940.0, 2940.0, 2940.0] | [18.0, 17.0, 17.0, 17.0] | [137, 135, 134, 140] |
p02957 | u000623733 | 2,000 | 1,048,576 | We have two distinct integers A and B. Print the integer K such that |A - K| = |B - K|. If such an integer does not exist, print `IMPOSSIBLE` instead. | ['A, B = map(int, input().split())\nprint(abs(A-B)//2)\n', "A, B = map(int, input().split())\nif (A+B)%2==0:\n print((A+B)//2)\nelse:\n print('IMPOSSIBLE')"] | ['Wrong Answer', 'Accepted'] | ['s771958149', 's358082272'] | [2940.0, 2940.0] | [17.0, 17.0] | [52, 97] |
p02957 | u000981235 | 2,000 | 1,048,576 | We have two distinct integers A and B. Print the integer K such that |A - K| = |B - K|. If such an integer does not exist, print `IMPOSSIBLE` instead. | ['a,b=map(int,input().split())\nif (a+b)%2 == 0:\n print(a+b)/2\nelse:\n print("IMPOSSIBLE")\n', 'a,b=map(int,input().split())\nif (a+b)%2 == 0:\n print((a+b)//2)\nelse:\n print("IMPOSSIBLE")\n'] | ['Runtime Error', 'Accepted'] | ['s859394911', 's972126402'] | [2940.0, 2940.0] | [17.0, 17.0] | [93, 96] |
p02957 | u001834182 | 2,000 | 1,048,576 | We have two distinct integers A and B. Print the integer K such that |A - K| = |B - K|. If such an integer does not exist, print `IMPOSSIBLE` instead. | ["A,B=map(int,input().split())\n\nif (A+B)%2==0:\n print((A+B)/2)\nelse:\n print('IMPOSSIBLE')", "A,B=map(int,input().split())\n\nif (A+B)%2==0:\n print(int((A+B)/2))\nelse:\n print('IMPOSSIBLE')"] | ['Wrong Answer', 'Accepted'] | ['s869318875', 's090238303'] | [2940.0, 2940.0] | [17.0, 17.0] | [93, 98] |
p02957 | u003501233 | 2,000 | 1,048,576 | We have two distinct integers A and B. Print the integer K such that |A - K| = |B - K|. If such an integer does not exist, print `IMPOSSIBLE` instead. | ['A,B=map(int,input().split())\n\nK=abs(A+B)/2\n\nif abs(A+B) % 2 == 0:\n\tprint(K)\nelse:\n\tprint("IMPOSSIBLE")', 'A,B=map(int,input().split())\n\nK=abs(A+B)/2\n\nif abs(A+B) % 2 == 0;\n\tprint(K)\nelse;\n\tprint("IMPOSSIBLE")', 'A,B=map(int,input().split())\n\nK=(B-A)/2\n\nif (B-A) % 2 == 0;\n\tprint(K)\nelse;\n\tpr... | ['Wrong Answer', 'Runtime Error', 'Runtime Error', 'Accepted'] | ['s736654168', 's888656991', 's924607198', 's245006239'] | [2940.0, 2940.0, 2940.0, 2940.0] | [19.0, 17.0, 17.0, 17.0] | [102, 102, 96, 109] |
p02957 | u006251926 | 2,000 | 1,048,576 | We have two distinct integers A and B. Print the integer K such that |A - K| = |B - K|. If such an integer does not exist, print `IMPOSSIBLE` instead. | ['A,B = map(int, input().split())\nK2 = abs(A-B)\nif K2%2 == 0:\n print(int(K2/2) )\nelse:\n print("IMPOSSIBLE")', 'A,B = map(int, input().split())\nK2 = abs(A-B)\nif K2%2 == 0:\n print(int(max(A,B) - K2/2) )\nelse:\n print("IMPOSSIBLE")'] | ['Wrong Answer', 'Accepted'] | ['s788064027', 's679235291'] | [2940.0, 3060.0] | [17.0, 19.0] | [111, 122] |
p02957 | u007991836 | 2,000 | 1,048,576 | We have two distinct integers A and B. Print the integer K such that |A - K| = |B - K|. If such an integer does not exist, print `IMPOSSIBLE` instead. | ["s = [int(x) if x!='?' else -1 for x in input()]\n\nmod = 1000000007\nlength = len(s)\nans = list([0]*13 for i in range(length+1))\nans[0][0] = 1\n\nmod_x10 = [0]*13\nfor i in range(13):\n mod_x10[i] = i * 10 % 13 - 1\n\nfor i in range(length):\n for j in range(13):\n x = mod_x10[j]\n if s[i] == -1... | ['Runtime Error', 'Runtime Error', 'Runtime Error', 'Runtime Error', 'Accepted'] | ['s127946055', 's208728865', 's717437686', 's921705299', 's156528300'] | [3064.0, 2940.0, 3064.0, 3064.0, 2940.0] | [18.0, 17.0, 17.0, 17.0, 17.0] | [556, 100, 430, 556, 103] |
p02957 | u017415492 | 2,000 | 1,048,576 | We have two distinct integers A and B. Print the integer K such that |A - K| = |B - K|. If such an integer does not exist, print `IMPOSSIBLE` instead. | ['a,b=map(int,input().split())\nif a+b/2:\n print("IMPOSSIBLE")\nelse:\n print(a+b/2)', 'a,b=map(int,input().split())\nif a+b%2:\n print("IMPOSSIBLE")\nelse:\n print(a+b/2)', 'a,b=map(int,input().split())\nif (a+b)%2:\n print("IMPOSSIBLE")\nelse:\n print((a+b)/2)', 'a,b=map(int,input().split())\nif (a+b)%2:\n pr... | ['Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Accepted'] | ['s334902917', 's897814667', 's916030819', 's788086354'] | [2940.0, 2940.0, 2940.0, 2940.0] | [17.0, 17.0, 17.0, 17.0] | [81, 81, 85, 93] |
p02957 | u020798319 | 2,000 | 1,048,576 | We have two distinct integers A and B. Print the integer K such that |A - K| = |B - K|. If such an integer does not exist, print `IMPOSSIBLE` instead. | ['length = int(input())\nlist_p = list(map(int,input().split()))\n#list_p.sort()\ncount = 0\nfor i in range(length):\n if list_p[i] != (i+1):\n count += 1\n \nif count <= 2 :\n print ("YES")\nelse :\n print ("NO")', 'n = int(input())\np = list(map(int,input().split()))\ncnt = 0\nfor i in range(n):\n if p[i] != (... | ['Runtime Error', 'Runtime Error', 'Accepted'] | ['s329284671', 's665280003', 's499335067'] | [8964.0, 9028.0, 8932.0] | [22.0, 25.0, 30.0] | [206, 159, 106] |
p02957 | u023958502 | 2,000 | 1,048,576 | We have two distinct integers A and B. Print the integer K such that |A - K| = |B - K|. If such an integer does not exist, print `IMPOSSIBLE` instead. | ['# n,m = map(int,input().split())\nn = int(input())\n# n = input()\na = list(map(int,input().split()))\nb = list(map(int,input().split()))\ncnt = 0\nleft = 0\nfor i in range(n):\n a1,b1 = a[i],b[i]\n if a1 <= b1 + left:\n cnt += a1\n left = min(b1 - a1 + left,b1)\n else:\n cnt += b1 + lef... | ['Runtime Error', 'Accepted'] | ['s652936514', 's618811075'] | [3064.0, 2940.0] | [17.0, 17.0] | [390, 139] |
p02957 | u025501820 | 2,000 | 1,048,576 | We have two distinct integers A and B. Print the integer K such that |A - K| = |B - K|. If such an integer does not exist, print `IMPOSSIBLE` instead. | ['#!/usr/bin/env python3\n# N = int(input())\n# S = input()\nA, B = map(int, input().split())\n# A = list(map(int, input().split()))\nif (A + B) % 2 == 0:\n print((A + B)) // 2)\nelse:\n print("IMPOSSIBLE")', '#!/usr/bin/env python3\n# N = int(input())\n# S = input()\nA, B = map(int, input().split())\n# A = list(... | ['Runtime Error', 'Accepted'] | ['s153515678', 's047185675'] | [2940.0, 2940.0] | [17.0, 17.0] | [202, 201] |
p02957 | u027002244 | 2,000 | 1,048,576 | We have two distinct integers A and B. Print the integer K such that |A - K| = |B - K|. If such an integer does not exist, print `IMPOSSIBLE` instead. | ['a,b=map(int,input().split())\n\nif (a-b)%2==0:\n print(int(abs((a-b)/2)))\nelse:\n print("IMPOSSIBLE")', 'a,b=map(int,input().split())\n\nif (a-b)%2==0:\n print(int(abs( ((a+b)/2) )))\nelse:\n print("IMPOSSIBLE")'] | ['Wrong Answer', 'Accepted'] | ['s681408235', 's608765758'] | [2940.0, 2940.0] | [17.0, 17.0] | [103, 110] |
p02957 | u027403702 | 2,000 | 1,048,576 | We have two distinct integers A and B. Print the integer K such that |A - K| = |B - K|. If such an integer does not exist, print `IMPOSSIBLE` instead. | ['A,B = map(int, input().split())\n# R = int(input())\n# B = int(input())\n# C = int(input())\n# b = input()\nprint((A + B) / 2 if (A + B) % 2 == 0 else "IMPOSSIBLE")', 'A,B = map(int, input().split())\n# R = int(input())\n# B = int(input())\n# C = int(input())\n# b = input()\nprint((A + B) // 2 if (A + B) % 2 == 0 els... | ['Wrong Answer', 'Accepted'] | ['s396234295', 's737776829'] | [2940.0, 2940.0] | [17.0, 17.0] | [159, 160] |
p02957 | u027675217 | 2,000 | 1,048,576 | We have two distinct integers A and B. Print the integer K such that |A - K| = |B - K|. If such an integer does not exist, print `IMPOSSIBLE` instead. | ['a,b = map(int, input().split())\nans="IMPOSSIBLE"\nif a%b==0:\n\tans=(a+b)/2\nprint(ans)', 'a,b = map(int, input().split())\nans="IMPOSSIBLE"\nif (a+b)%2==0:\n\tans=(a+b)//2\nprint(ans)\n'] | ['Wrong Answer', 'Accepted'] | ['s728180156', 's793365120'] | [2940.0, 2940.0] | [17.0, 17.0] | [83, 89] |
p02957 | u028413707 | 2,000 | 1,048,576 | We have two distinct integers A and B. Print the integer K such that |A - K| = |B - K|. If such an integer does not exist, print `IMPOSSIBLE` instead. | ["a, b = map(int, input().sprit())\n\n\nif (a + b) % 2 == 0:\n print((a+b)//2)\nelse:\n print('IMPOSSIBLE')", "a, b = map(int, input().split())\n\n\nif (a + b) % 2 == 0:\n print((a+b)//2)\nelse:\n print('IMPOSSIBLE')"] | ['Runtime Error', 'Accepted'] | ['s006856303', 's534119462'] | [2940.0, 2940.0] | [17.0, 19.0] | [182, 182] |
p02957 | u028620830 | 2,000 | 1,048,576 | We have two distinct integers A and B. Print the integer K such that |A - K| = |B - K|. If such an integer does not exist, print `IMPOSSIBLE` instead. | ['a,b = map(int, input().split())\nsum = a + b\nprint(sum / 2 if sum % 2 == 0 else "IMPOSSIBLE")', 'a,b = map(int, input().split())\nsum = a + b\nprint(sum // 2 if sum % 2 == 0 else "IMPOSSIBLE")'] | ['Wrong Answer', 'Accepted'] | ['s905925082', 's095016884'] | [2940.0, 2940.0] | [17.0, 17.0] | [92, 93] |
p02957 | u033524082 | 2,000 | 1,048,576 | We have two distinct integers A and B. Print the integer K such that |A - K| = |B - K|. If such an integer does not exist, print `IMPOSSIBLE` instead. | ['a,b=map(int,input().split());print((a+b)/2 if (a+b)%2==0 else "IMPOSSIBLE")', 'a,b=map(int,input().split())\nprint((a+b)/2 if (a+b)%2==0 else "IMPOSSIBLE")', 'a,b=map(int,input().split())\nprint((a+b)//2 if (a+b)%2==0 else "IMPOSSIBLE")\n'] | ['Wrong Answer', 'Wrong Answer', 'Accepted'] | ['s301144824', 's727030147', 's496871892'] | [2940.0, 2940.0, 2940.0] | [17.0, 17.0, 18.0] | [75, 75, 77] |
p02957 | u033642300 | 2,000 | 1,048,576 | We have two distinct integers A and B. Print the integer K such that |A - K| = |B - K|. If such an integer does not exist, print `IMPOSSIBLE` instead. | ["def main():\n a, b = map(int, input().split())\n if a % 2 and b % 2:\n print((a+b)/2)\n else:\n print('IMPOSSIBLE')\nmain()", "import math\n\ndef main():\n a, b = map(int, input().split())\n if ((a % 2) == 0 and (b % 2) == 0) or ((a % 2) == 1 and (b % 2) == 1):\n print(math.floor((... | ['Wrong Answer', 'Accepted'] | ['s692939802', 's250671842'] | [9100.0, 9140.0] | [30.0, 25.0] | [140, 216] |
p02957 | u034128150 | 2,000 | 1,048,576 | We have two distinct integers A and B. Print the integer K such that |A - K| = |B - K|. If such an integer does not exist, print `IMPOSSIBLE` instead. | ['t = sum(map(int, input())\nif t % 2 == 0:\n print(t//2)\nelse:\n print("IMPOSSIBLE")', 't = sum(map(int, input().split()))\nif t % 2 == 0:\n print(t//2)\nelse:\n print("IMPOSSIBLE")\n'] | ['Runtime Error', 'Accepted'] | ['s439909777', 's046360962'] | [2940.0, 2940.0] | [17.0, 17.0] | [86, 104] |
p02957 | u038216098 | 2,000 | 1,048,576 | We have two distinct integers A and B. Print the integer K such that |A - K| = |B - K|. If such an integer does not exist, print `IMPOSSIBLE` instead. | ['A,B=map(int,input().split())\nK=(A+B)/2\nif(K.is_integer()==True):\n print(K)\nelse:\n print("Impossible")', 'A,B=map(int,input().split())\nK=(A+B)/2\nif(K.is_integer()==True):\n print(int(K))\nelse:\n print("IMPOSSIBLE")'] | ['Wrong Answer', 'Accepted'] | ['s649315737', 's239902691'] | [9084.0, 9132.0] | [26.0, 28.0] | [103, 108] |
p02957 | u038408819 | 2,000 | 1,048,576 | We have two distinct integers A and B. Print the integer K such that |A - K| = |B - K|. If such an integer does not exist, print `IMPOSSIBLE` instead. | ['a, b = map(int, input().split())\nc = abs(a - b) \nif c % 2 != 0:\n print("IMPOSSIBLE")\nelse:\n print(min(a, b) + c / 2)', "a, b = map(int, input().split())\nc = abs(a - b) / 2\ns = abs(max(a, b) - c)\nif (a + b) % 2 == 1:\n print('IMPOSSIBLE')\nelse:\n print(s)\n#print(abs(max(a, b) - c))", 'a, b = map(... | ['Wrong Answer', 'Wrong Answer', 'Accepted'] | ['s426725082', 's830207333', 's626210240'] | [2940.0, 2940.0, 2940.0] | [17.0, 17.0, 17.0] | [122, 165, 127] |
p02957 | u046585946 | 2,000 | 1,048,576 | We have two distinct integers A and B. Print the integer K such that |A - K| = |B - K|. If such an integer does not exist, print `IMPOSSIBLE` instead. | ['a,b=map(int,input().split())\nif abs(a-b)%2==0:\n print(abs(a-b)//2)\nelse:\n print("IMPOSSIBLE")', 'a,b=map(int,input().split())\nif abs(a-b)%2==0:\n print((a+b)//2)\nelse:\n print("IMPOSSIBLE")'] | ['Wrong Answer', 'Accepted'] | ['s003135501', 's158240920'] | [2940.0, 3064.0] | [17.0, 17.0] | [95, 92] |
p02957 | u046826851 | 2,000 | 1,048,576 | We have two distinct integers A and B. Print the integer K such that |A - K| = |B - K|. If such an integer does not exist, print `IMPOSSIBLE` instead. | ["a, b = map(int, input().split( ))\ns = a + b\nif s %2 ==1:\n print('IMPOSSIBLE')\nelse;\nprint(s//2)", "a, b = map(int, input().split( ))\ns = a + b\nif s %2 ==1:\n print('IMPOSSIBLE')\nelse:\n print(s//2)\n"] | ['Runtime Error', 'Accepted'] | ['s666210577', 's220414196'] | [8896.0, 8904.0] | [26.0, 26.0] | [96, 99] |
p02957 | u048214692 | 2,000 | 1,048,576 | We have two distinct integers A and B. Print the integer K such that |A - K| = |B - K|. If such an integer does not exist, print `IMPOSSIBLE` instead. | ['a,b = input()', 'a,b=map(int, input().split())\n\n\nif (a + b) % 2 === 0:\n print((a + b) // 2)\nelse:\n print("IMPOSSIBLE")', 'from sys import stdin\n\nn = int(stdin.readline().rstrip())\n\nprint(n)', "a,b=map(int, input().split())\n\nc = a + b\n\nif c % 2 == 0:\n print(c)\nelse:\n print('IMPOSSIBLE')\n ", 'n =... | ['Runtime Error', 'Runtime Error', 'Runtime Error', 'Wrong Answer', 'Runtime Error', 'Runtime Error', 'Runtime Error', 'Runtime Error', 'Wrong Answer', 'Runtime Error', 'Wrong Answer', 'Accepted'] | ['s011915238', 's259340757', 's264624130', 's416316840', 's466107105', 's507478551', 's542862837', 's583975932', 's627837426', 's796175819', 's812523694', 's009209633'] | [2940.0, 2940.0, 2940.0, 2940.0, 2940.0, 2940.0, 2940.0, 2940.0, 2940.0, 2940.0, 2940.0, 2940.0] | [17.0, 17.0, 17.0, 17.0, 17.0, 17.0, 17.0, 17.0, 17.0, 17.0, 20.0, 17.0] | [13, 103, 67, 98, 106, 117, 109, 127, 11, 153, 32, 108] |
p02957 | u052347048 | 2,000 | 1,048,576 | We have two distinct integers A and B. Print the integer K such that |A - K| = |B - K|. If such an integer does not exist, print `IMPOSSIBLE` instead. | ['a,b = map(int,input().split())\nif (a + b) % 2 == 0:\n print((a+b)/2)\nelse:\n print("IMPOSSIBLE")', 'a,b = map(int,input().split())\nif (a + b) % 2 == 0:\n print((a+b)//2)\nelse:\n print("IMPOSSIBLE")'] | ['Wrong Answer', 'Accepted'] | ['s508071758', 's942055571'] | [2940.0, 2940.0] | [17.0, 17.0] | [96, 97] |
p02957 | u053620280 | 2,000 | 1,048,576 | We have two distinct integers A and B. Print the integer K such that |A - K| = |B - K|. If such an integer does not exist, print `IMPOSSIBLE` instead. | ['AB = int(input().split())\n\nA = AB[0]\nB = AB[1]\n\nif A%2 == 0 and B%2 == 0:\n print((A+B)/2)\n \nelif A%2 == 1 and B%2 ==1:\n print((A+B)/1)\n \nelse:\n print("IMPOSSIBLE")', 'AB = list(map(int, input().split()))\n \nA = int(AB[0])\nB = int(AB[1])\n \nif A%2 == 0 and B%2 == 0:\n print((A+B)/2)\nelif A%2 ==... | ['Runtime Error', 'Wrong Answer', 'Accepted'] | ['s120800953', 's631815379', 's959413217'] | [3060.0, 3060.0, 3060.0] | [17.0, 17.0, 18.0] | [168, 192, 202] |
p02957 | u055875839 | 2,000 | 1,048,576 | We have two distinct integers A and B. Print the integer K such that |A - K| = |B - K|. If such an integer does not exist, print `IMPOSSIBLE` instead. | ['a, b = map(int, input().split(" "))\nprint(int(abs((a-b)/2)) if abs((a-b)/2)%1==0 else "IMPOSSIBLE")', 'a, b = map(int, input().split(" "))\nprint(int(abs((a+b)/2)) if abs((a+b)/2)%1==0 else "IMPOSSIBLE")'] | ['Wrong Answer', 'Accepted'] | ['s811299583', 's998665944'] | [2940.0, 2940.0] | [17.0, 17.0] | [99, 99] |
p02957 | u056659569 | 2,000 | 1,048,576 | We have two distinct integers A and B. Print the integer K such that |A - K| = |B - K|. If such an integer does not exist, print `IMPOSSIBLE` instead. | ["a, b= map(int, input().split())\nif (a+b)%2==0:\n print((a+b)/2)\nelse:\n print('IMPOSSIBLE')\n", "a, b= map(int, input().split())\nif (a+b)%2==0:\n k=(a+b)/2\n print(k)\nelse:\n print('IMPOSSIBLE')\n", "a, b= map(int, input().split())\nif (a+b)%2==0:\n print((a+b)//2)\nelse:\n print('IMPOSSIBLE')\n"] | ['Wrong Answer', 'Wrong Answer', 'Accepted'] | ['s358469817', 's981729008', 's891414063'] | [3060.0, 2940.0, 2940.0] | [17.0, 17.0, 17.0] | [92, 98, 93] |
p02957 | u058592821 | 2,000 | 1,048,576 | We have two distinct integers A and B. Print the integer K such that |A - K| = |B - K|. If such an integer does not exist, print `IMPOSSIBLE` instead. | ["a, b = (int(i) for i in input().split())\nif a+b % 2 == 0:\n print((a+b)//2)\nelse:\n print('IMPOSSIBLE')", "a, b = (int(i) for i in input().split())\nif (a+b) % 2 == 0:\n print((a+b)//2)\nelse:\n print('IMPOSSIBLE')"] | ['Wrong Answer', 'Accepted'] | ['s690300642', 's370248982'] | [2940.0, 2940.0] | [17.0, 17.0] | [103, 105] |
p02957 | u062314674 | 2,000 | 1,048,576 | We have two distinct integers A and B. Print the integer K such that |A - K| = |B - K|. If such an integer does not exist, print `IMPOSSIBLE` instead. | ["N = int(input())\nk = 0\nlis = list(range(1, N+1))\nfor i in range(1, N+1):\n a = int(input())\n if a == lis[i-1]:\n k += 10\n else:\n k += 0\nif k >= 10 * (N-2):\n print('YES')\nelse:\n print('NO')\n\n", ", B = map(int, input().split())\n \nif A > B:\n for i in range(A):\n k = abs(A - i)\n l = abs(... | ['Runtime Error', 'Runtime Error', 'Wrong Answer', 'Wrong Answer', 'Runtime Error', 'Time Limit Exceeded', 'Runtime Error', 'Time Limit Exceeded', 'Accepted'] | ['s326570086', 's394021087', 's549062823', 's558771200', 's653839855', 's665508100', 's680065560', 's863264465', 's236170925'] | [3060.0, 2940.0, 3060.0, 29428.0, 2940.0, 30452.0, 2940.0, 29684.0, 2940.0] | [17.0, 17.0, 2104.0, 2104.0, 17.0, 2104.0, 17.0, 2104.0, 17.0] | [199, 307, 289, 317, 93, 148, 289, 151, 117] |
p02957 | u062604519 | 2,000 | 1,048,576 | We have two distinct integers A and B. Print the integer K such that |A - K| = |B - K|. If such an integer does not exist, print `IMPOSSIBLE` instead. | ["a,b,c = map(int,input().split())\ns=c-(a-b)\nif s>0:\n print(s)\nelse:\n print('0')", "A,B = map(int,input().split())\nK=(A+B)/2\nif K%1==0:\n print(K)\nelse:\n print('IMPOSSIBLE')", "A,B = map(int,input().split())\nK=(A+B)/2\nif K%1==0:\n print(int(K))\nelse:\n print('IMPOSSIBLE')"] | ['Runtime Error', 'Wrong Answer', 'Accepted'] | ['s666824236', 's887882870', 's706979099'] | [2940.0, 2940.0, 3064.0] | [17.0, 17.0, 17.0] | [80, 90, 95] |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.