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
|
|---|---|---|---|---|---|---|---|---|---|---|
p03220
|
u796708718
| 2,000
| 1,048,576
|
A country decides to build a palace. In this country, the average temperature of a point at an elevation of x meters is T-x \times 0.006 degrees Celsius. There are N places proposed for the place. The elevation of Place i is H_i meters. Among them, Princess Joisino orders you to select the place whose average temperature is the closest to A degrees Celsius, and build the palace there. Print the index of the place where the palace should be built. It is guaranteed that the solution is unique.
|
['N = int(input())\nT, A = [int(i) for i in input().split(" ")]\ntemp = [T-0.006*int(h) for h in input().split(" ")]\n\nplace = 0\ndiff_min = T\n\nfor cnt, t in enumerate(temp):\n if abs(T-t) < diff_min:\n diff_min = abs(T-t)\n place = cnt\n\nprint(place)\n ', 'N = int(input())\nT, A = [int(i) for i in input().split(" ")]\ntemp = [int(T-0.006*h) for h in int(input().split(" "))]\n\nplace = 0\ndiff_min = 0\n\nfor cnt, t in enumerate(temp):\n if abs(T-t) < diff_min:\n diff_min = abs(T-t)\n place = cnt\n\nprint(place)\n ', 'N = int(input())\nT, A = [int(i) for i in input().split(" ")]\ntemp = [T-0.006*int(h) for h in input().split(" ")]\n\nplace = 0\ndiff_min = 60\n\nfor cnt, t in enumerate(temp):\n if abs(A-t) < diff_min:\n diff_min = abs(A-t)\n place = cnt\n\nprint(place)\n ', 'N = int(input())\nT, A = [int(i) for i in input().split(" ")]\ntemp = [T-0.006*int(h) for h in input().split(" ")]\n\nplace = 0\ndiff_min = abs(temp[0]-A)\n\nfor cnt, t in enumerate(temp):\n if abs(A-t) < diff_min:\n diff_min = abs(A-t)\n place = cnt\n\nprint(place)\n ', 'N = int(input())\nT, A = [int(i) for i in input().split(" ")]\ntemp = [T-0.006*int(h) for h in input().split(" ")]\n\nplace = 0\ndiff_min = abs(temp[0]-A)\n\nfor cnt, t in enumerate(temp,1):\n if abs(A-t) < diff_min:\n diff_min = abs(A-t)\n place = cnt\n\nprint(place)\n \n', 'N = int(input())\nT, A = [int(i) for i in input().split(" ")]\ntemp = [T-0.006*int(h) for h in input().split(" ")]\n\nplace = 1\ndiff_min = abs(temp[0]-A)\n\nfor cnt, t in enumerate(temp,1):\n if abs(A-t) < diff_min:\n diff_min = abs(A-t)\n place = cnt\n\nprint(place)\n ']
|
['Wrong Answer', 'Runtime Error', 'Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Accepted']
|
['s082668016', 's712884018', 's733476176', 's739741546', 's918350176', 's900342448']
|
[3060.0, 3060.0, 3060.0, 3060.0, 3060.0, 3188.0]
|
[18.0, 17.0, 18.0, 18.0, 18.0, 20.0]
|
[251, 256, 252, 264, 267, 266]
|
p03220
|
u799479335
| 2,000
| 1,048,576
|
A country decides to build a palace. In this country, the average temperature of a point at an elevation of x meters is T-x \times 0.006 degrees Celsius. There are N places proposed for the place. The elevation of Place i is H_i meters. Among them, Princess Joisino orders you to select the place whose average temperature is the closest to A degrees Celsius, and build the palace there. Print the index of the place where the palace should be built. It is guaranteed that the solution is unique.
|
['N = int(input())\nT,A = map(int, input().split())\nHs = input().split()\nfor i in range(N):\n Hs[i] = int(Hs[i])\nHs = np.array(Hs)\n\nTs = T - Hs*0.006\n\nTs_A = np.abs(Ts - A)\n\nprint(np.argmin(Ts_A))', 'import numpy as np\nN = int(input())\nT,A = map(int, input().split())\nHs = input().split()\nfor i in range(N):\n Hs[i] = int(Hs[i])\nHs = np.array(Hs)\n\nTs = T - Hs*0.006\n\nTs_A = np.abs(Ts - A)\n\nprint(np.argmin(Ts_A))\n', 'import numpy as np\nN = int(input())\nT,A = map(int, input().split())\nHs = input().split()\nfor i in range(N):\n Hs[i] = int(Hs[i])\nHs = np.array(Hs)\n\nTs = T - Hs*0.006\n\nTs_A = np.abs(Ts - A)\n\nprint(np.argmin(Ts_A)+1)']
|
['Runtime Error', 'Wrong Answer', 'Accepted']
|
['s433680371', 's628653660', 's270766942']
|
[3060.0, 21280.0, 14428.0]
|
[18.0, 362.0, 151.0]
|
[193, 213, 214]
|
p03220
|
u800780376
| 2,000
| 1,048,576
|
A country decides to build a palace. In this country, the average temperature of a point at an elevation of x meters is T-x \times 0.006 degrees Celsius. There are N places proposed for the place. The elevation of Place i is H_i meters. Among them, Princess Joisino orders you to select the place whose average temperature is the closest to A degrees Celsius, and build the palace there. Print the index of the place where the palace should be built. It is guaranteed that the solution is unique.
|
['N = int(input())\nT,A = map(int, input().split())\nH = input().split() \nHls = []\n\nc = 1\nfor i in H:\n Hls.append((abs(A - (T - int(i)*0.006)),int(c)))\n c = c+1\n\n', 'N = int(input())\nT,A = map(int, input().split())\nH = input().split() \nHls = []\n\nc = 1\nfor i in H:\n Hls.append((abs(A - (T - int(i)*0.006)),int(c)))\n c = c+1\n\nprint(min(Hls)[1])']
|
['Wrong Answer', 'Accepted']
|
['s689995275', 's500425541']
|
[3188.0, 3188.0]
|
[19.0, 18.0]
|
[164, 182]
|
p03220
|
u801512570
| 2,000
| 1,048,576
|
A country decides to build a palace. In this country, the average temperature of a point at an elevation of x meters is T-x \times 0.006 degrees Celsius. There are N places proposed for the place. The elevation of Place i is H_i meters. Among them, Princess Joisino orders you to select the place whose average temperature is the closest to A degrees Celsius, and build the palace there. Print the index of the place where the palace should be built. It is guaranteed that the solution is unique.
|
['N = int(input())\nT,A=map(int, input().split())\nH=list(map(int, input().split()))\nH=[abs(A-(T-h*0.006)) for h in H]\nprint(H.index(min(H)))', 'N = int(input())\nT,A=map(int, input().split())\nH=list(map(int, input().split()))\nH=[abs(A-(T-h*0.006)) for h in H]\nprint(H.index(min(H))+1)']
|
['Wrong Answer', 'Accepted']
|
['s916556165', 's916646485']
|
[3060.0, 3060.0]
|
[18.0, 18.0]
|
[137, 139]
|
p03220
|
u803481017
| 2,000
| 1,048,576
|
A country decides to build a palace. In this country, the average temperature of a point at an elevation of x meters is T-x \times 0.006 degrees Celsius. There are N places proposed for the place. The elevation of Place i is H_i meters. Among them, Princess Joisino orders you to select the place whose average temperature is the closest to A degrees Celsius, and build the palace there. Print the index of the place where the palace should be built. It is guaranteed that the solution is unique.
|
['n = int(input())\nt,a = map(int,input().split())\nh = list(map(int,input().split()))\ntem = 1000\nfor i in h:\n c = t-0.006*i\n d = c - a\n if d**2 < tem:\n tem = c\nanswer = h.index(tem) + 1\nprint(answer)\n', 'n = int(input())\nt,a = map(int,input().split())\nh = list(map(int,input().split()))\ntem = 1000\nz = 0\nfor i in h:\n c = t-0.006*i\n d = c - a\n e = tem - a\n if d**2 < e**2:\n tem = c\n z = i \nprint(z+1)\n', 'n = int(input())\nt,a = map(int,input().split())\nh = map(int,input().split())\ntem = 1000\nfor i in h:\n c = t-0.006*i\n d = c - a\n if d**2 < tem:\n tem = c\nprint(int(tem))', 'n = int(input())\nt,a = map(int,input().split())\nh = list(map(int,input().split()))\ntem = 1000\nz = 0\nfor i in h:\n c = t-0.006*i\n d = c - a\n e = tem - a\n if d**2 < e**2:\n tem = c\n z = i \naa = h.index(z) + 1\nprint(aa)\n']
|
['Runtime Error', 'Wrong Answer', 'Wrong Answer', 'Accepted']
|
['s169698938', 's257955441', 's901960353', 's511273548']
|
[3060.0, 3060.0, 3060.0, 3060.0]
|
[18.0, 18.0, 18.0, 18.0]
|
[203, 206, 172, 225]
|
p03220
|
u803617136
| 2,000
| 1,048,576
|
A country decides to build a palace. In this country, the average temperature of a point at an elevation of x meters is T-x \times 0.006 degrees Celsius. There are N places proposed for the place. The elevation of Place i is H_i meters. Among them, Princess Joisino orders you to select the place whose average temperature is the closest to A degrees Celsius, and build the palace there. Print the index of the place where the palace should be built. It is guaranteed that the solution is unique.
|
['n = int(input())\nt, a = map(int, input().split())\ntemp = 10 ** 6\nans = 0\nheight = list(map(int, input().split()))\nfor i, h in enumerate(height):\n diff = abs(a - (t - h * 0.006))\n print(diff)\n if temp > diff:\n temp = diff\n ans = i + 1\nprint(ans)', 'n = int(input())\nt, a = map(int, input().split())\ntemp = 10 ** 6\nans = 0\nheight = list(map(int, input().split()))\nfor i, h in enumerate(height):\n diff = abs(a - (t - h * 0.006))\n if temp > diff:\n temp = diff\n ans = i + 1\nprint(ans)']
|
['Wrong Answer', 'Accepted']
|
['s334144830', 's673202222']
|
[3188.0, 3060.0]
|
[20.0, 18.0]
|
[267, 251]
|
p03220
|
u813371068
| 2,000
| 1,048,576
|
A country decides to build a palace. In this country, the average temperature of a point at an elevation of x meters is T-x \times 0.006 degrees Celsius. There are N places proposed for the place. The elevation of Place i is H_i meters. Among them, Princess Joisino orders you to select the place whose average temperature is the closest to A degrees Celsius, and build the palace there. Print the index of the place where the palace should be built. It is guaranteed that the solution is unique.
|
['n = int(input())\nT,A = map(int, input().split())\nH = list(map(int, input().split()))\nz = [abs(T-h*0.006-a) for h in H]\nprint( z.index(min(z)) +1 )', 'n = int(input())\nT,A = map(int, input().split())\nH = list(map(int, input().split()))\nz = [abs(a - (t - h*0.006)) for h in H]\nprint( z.index(min(z)) +1 )', 'n = int(input())\nT,A = map(int, input().split())\nH = map(int, input().split())\nz = [abs(a - t - h*0.006) for h in H]\nprint( z.index(min(z)) +1 )', 'n = int(input())\nT,A = map(int, input().split())\nH = map(int, input().split())\nz = [abs(a - (t - h*0.006)) for h in H]\nprint( z.index(min(z)) +1 )', 'n = int(input())\nT,A = map(int, input().split())\nH = list(map(int, input().split()))\nz = [abs(A - (T - h*0.006)) for h in H]\nprint( z.index(min(z)) +1 )']
|
['Runtime Error', 'Runtime Error', 'Runtime Error', 'Runtime Error', 'Accepted']
|
['s031482889', 's047819248', 's825870293', 's910547458', 's594976687']
|
[3064.0, 3060.0, 3060.0, 3060.0, 3060.0]
|
[17.0, 17.0, 18.0, 17.0, 18.0]
|
[146, 152, 144, 146, 152]
|
p03220
|
u814265211
| 2,000
| 1,048,576
|
A country decides to build a palace. In this country, the average temperature of a point at an elevation of x meters is T-x \times 0.006 degrees Celsius. There are N places proposed for the place. The elevation of Place i is H_i meters. Among them, Princess Joisino orders you to select the place whose average temperature is the closest to A degrees Celsius, and build the palace there. Print the index of the place where the palace should be built. It is guaranteed that the solution is unique.
|
['l = [abs(a-(t-i*0.006)) for i in h]\nprint(l.index(min(l))+1)', 'N = int(input())\nT, A = map(int, input().split())\nH = list(map(int, input().split()))\nl = [T - h*0.006 for h in H]\nprint(l.index(min(l, key=lambda v: abs(A - v))) + 1)']
|
['Runtime Error', 'Accepted']
|
['s183627730', 's909748700']
|
[2940.0, 9148.0]
|
[17.0, 30.0]
|
[60, 167]
|
p03220
|
u814986259
| 2,000
| 1,048,576
|
A country decides to build a palace. In this country, the average temperature of a point at an elevation of x meters is T-x \times 0.006 degrees Celsius. There are N places proposed for the place. The elevation of Place i is H_i meters. Among them, Princess Joisino orders you to select the place whose average temperature is the closest to A degrees Celsius, and build the palace there. Print the index of the place where the palace should be built. It is guaranteed that the solution is unique.
|
['N = int(input())\nT,A = map(int,input().split())\ndef calc(A):\n return((T - A) / 0.006)\n\nH = list(map(int,input().split()))\nx = calc(A)\nans=x\nfor i in range(N):\n if abs(H[i] - x) < abs(ans):\n ans = H[i] - x\n \nans = int(ans + x)\nprint(H.index(ans))\n\n', '\nN = int(input())\nT,A = map(int,input().split())\ndef calc(A):\n return((T - A) / 0.006)\n\nH = list(map(int,input().split()))\nx = calc(A)\nans=max(H) - x\nfor i in range(N):\n if abs(H[i] - x) < abs(ans):\n ans = H[i] - x\n \nans = int(ans + x)\nprint(H.index(ans)+1)']
|
['Runtime Error', 'Accepted']
|
['s984055597', 's399752032']
|
[3060.0, 3064.0]
|
[18.0, 18.0]
|
[255, 265]
|
p03220
|
u818349438
| 2,000
| 1,048,576
|
A country decides to build a palace. In this country, the average temperature of a point at an elevation of x meters is T-x \times 0.006 degrees Celsius. There are N places proposed for the place. The elevation of Place i is H_i meters. Among them, Princess Joisino orders you to select the place whose average temperature is the closest to A degrees Celsius, and build the palace there. Print the index of the place where the palace should be built. It is guaranteed that the solution is unique.
|
['n = int(input())\nt,a = map(int,input().split())\nh = list(map(int,input().split()))\nprint(h)\nfor i in range(n):\n h[i] = abs(t-(h[i]*0.006)-a)\nans = h.index(min(h))+1\nprint(ans)\n', 'n = int(input())\nt,a = map(int,input().split())\nh = list(map(int,input().split()))\n\nfor i in range(n):\n h[i] = abs(t-(h[i]*0.006)-a)\nans = h.index(min(h))+1\nprint(ans)\n']
|
['Wrong Answer', 'Accepted']
|
['s913885613', 's772205515']
|
[3060.0, 3060.0]
|
[18.0, 18.0]
|
[179, 171]
|
p03220
|
u819135704
| 2,000
| 1,048,576
|
A country decides to build a palace. In this country, the average temperature of a point at an elevation of x meters is T-x \times 0.006 degrees Celsius. There are N places proposed for the place. The elevation of Place i is H_i meters. Among them, Princess Joisino orders you to select the place whose average temperature is the closest to A degrees Celsius, and build the palace there. Print the index of the place where the palace should be built. It is guaranteed that the solution is unique.
|
['n = int(input())\nt, a = map(int, input().split())\nlist = [int(i) for i in input().split()]\n\ndif_list = []\nanswer = 0\n\nfor i in range(n):\n t_i = t - list(i) * 0.006\n t_i_dif = abs(a - t_i)\n dif_list.append(t_i_dif)\n if min(dif_list) == t_i_dif:\n answer = i + 1\n\nprint(answer)\n', 'n = int(input())\nt, a = map(int, input().split())\nlist = [int(i) for i in input().split()]\n\ndif_list = []\n\nfor i in range(n):\n t_i = t - list[i] * 0.006\n t_i_dif = abs(a - t_i)\n dif_list.append(t_i_dif)\n\nMin = min(dif_list)\nprint(dif_list.index(Min) + 1)\n']
|
['Runtime Error', 'Accepted']
|
['s862713349', 's093577420']
|
[3060.0, 3060.0]
|
[18.0, 19.0]
|
[294, 264]
|
p03220
|
u819529201
| 2,000
| 1,048,576
|
A country decides to build a palace. In this country, the average temperature of a point at an elevation of x meters is T-x \times 0.006 degrees Celsius. There are N places proposed for the place. The elevation of Place i is H_i meters. Among them, Princess Joisino orders you to select the place whose average temperature is the closest to A degrees Celsius, and build the palace there. Print the index of the place where the palace should be built. It is guaranteed that the solution is unique.
|
['N = int(input())\nT, A = map(int, input().split())\nH = list(map(int,input().split()))\n\nfor i in H:\n temp = T-i*0.006-A\nprint(min(temp))', 'N = int(input())\nT, A = map(int, input().split())\nH = list(map(int,input().split()))\nt = [abs(T - H[i]*0.006-A) for i in range(N)]\nprint(t.index(min(t))+1)']
|
['Runtime Error', 'Accepted']
|
['s478755471', 's516960622']
|
[3060.0, 3060.0]
|
[18.0, 19.0]
|
[137, 155]
|
p03220
|
u819710930
| 2,000
| 1,048,576
|
A country decides to build a palace. In this country, the average temperature of a point at an elevation of x meters is T-x \times 0.006 degrees Celsius. There are N places proposed for the place. The elevation of Place i is H_i meters. Among them, Princess Joisino orders you to select the place whose average temperature is the closest to A degrees Celsius, and build the palace there. Print the index of the place where the palace should be built. It is guaranteed that the solution is unique.
|
['n=int(input())\nt,a=map(int,input().split())\nh=list(map(int,input().split()))\nab=[0]*n\nfor i in range(n): ab[i]=abs(a-(t-h[i]*0.006))\nprint(h.index(min(ab))+1)', 'n=int(input())\nt,a=map(int,input().split())\nh=list(map(int,input().split()))\nab=[0]*n\nfor i in range(n): ab[i]=abs(a-(t-h[i]*0.006))\nprint(ab.index(min(ab))+1)']
|
['Runtime Error', 'Accepted']
|
['s766984951', 's570479997']
|
[3060.0, 3444.0]
|
[19.0, 19.0]
|
[158, 159]
|
p03220
|
u820496543
| 2,000
| 1,048,576
|
A country decides to build a palace. In this country, the average temperature of a point at an elevation of x meters is T-x \times 0.006 degrees Celsius. There are N places proposed for the place. The elevation of Place i is H_i meters. Among them, Princess Joisino orders you to select the place whose average temperature is the closest to A degrees Celsius, and build the palace there. Print the index of the place where the palace should be built. It is guaranteed that the solution is unique.
|
['n = int(input())\nt,a = map(float, input().split( ))\nh = list(map(float, input().split( )))\nans= float(0)\nc1 = float(0)\nc2 = float(1000000000)\nfor i in range(n):\n c1 = a-(t-(h[i]*0.0006))\n c1 = abs(c1)\n if c1 <= c2:\n ans = i+1\n c2 = c1\nprint(ans)', 'n = int(input())\nt,a = map(int, input().split( ))\nh = list(map(int, input().split( )))\nans=int(0)\nc1 = int(0)\nc2 = int(1000000000)\nfor i in range(n):\n c1 = a-(t-(h[i]*0.0006))\n c1 = abs(c1)\n if c1 <= c2:\n ans = i+1\n c2 = c1\nprint(ans)', 'n = int(input())\nt,a = map(int, input().split( ))\nh = list(map(int, input().split( )))\nans=int(0)\nc1 = int(0)\nc2 = int(1000000000)\nfor i in range(n):\n c1 = a-(t-(h[i]*0.0006))\n c1 = abs(c1)\n print("c1",c1)\n if c1 <= c2:\n ans = i+1\n c2 = c1\nprint(ans)', 'n = int(input())\nt,a = map(float, input().split( ))\nh = list(map(float, input().split( )))\nans= float(0)\nc1 = float(0)\nc2 = float(100000000000000)\nfor i in range(n):\n c1 = a-(t-(h[i]*0.006))\n c1 = abs(c1)\n if c1 <= c2:\n ans = i+1\n c2 = c1\nprint(ans)']
|
['Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Accepted']
|
['s114051763', 's130884391', 's596157281', 's013774461']
|
[3064.0, 3064.0, 3316.0, 3064.0]
|
[18.0, 19.0, 20.0, 18.0]
|
[264, 253, 272, 272]
|
p03220
|
u823885866
| 2,000
| 1,048,576
|
A country decides to build a palace. In this country, the average temperature of a point at an elevation of x meters is T-x \times 0.006 degrees Celsius. There are N places proposed for the place. The elevation of Place i is H_i meters. Among them, Princess Joisino orders you to select the place whose average temperature is the closest to A degrees Celsius, and build the palace there. Print the index of the place where the palace should be built. It is guaranteed that the solution is unique.
|
["import sys\nimport math\nimport itertools\nimport collections\nimport heapq\nimport re\nimport numpy as np\n\nrr = lambda: sys.stdin.readline().rstrip()\nrs = lambda: sys.stdin.readline().split()\nri = lambda: int(sys.stdin.readline())\nrm = lambda: map(int, sys.stdin.readline().split())\nrl = lambda: list(map(int, sys.stdin.readline().split()))\ninf = float('inf')\nmod = 10**9 + 7\n\nn = ri()\nt, a = rm()\nansv = 0\nansi = 0\nfor i, v in enumerate(rl()):\n if abs(a-t+v*0.006) < ansv:\n ansv = abs(a-t+v*0.006)\n ansi = i+1\nprint(ansi)\n \n \n\n\n\n\n\n\n\n\n", "import sys\nimport math\nimport itertools\nimport collections\nimport heapq\nimport re\nimport numpy as np\n\nrr = lambda: sys.stdin.readline().rstrip()\nrs = lambda: sys.stdin.readline().split()\nri = lambda: int(sys.stdin.readline())\nrm = lambda: map(int, sys.stdin.readline().split())\nrl = lambda: list(map(int, sys.stdin.readline().split()))\ninf = float('inf')\nmod = 10**9 + 7\n\nn = ri()\nt, a = rm()\nansv = inf\nansi = 0\nfor i, v in enumerate(rl()):\n if abs(a-t+v*0.006) < ansv:\n ansv = abs(a-t+v*0.006)\n ansi = i+1\nprint(ansi)\n \n \n\n\n\n\n\n\n\n\n"]
|
['Wrong Answer', 'Accepted']
|
['s654489344', 's947016590']
|
[27144.0, 27092.0]
|
[118.0, 113.0]
|
[541, 543]
|
p03220
|
u826557401
| 2,000
| 1,048,576
|
A country decides to build a palace. In this country, the average temperature of a point at an elevation of x meters is T-x \times 0.006 degrees Celsius. There are N places proposed for the place. The elevation of Place i is H_i meters. Among them, Princess Joisino orders you to select the place whose average temperature is the closest to A degrees Celsius, and build the palace there. Print the index of the place where the palace should be built. It is guaranteed that the solution is unique.
|
['n = int(input())\nt, a = map(int, input().split())\nh_list = list(map(int,input().split()))\n\ntemp_list=[]\n\nfor h in h_list:\n\ttemp_list.append(abs(a-t-h*0.006))\nprint(temp_list.index(max(temp_list)) + 1)', 'n = int(input())\nt, a = map(int, input().split())\nh_list = list(map(int,input().split()))\n\ntemp_list=[]\n\nfor h in h_list:\n\ttemp_list.append(abs(t-h*0.006-a))\n\nprint(temp_list.index(min(temp_list)))', 'n = int(input())\nt, a = map(int, input().split())\nh_list = list(map(int,input().split()))\n\ntemp_list=[]\n\nfor h in h_list:\n\ttemp_list.append(abs(t-h*0.006-a))\n\nprint(temp_list.index(min(temp_list)) + 1)']
|
['Wrong Answer', 'Wrong Answer', 'Accepted']
|
['s705708720', 's831543662', 's950071577']
|
[3060.0, 3060.0, 3060.0]
|
[19.0, 18.0, 18.0]
|
[200, 197, 201]
|
p03220
|
u829796346
| 2,000
| 1,048,576
|
A country decides to build a palace. In this country, the average temperature of a point at an elevation of x meters is T-x \times 0.006 degrees Celsius. There are N places proposed for the place. The elevation of Place i is H_i meters. Among them, Princess Joisino orders you to select the place whose average temperature is the closest to A degrees Celsius, and build the palace there. Print the index of the place where the palace should be built. It is guaranteed that the solution is unique.
|
['N = int(input())\nT,A = map(int,input().split())\nH = map(int,input().split())\nx = (A-T)/0.006\ndiff = float("inf")\nret = 0\nfor i,h in enumerate(H):\n if abs(h - x) < diff:\n diff = abs(h-x)\n ret = i\nprint(ret)', 'N = int(input())\nT,A = map(int,input().split())\nH = map(int,input().split())\n#x = (A-T)/0.006\ndiff = float("inf")\nret = 0\nfor i,h in enumerate(H):\n if abs(T-h*0.006-A) < diff:\n diff = abs(T-h*0.006-A)\n ret = i\nprint(ret+1)']
|
['Wrong Answer', 'Accepted']
|
['s121080736', 's020436005']
|
[3064.0, 3060.0]
|
[18.0, 18.0]
|
[212, 229]
|
p03220
|
u835482198
| 2,000
| 1,048,576
|
A country decides to build a palace. In this country, the average temperature of a point at an elevation of x meters is T-x \times 0.006 degrees Celsius. There are N places proposed for the place. The elevation of Place i is H_i meters. Among them, Princess Joisino orders you to select the place whose average temperature is the closest to A degrees Celsius, and build the palace there. Print the index of the place where the palace should be built. It is guaranteed that the solution is unique.
|
["def temp(t, x):\n return t - x * 0.006\n\n\nn = int(input())\nt, a = map(int, input().split())\nhs = list(map(int, input().split()))\n\nindex = None\nmin_diff = float('inf')\nfor i in range(n):\n diff = abs(temp(t, hs[i]) - a)\n if diff < min_diff:\n diff = min_diff\n index = i\nprint(i + 1)\n", '\n\n\ndef temp(T, x, A):\n return abs(A - (T - 0.006 * x))\n\nN = int(input())\nT, A = map(int, input().split())\nH = map(int, input().split())\n\nmin_diff = temp(T, H[0], A)\nanswer = 0\nfor i in range(1, N):\n diff = temp(T, H[i], A)\n if diff < min_diff:\n answer = i\n min_diff = diff\nprint(answer)\n', "def temp(t, x):\n return t - x * 0.006\n\n\nn = int(input())\nt, a = map(int, input().split())\nhs = list(map(int, input().split()))\n\nindex = None\nmin_diff = float('inf')\nfor i in range(n):\n diff = abs(temp(t, hs[i]) - a)\n if diff < min_diff:\n min_diff = diff\n index = i\nprint(index + 1)\n\n"]
|
['Wrong Answer', 'Runtime Error', 'Accepted']
|
['s452892685', 's574548660', 's206427633']
|
[3064.0, 3060.0, 3060.0]
|
[19.0, 17.0, 18.0]
|
[301, 361, 306]
|
p03220
|
u842170774
| 2,000
| 1,048,576
|
A country decides to build a palace. In this country, the average temperature of a point at an elevation of x meters is T-x \times 0.006 degrees Celsius. There are N places proposed for the place. The elevation of Place i is H_i meters. Among them, Princess Joisino orders you to select the place whose average temperature is the closest to A degrees Celsius, and build the palace there. Print the index of the place where the palace should be built. It is guaranteed that the solution is unique.
|
['N=input()\nT,A=map(int,input().split())\nH=[abs(T-0.006*x-A) for x in map(int,input().split())]\nprint(H)\nprint(H.index(min(H))+1)', 'N=input()\nT,A=map(int,input().split())\nH=[abs(T-0.006*x-A) for x in map(int,input().split())]\nprint(H.index(min(H))+1)']
|
['Wrong Answer', 'Accepted']
|
['s894588054', 's605686487']
|
[3060.0, 3060.0]
|
[18.0, 18.0]
|
[127, 118]
|
p03220
|
u843032026
| 2,000
| 1,048,576
|
A country decides to build a palace. In this country, the average temperature of a point at an elevation of x meters is T-x \times 0.006 degrees Celsius. There are N places proposed for the place. The elevation of Place i is H_i meters. Among them, Princess Joisino orders you to select the place whose average temperature is the closest to A degrees Celsius, and build the palace there. Print the index of the place where the palace should be built. It is guaranteed that the solution is unique.
|
['N=int(input())\nT,A=map(float,input().split())\nH=list(map(float,input().split()))\nd=[]\nfor i in H:\n d.append(abs(T-i*0.006))\nprint(d.index(min(d))+1)', 'N=int(input())\nT,A=map(float,input().split())\nH=list(map(float,input().split()))\nd=[]\nfor i in H:\n d.append(abs(A-(T-i*0.006)))\nprint(d.index(min(d))+1)']
|
['Wrong Answer', 'Accepted']
|
['s555248894', 's251374855']
|
[9220.0, 9160.0]
|
[29.0, 29.0]
|
[149, 153]
|
p03220
|
u846226907
| 2,000
| 1,048,576
|
A country decides to build a palace. In this country, the average temperature of a point at an elevation of x meters is T-x \times 0.006 degrees Celsius. There are N places proposed for the place. The elevation of Place i is H_i meters. Among them, Princess Joisino orders you to select the place whose average temperature is the closest to A degrees Celsius, and build the palace there. Print the index of the place where the palace should be built. It is guaranteed that the solution is unique.
|
['N = int(input())\nT,A = map(int,input().split())\n\nH=list(map(int,input().split()))\n\nx = (T - A)/6*1000\nout = 10000000\n\nfor i in range(len(H)):\n if out > abs( x - H[i]):\n out = H[i]\n O = i+1\n\nprint(O)\n', 'N = int(input())\nT,A = map(int,input().split())\n\nH=list(map(int,input().split()))\n\nout = 10000000\n\nfor i in range(len(H)):\n now = abs( A - (T-(H[i]*0.006)))\n if out > now:\n out = now\n O = i+1\n\nprint(O)\n']
|
['Wrong Answer', 'Accepted']
|
['s272854583', 's360095807']
|
[3060.0, 3060.0]
|
[19.0, 18.0]
|
[216, 222]
|
p03220
|
u850390157
| 2,000
| 1,048,576
|
A country decides to build a palace. In this country, the average temperature of a point at an elevation of x meters is T-x \times 0.006 degrees Celsius. There are N places proposed for the place. The elevation of Place i is H_i meters. Among them, Princess Joisino orders you to select the place whose average temperature is the closest to A degrees Celsius, and build the palace there. Print the index of the place where the palace should be built. It is guaranteed that the solution is unique.
|
['N = int(input())\nT, A = map(int, input().split())\nH = list(map(int, input().split()))\n\nmin_diff = 100000\ncounter = 0\nfor i in range(N):\n diff = abs(A - T + H[i] * 0.006)\n if diff < min_diff:\n counter = i + 1\n\nprint(counter)', 'N = int(input())\nT, A = map(int, input().split())\nH = list(map(int, input().split()))\n\nmin_diff = 100000\ncounter = 0\nfor i in range(N):\n diff = abs(A - T + H[i] * 0.006)\n if diff < min_diff:\n counter = i + 1\n min_diff = diff\n\nprint(counter)']
|
['Wrong Answer', 'Accepted']
|
['s828344503', 's093260920']
|
[3064.0, 3060.0]
|
[19.0, 18.0]
|
[236, 260]
|
p03220
|
u850997975
| 2,000
| 1,048,576
|
A country decides to build a palace. In this country, the average temperature of a point at an elevation of x meters is T-x \times 0.006 degrees Celsius. There are N places proposed for the place. The elevation of Place i is H_i meters. Among them, Princess Joisino orders you to select the place whose average temperature is the closest to A degrees Celsius, and build the palace there. Print the index of the place where the palace should be built. It is guaranteed that the solution is unique.
|
["N = int(input())\ninput2 = input()\nt,a = input2.split(' ')\nT = int(t)\nA = int(a)\ninput3 = input()\nH = list(map(int,input3.split(' ')))\n\nanswer = 0\nmin = 0\nfor i in range(N):\n heikin = T - H[i] * 0.0006\n if i != 0:\n if min > abs(A - heikin):\n min = abs(A - heikin)\n answer = i + 1\n else:\n min = abs(A - heikin)\n answer = 1\nprint(answer)", "N = int(input())\ninput2 = input()\nt,a = input2.split(' ')\nT = int(t)\nA = int(a)\ninput3 = input()\nH = list(map(int,input3.split(' ')))\n\nanswer = 0\nmin = 0\nfor i in range(N):\n heikin = T - H[i] * 0.006\n \n \n #print(min)\n if i != 0:\n if min > abs(A - heikin):\n min = abs(A - heikin)\n answer = i + 1\n else:\n min = abs(A - heikin)\n answer = 1\nprint(answer)\n"]
|
['Wrong Answer', 'Accepted']
|
['s398947921', 's454634622']
|
[3064.0, 3064.0]
|
[18.0, 18.0]
|
[386, 449]
|
p03220
|
u854550470
| 2,000
| 1,048,576
|
A country decides to build a palace. In this country, the average temperature of a point at an elevation of x meters is T-x \times 0.006 degrees Celsius. There are N places proposed for the place. The elevation of Place i is H_i meters. Among them, Princess Joisino orders you to select the place whose average temperature is the closest to A degrees Celsius, and build the palace there. Print the index of the place where the palace should be built. It is guaranteed that the solution is unique.
|
['N = int(input())\nT,A = [float(i) for i in input().split()]\nHi = [float(i) for i in input().split()]\nAve = [T - i*0.006 for i in Hi]\nResult = [abs(i) for i in Ave - A]\nprint(index(min(result)) + 1)\n', 'N = int(input())\nT,A = int(i) for i in input().split()\nHi = [int(i) for i in input().split()]\nAve = [T - i*0.006 for i in Hi]\nResult = [abs(i) for i in Ave - A]\nprint(index(min(result)) + 1)\n', 'N = int(input())\nT,A = int(i) for i in input().split()\nHi = [int(i) for i in input().split()]\nAve = T - i*0.006 for i in Hi\nResult = [abs(i) for i in (Ave - A)]\nprint(index(min(Result))+1)\n', 'N = int(input())\nT,A = int(i) for i in input().split()\nHi = [int(i) for i in input().split()]\nAve = T - i*0.006 for i in Hi\nResult = [abs(i) for i in Ave - A]\nprint(index(min(result)) + 1)\n', 'N = int(input())\nT,A = [int(i) for i in input().split()]\nHi = [int(i) for i in input().split()]\nAve = [T - i*0.006 for i in Hi]\nResult = [abs(i) for i in Ave - A]\nprint(index(min(result)) + 1)', 'N = int(input())\nT,A = [int(i) for i in input().split()]\nH = [int(i) for i in input().split()]\nsub = [0 for i in range(N)]\nfor i in range(N):\n sub[i] = abs(A - (T - 0.006*H[i]))\nprint(sub.index(min(sub))+1)']
|
['Runtime Error', 'Runtime Error', 'Runtime Error', 'Runtime Error', 'Runtime Error', 'Accepted']
|
['s255057001', 's418759550', 's554394247', 's583812796', 's930727837', 's689253545']
|
[3064.0, 2940.0, 2940.0, 2940.0, 3060.0, 3060.0]
|
[17.0, 17.0, 17.0, 17.0, 18.0, 18.0]
|
[197, 191, 189, 189, 192, 209]
|
p03220
|
u854946179
| 2,000
| 1,048,576
|
A country decides to build a palace. In this country, the average temperature of a point at an elevation of x meters is T-x \times 0.006 degrees Celsius. There are N places proposed for the place. The elevation of Place i is H_i meters. Among them, Princess Joisino orders you to select the place whose average temperature is the closest to A degrees Celsius, and build the palace there. Print the index of the place where the palace should be built. It is guaranteed that the solution is unique.
|
['N=int(input())\nT,A = map(int,input().split())\nH=list(map(float,input().split()))\ntm=0\ntem=0\nTEM = []\nTM = []\nfor h in H:\n tm=T-h*0.006\n TM.append(tm)\nfor tm in TM:\n tem=abs(tm-A)\n TEM.append(tem)\nnum = TEM.index(min(1))\nprint(num+1)', 'N=int(input())\nT,A = map(int,input().split())\nH=list(map(float,input().split()))\ntm=0\ntem=0\nTEM = []\nTM = []\nfor h in H:\n tm=T-h*0.006\n TM.append(tm)\nfor tm in TM:\n tem=abs(tm-A)\n TEM.append(tem)\nnum = TEM.index(min(TEM))\nprint(num+1)']
|
['Runtime Error', 'Accepted']
|
['s467515979', 's467302710']
|
[3064.0, 3064.0]
|
[18.0, 18.0]
|
[244, 246]
|
p03220
|
u855057563
| 2,000
| 1,048,576
|
A country decides to build a palace. In this country, the average temperature of a point at an elevation of x meters is T-x \times 0.006 degrees Celsius. There are N places proposed for the place. The elevation of Place i is H_i meters. Among them, Princess Joisino orders you to select the place whose average temperature is the closest to A degrees Celsius, and build the palace there. Print the index of the place where the palace should be built. It is guaranteed that the solution is unique.
|
['n=int(input())\nT,A=map(int,input().split())\nh=list(map(int,input().split()))\na=[]\nfor i in h:\n a.append(abs(A-(T-i*0.006)))\nprint(index(max(a))+1)', 'n=int(input())\nT,A=map(int,input().split())\nh=list(map(int,input().split()))\na=[]\nfor i in h:\n a.append(abs(A-(T-i*0.006)))\nprint(index(min(a))+1)', 'n=int(input())\nT,A=map(int,input().split())\nh=list(map(int,input().split()))\na=[]\nfor i in h:\n a.append(abs(A-(T-i*0.006)))\nprint(a.index(min(a))+1)']
|
['Runtime Error', 'Runtime Error', 'Accepted']
|
['s395475060', 's508515125', 's593441605']
|
[9140.0, 9276.0, 9192.0]
|
[25.0, 28.0, 28.0]
|
[147, 147, 149]
|
p03220
|
u855380359
| 2,000
| 1,048,576
|
A country decides to build a palace. In this country, the average temperature of a point at an elevation of x meters is T-x \times 0.006 degrees Celsius. There are N places proposed for the place. The elevation of Place i is H_i meters. Among them, Princess Joisino orders you to select the place whose average temperature is the closest to A degrees Celsius, and build the palace there. Print the index of the place where the palace should be built. It is guaranteed that the solution is unique.
|
['n = int(input())\nT, A = map(int, input().split())\nH = list(map(int, input().split()))\n\nans = 100000\naa = 0\nfor i in range(n):\n if ans >= abs((T-0.006*H[i])-A):\n ans = abs((T-0.006*H[i])-A)\n aa = i\n \nprint(i+1)', 'n = int(input())\nT, A = list(map(int, input().split(" ")))\nH = list(map(int, input().split(" ")))\n\ndef TEMP(H):\n return T - H*0.006\n\ndef AAA(H):\n return abs(A - H)\n\nH = list(map(TEMP, H))\n\nH = list(map(AAA, H))\n\nprint(H.index(min(H))+1)\n']
|
['Wrong Answer', 'Accepted']
|
['s197375093', 's739447103']
|
[9132.0, 9200.0]
|
[26.0, 30.0]
|
[233, 243]
|
p03220
|
u855985627
| 2,000
| 1,048,576
|
A country decides to build a palace. In this country, the average temperature of a point at an elevation of x meters is T-x \times 0.006 degrees Celsius. There are N places proposed for the place. The elevation of Place i is H_i meters. Among them, Princess Joisino orders you to select the place whose average temperature is the closest to A degrees Celsius, and build the palace there. Print the index of the place where the palace should be built. It is guaranteed that the solution is unique.
|
["n=int(input())\nt,a=(int(i) for i in input().split(' '))\nh=[int(i) for i in input().split(' ')]\nT=[]\nfor i in range(n):\n T[i]=t-h[i]\nindex=0\nfor i in range(n):\n if abs(T[i]-a)<abs(T[index]-a):\n index=i\nprint(index+1)", "n=int(input())\nt,a=(int(i) for i in input().split(' '))\nh=[int(i) for i in input().split(' ')]\nT=[]\nfor i in range(n):\n T=T+[t-0.0006*h[i]]\nindex=0\nfor i in range(n):\n if abs(T[i]-a)<abs(T[index]-a):\n index=i\nprint(index+1)", "n=int(input())\nt,a=(int(i) for i in input().split(' '))\nh=[int(i) for i in input().split(' ')]\nT=[]\nfor i in range(n):\n T=T+[t-0.006*h[i]]\nindex=0\nfor i in range(n):\n if abs(T[i]-a)<abs(T[index]-a):\n index=i\nprint(index+1)\n"]
|
['Runtime Error', 'Wrong Answer', 'Accepted']
|
['s445819365', 's857855663', 's437589342']
|
[3064.0, 3064.0, 3060.0]
|
[18.0, 20.0, 21.0]
|
[220, 228, 228]
|
p03220
|
u856775981
| 2,000
| 1,048,576
|
A country decides to build a palace. In this country, the average temperature of a point at an elevation of x meters is T-x \times 0.006 degrees Celsius. There are N places proposed for the place. The elevation of Place i is H_i meters. Among them, Princess Joisino orders you to select the place whose average temperature is the closest to A degrees Celsius, and build the palace there. Print the index of the place where the palace should be built. It is guaranteed that the solution is unique.
|
['n = int(input())\nt, a = list(map(int, input().split()))\nh = list(map(int, input().split()))\n\ndiff_temp = [abs(x - (a - t) / 0.006) for x in h]\nprint(h[diff_temp.index(min(diff_temp))])\n', 'n = int(input())\nt, a = list(map(int, input().split()))\nh = list(map(int, input().split()))\n\nprint(min(list(map(lambda x: [abs(t - x * 0.006 - a), h.index(x)], h)), key = lambda x:x[0]).pop() + 1)']
|
['Wrong Answer', 'Accepted']
|
['s954465256', 's195216134']
|
[3060.0, 3188.0]
|
[17.0, 25.0]
|
[185, 196]
|
p03220
|
u857070771
| 2,000
| 1,048,576
|
A country decides to build a palace. In this country, the average temperature of a point at an elevation of x meters is T-x \times 0.006 degrees Celsius. There are N places proposed for the place. The elevation of Place i is H_i meters. Among them, Princess Joisino orders you to select the place whose average temperature is the closest to A degrees Celsius, and build the palace there. Print the index of the place where the palace should be built. It is guaranteed that the solution is unique.
|
['s=input()\nd=[]\nfor i in range(len(s)-2):\n\td.append(int(s[i:i+3]))\nans=[abs(j-753) for j in d]\nprint(min(ans))', 'n=int(input())\nt,a=map(int,input().split())\n*h,=map(int,input().split())\ntmp=[]\nfor i in h:\n\ttmp.append(t-h*0.006)\ntmp_abs=[abs(j-a) for j in tmp]\nprint(tmp_abs.index(min(tmp_abs))+1)', 'n=int(input())\nt,a=map(int,input().split())\n*h,=map(int,input().split())\ntmp=[]\nfor i in h:\n\ttmp.append(t-i*0.006)\ntmp_abs=[abs(j-a) for j in tmp]\nprint(tmp_abs.index(min(tmp_abs))+1)']
|
['Runtime Error', 'Runtime Error', 'Accepted']
|
['s204384004', 's225498994', 's310303222']
|
[3060.0, 3064.0, 3060.0]
|
[17.0, 18.0, 17.0]
|
[109, 183, 183]
|
p03220
|
u857428111
| 2,000
| 1,048,576
|
A country decides to build a palace. In this country, the average temperature of a point at an elevation of x meters is T-x \times 0.006 degrees Celsius. There are N places proposed for the place. The elevation of Place i is H_i meters. Among them, Princess Joisino orders you to select the place whose average temperature is the closest to A degrees Celsius, and build the palace there. Print the index of the place where the palace should be built. It is guaranteed that the solution is unique.
|
['\nN=int(input())\nT,A=pin()\nc=(T-A)/0.006\nHH=[abs(h-c) for h in pin()]\n#print(c,HH)\nprint(HH.index(min(HH))+1)', '\ndef pin(type=int):\n return map(type,input().split())\n\n"""\n\n"""\n#solution:\n\nN=int(input())\nT,A=pin()\nH=[i for i in pin()]\nc=(T-A)/0.006\nHH=[abs(h-c) for h in H]\n#print(c,HH)\nprint(HH.index(min(HH))+1)']
|
['Runtime Error', 'Accepted']
|
['s564404977', 's195883911']
|
[3060.0, 3064.0]
|
[17.0, 18.0]
|
[128, 333]
|
p03220
|
u857652299
| 2,000
| 1,048,576
|
A country decides to build a palace. In this country, the average temperature of a point at an elevation of x meters is T-x \times 0.006 degrees Celsius. There are N places proposed for the place. The elevation of Place i is H_i meters. Among them, Princess Joisino orders you to select the place whose average temperature is the closest to A degrees Celsius, and build the palace there. Print the index of the place where the palace should be built. It is guaranteed that the solution is unique.
|
['# your code goes here\nn=int(input())\na,b=map(int,input().split())\nc=list(map(int,input().split()))\nmi=(10000000000,-1)\nfor i in range(len(c)):\n\tmi=min(mi,(abs(a-c[i]*0.006),i))\nprint(mi[1]+1)\n\t', '# your code goes here\nn=int(input())\na,b=map(int,input().split())\nc=list(map(int,input().split()))\nmi=(10000000000,-1)\nfor i in range(len(c)):\n\tmi=min(mi,(abs(a-c[i]*0.006-b),i))\nprint(mi[1]+1)\n\t']
|
['Wrong Answer', 'Accepted']
|
['s842141499', 's890269964']
|
[3060.0, 3060.0]
|
[18.0, 18.0]
|
[193, 195]
|
p03220
|
u859897687
| 2,000
| 1,048,576
|
A country decides to build a palace. In this country, the average temperature of a point at an elevation of x meters is T-x \times 0.006 degrees Celsius. There are N places proposed for the place. The elevation of Place i is H_i meters. Among them, Princess Joisino orders you to select the place whose average temperature is the closest to A degrees Celsius, and build the palace there. Print the index of the place where the palace should be built. It is guaranteed that the solution is unique.
|
['ans=10**18\nn=int(input())\nt,a=map(int,input().split())\nfor i in map(int,input().split()):\n b=t-i*0.006\n if abs(ans-a)>abs(b-a):\n ans=b\n \nprint(ans)', 'n=int(input())\nt,a=map(int,input().split())\nans=1\nb=10**5\nh=list(map(int,input().split()))\nfor i in range(n):\n if abs(b-a)>abs(t-h[i]*0.006-a):\n b=t-h[i]*0.006\n ans=i+1\nprint(ans)']
|
['Wrong Answer', 'Accepted']
|
['s482704357', 's385335360']
|
[3060.0, 3060.0]
|
[18.0, 18.0]
|
[155, 186]
|
p03220
|
u862412671
| 2,000
| 1,048,576
|
A country decides to build a palace. In this country, the average temperature of a point at an elevation of x meters is T-x \times 0.006 degrees Celsius. There are N places proposed for the place. The elevation of Place i is H_i meters. Among them, Princess Joisino orders you to select the place whose average temperature is the closest to A degrees Celsius, and build the palace there. Print the index of the place where the palace should be built. It is guaranteed that the solution is unique.
|
['n = int(input())\nt, a = map(int,input().split())\na *= 1000\nt *= 1000\nh = list(map(int,input().split()))\n\ndiff = 1e9\nans = 0\nfor i in range(n):\n h[i] = t - h[i] * 6\n if abs(a - h[i]) < diff:\n diff = abs(a - h[i])\n ans = i + 1\n \n print(ans)\n ', 'n = int(input())\nt, a = map(int,input().split())\na *= 1000\nt *= 1000\nh = list(map(int,input().split()))\n\ndiff = 1e9\nans = 0\nfor i in range(n):\n h[i] = t - h[i] * 6\n if abs(a - h[i]) < diff:\n diff = abs(a - h[i])\n ans = i + 1\n \nprint(ans)\n']
|
['Wrong Answer', 'Accepted']
|
['s451773747', 's510331427']
|
[3188.0, 3060.0]
|
[19.0, 18.0]
|
[251, 247]
|
p03220
|
u863841238
| 2,000
| 1,048,576
|
A country decides to build a palace. In this country, the average temperature of a point at an elevation of x meters is T-x \times 0.006 degrees Celsius. There are N places proposed for the place. The elevation of Place i is H_i meters. Among them, Princess Joisino orders you to select the place whose average temperature is the closest to A degrees Celsius, and build the palace there. Print the index of the place where the palace should be built. It is guaranteed that the solution is unique.
|
['n = int(input())\nt,a = map(int,input().split())\nh_list = list(map(int,input().split()))\n\ntemp_list = [abs((t-h*0.006)-a) for h in h_list]\nprint(temp_list)\nans = temp_list.index(min(temp_list))+1\n\nprint(ans)', 'n = int(input())\nt,a = map(int,input().split())\nh_list = list(map(int,input().split()))\n\ntemp_list = [abs((t-h*0.006)-a) for h in h_list]\nans = temp_list.index(min(temp_list))+1\n\nprint(ans)']
|
['Wrong Answer', 'Accepted']
|
['s394033271', 's764881066']
|
[3060.0, 3060.0]
|
[18.0, 18.0]
|
[206, 189]
|
p03220
|
u865413330
| 2,000
| 1,048,576
|
A country decides to build a palace. In this country, the average temperature of a point at an elevation of x meters is T-x \times 0.006 degrees Celsius. There are N places proposed for the place. The elevation of Place i is H_i meters. Among them, Princess Joisino orders you to select the place whose average temperature is the closest to A degrees Celsius, and build the palace there. Print the index of the place where the palace should be built. It is guaranteed that the solution is unique.
|
['n = int(input())\nt, a = map(int, input().split())\nl = list(map(int, input().split()))\nl2 = [t - i * 0.006 for i in l]\ndiff = a\nfor i in range(n + 1):\n if diff > abs(i - a):\n diff = abs(i - a)\n ans = i\nprint(i)\n', 'n = int(input())\nt, a = map(int, input().split())\nl = list(map(int, input().split()))\nl = list(map(lambda x: t - x * 0.006 , l))\nl = list(map(lambda x: abs(x - a), l))\nprint(l.index(min(l))+ 1)']
|
['Wrong Answer', 'Accepted']
|
['s389187290', 's491050808']
|
[3060.0, 3060.0]
|
[18.0, 18.0]
|
[227, 193]
|
p03220
|
u882100545
| 2,000
| 1,048,576
|
A country decides to build a palace. In this country, the average temperature of a point at an elevation of x meters is T-x \times 0.006 degrees Celsius. There are N places proposed for the place. The elevation of Place i is H_i meters. Among them, Princess Joisino orders you to select the place whose average temperature is the closest to A degrees Celsius, and build the palace there. Print the index of the place where the palace should be built. It is guaranteed that the solution is unique.
|
["n = int(input())\nt, a = input().split(' ')\nt = int(t)\na = int(a)\nh = input().split(' ')\n\ndiff = 100\npoint = 10000\n\nfor x in range(n):\n tmp = t - h[x] * 0.006 \n if tmp < diff:\n diff = tmp\n point = x + 1\n\nprint(point)", "n = int(input())\nt, a = input().split(' ')\nt = int(t)\na = int(a)\nh = input().split(' ')\n\ndiff = 100\npoint = 10000\n\nfor x in range(n):\n tmp = t - int(h[x]) * 0.006 \n if tmp < diff:\n diff = tmp\n point = x + 1\n\nprint(point)\n", "n = int(input())\nt, a = input().split(' ')\nt = int(t)\na = int(a)\nh = input().split(' ')\n\ndiff = 10000\npoint = 10000\n\nfor x in range(n):\n temp = t - int(h[x]) * 0.006\n tmp = abs(a - temp)\n\n if tmp < diff:\n diff = tmp\n point = x + 1\n\nprint(point)\n"]
|
['Runtime Error', 'Wrong Answer', 'Accepted']
|
['s508697799', 's749127027', 's197753609']
|
[3064.0, 3060.0, 3060.0]
|
[17.0, 18.0, 18.0]
|
[235, 241, 268]
|
p03220
|
u883048396
| 2,000
| 1,048,576
|
A country decides to build a palace. In this country, the average temperature of a point at an elevation of x meters is T-x \times 0.006 degrees Celsius. There are N places proposed for the place. The elevation of Place i is H_i meters. Among them, Princess Joisino orders you to select the place whose average temperature is the closest to A degrees Celsius, and build the palace there. Print the index of the place where the palace should be built. It is guaranteed that the solution is unique.
|
['iN = int(input())\niT,iA = [int(_) for _ in input().split()]\naH = list(map(lambda x: abs(iT-x*0.006 -iA) , [int(_) for _ in input().split()]))\nprint(aH)\niMin = min(aH)\nfor i in range(iN):\n if aH[i] == iMin :\n print(i+1)\n exit()\n', 'iN = int(input())\niT,iA = [int(_) for _ in input().split()]\naH = list(map(lambda x: abs(iT-x*0.006 -iA) , [int(_) for _ in input().split()]))\niMin = min(aH)\nfor i in range(iN):\n if aH[i] == iMin :\n print(i+1)\n exit()\n']
|
['Wrong Answer', 'Accepted']
|
['s002049992', 's141094704']
|
[3188.0, 3060.0]
|
[19.0, 19.0]
|
[244, 234]
|
p03220
|
u884323674
| 2,000
| 1,048,576
|
A country decides to build a palace. In this country, the average temperature of a point at an elevation of x meters is T-x \times 0.006 degrees Celsius. There are N places proposed for the place. The elevation of Place i is H_i meters. Among them, Princess Joisino orders you to select the place whose average temperature is the closest to A degrees Celsius, and build the palace there. Print the index of the place where the palace should be built. It is guaranteed that the solution is unique.
|
['N = int(input())\nT, A = map(int, input().split())\nH = [int(i) for i in input().split()]\n\nmin_d = 1000\nans = 0\nfor i in range(N):\n t = T - H[i] * 0.006\n d = abs(t - A)\n if d < min_d:\n min_d = d\n ans = i\n \nprint(ans)', 'N = int(input())\nT, A = map(int, input().split())\nH = [int(i) for i in input().split()]\n\nmin_d = 1000\nans = 0\nfor i in range(N):\n t = T - H[i] * 0.006\n d = abs(t - A)\n if d < min_d:\n min_d = d\n ans = i+1\nprint(ans)']
|
['Wrong Answer', 'Accepted']
|
['s425851062', 's128615350']
|
[3060.0, 3064.0]
|
[18.0, 18.0]
|
[244, 237]
|
p03220
|
u886112691
| 2,000
| 1,048,576
|
A country decides to build a palace. In this country, the average temperature of a point at an elevation of x meters is T-x \times 0.006 degrees Celsius. There are N places proposed for the place. The elevation of Place i is H_i meters. Among them, Princess Joisino orders you to select the place whose average temperature is the closest to A degrees Celsius, and build the palace there. Print the index of the place where the palace should be built. It is guaranteed that the solution is unique.
|
['N=int(input())\nT,A=map(int,input().split())\n\nH=list(map(int,input().split()))\n\nx=[]\n\nfor i in range(len(H)):\n x.append(abs(A-(T-H[i]*0.006)))\n\nprint(x)\nprint(x.index(min(x))+1)', 'N=int(input())\nT,A=map(int,input().split())\n\nH=list(map(int,input().split()))\n\nx=[]\n\nfor i in range(len(H)):\n x.append(abs(A-(T-H[i]*0.006)))\n\nprint(x.index(min(x))+1)']
|
['Wrong Answer', 'Accepted']
|
['s811996971', 's756279492']
|
[3060.0, 3060.0]
|
[19.0, 18.0]
|
[179, 170]
|
p03220
|
u886655280
| 2,000
| 1,048,576
|
A country decides to build a palace. In this country, the average temperature of a point at an elevation of x meters is T-x \times 0.006 degrees Celsius. There are N places proposed for the place. The elevation of Place i is H_i meters. Among them, Princess Joisino orders you to select the place whose average temperature is the closest to A degrees Celsius, and build the palace there. Print the index of the place where the palace should be built. It is guaranteed that the solution is unique.
|
['N = input()\nT_A = input().split()\nT = int(T_A[0])\nA = int(T_A[1])\nH_list = list(map(int, input().split()))\n\ni = 1\ni_H_list = []\nfor H in H_list:\n ave_T = T - H * 0.006\n i_H_list.append([i, abs(A - ave_T)])\n i += 1\n\nprint(i_H_list)\n\nmin_diff = -1\nmin_diff_i = -1\nfor i in range(len(H_list)):\n if min_diff > i_H_list[i][1] or min_diff == -1:\n min_diff = i_H_list[i][1]\n min_diff_i = i_H_list[i][0]\nprint(min_diff_i)\n', 'N = input()\nT_A = input().split()\nT = int(T_A[0])\nA = int(T_A[1])\nH_list = list(map(int, input().split()))\n\ni = 1\ni_H_list = []\nfor H in H_list:\n ave_T = T - H * 0.006\n i_H_list.append([i, abs(A - ave_T)])\n i += 1\n\nmin_diff = -1\nmin_diff_i = -1\nfor i in range(len(H_list)):\n if min_diff > i_H_list[i][1] or min_diff == -1:\n min_diff = i_H_list[i][1]\n min_diff_i = i_H_list[i][0]\nprint(min_diff_i)']
|
['Wrong Answer', 'Accepted']
|
['s349386062', 's071570671']
|
[3188.0, 3188.0]
|
[19.0, 18.0]
|
[440, 422]
|
p03220
|
u887207211
| 2,000
| 1,048,576
|
A country decides to build a palace. In this country, the average temperature of a point at an elevation of x meters is T-x \times 0.006 degrees Celsius. There are N places proposed for the place. The elevation of Place i is H_i meters. Among them, Princess Joisino orders you to select the place whose average temperature is the closest to A degrees Celsius, and build the palace there. Print the index of the place where the palace should be built. It is guaranteed that the solution is unique.
|
['N = int(input())\nT, A = map(int,input().split())\nH = list(map(int,input().split()))\n\ndist = {}\nfor i in range(N):\n tempra = T - H[i]*0.006\n dist[i+1] = abs(tempra - abs(A))\nprint(min(dist, key = dist.get))\nprint(dist)', 'N = int(input())\nT, A = map(int,input().split())\nH = list(map(int,input().split()))\n\nres = [abs(T-h*0.006-A) for h in H]\nprint(res.index(min(res))+1)']
|
['Wrong Answer', 'Accepted']
|
['s635804410', 's985964329']
|
[3188.0, 3060.0]
|
[19.0, 18.0]
|
[219, 149]
|
p03220
|
u893048163
| 2,000
| 1,048,576
|
A country decides to build a palace. In this country, the average temperature of a point at an elevation of x meters is T-x \times 0.006 degrees Celsius. There are N places proposed for the place. The elevation of Place i is H_i meters. Among them, Princess Joisino orders you to select the place whose average temperature is the closest to A degrees Celsius, and build the palace there. Print the index of the place where the palace should be built. It is guaranteed that the solution is unique.
|
['n = int(input())\nt, a = [int(x) for x in input().split()]\nh = [int(x) for x in input().split()]\nl = [(i, abs(a - (t - x * 0.0006))) for i, x in enumerate(h)]\ntarget = min(l, key = lambda x: x[1])\nprint(target[0]+1)', 'n = int(input())\nt, a = [int(x) for x in input().split()]\nh = [int(x) for x in input().split()]\nl = [(i, abs(a - (t - x * 0.006))) for i, x in enumerate(h)]\ntarget = min(l, key = lambda x: x[1])\nprint(target[0]+1)']
|
['Wrong Answer', 'Accepted']
|
['s465829957', 's651184139']
|
[3188.0, 3188.0]
|
[20.0, 20.0]
|
[214, 213]
|
p03220
|
u893063840
| 2,000
| 1,048,576
|
A country decides to build a palace. In this country, the average temperature of a point at an elevation of x meters is T-x \times 0.006 degrees Celsius. There are N places proposed for the place. The elevation of Place i is H_i meters. Among them, Princess Joisino orders you to select the place whose average temperature is the closest to A degrees Celsius, and build the palace there. Print the index of the place where the palace should be built. It is guaranteed that the solution is unique.
|
['# -*- coding: utf-8 -*- \n\nN = int(input())\nT, A = map(int, input().split())\nH = list(map(int, input().split()))\n\nmin_i =\t0\nmin_temp = abs(T - H[0] * 0.006 - A)\n\nfor i in range(1, N):\n if abs(T-H[i]*0.006-A) < min_temp:\n\tmin_temp = abs(T-H[i]*0.006-A)\n min_i =\ti\n\nprint(min_i+1)\n', '# -*- coding: utf-8 -*- \n\nN = int(input())\nT, A = map(int, input().split())\nH = list(map(int, input().split()))\n\nmin_i =\t0\nmin_temp = abs(T - H[0] * 0.006 - A)\n\nfor i in range(1, N):\n if abs(T-H[i]*0.006-A) < min_temp:\n\tmin_temp = abs(T-H[i]*0.006-A)\n min_i =\ti\n\nprint(min_i+1)\n', 'N = int(input())\nT, A = map(int, input().split())\nH = list(map(int, input().split()))\n\nmin_i =\t0\nmin_temp = abs(T - H[0] * 0.006 - A)\n\nfor i in range(1, N):\n if abs(T-H[i]*0.006-A) < min_temp:\n\tmin_temp = abs(T-H[i]*0.006-A)\n min_i =\ti\n\nprint(min_i+1)\n', '# -*- coding: utf-8 -*- \n\nN = int(input())\nT, A = map(int, input().split())\n\nimport numpy as\tnp\n\nans = (T-A) / 0.006\n\nh = np.abs(np.array(list(map(int, input().split()))) - ans)\n\nprint(np.argmin(h) + 1)\n\t\n']
|
['Runtime Error', 'Runtime Error', 'Runtime Error', 'Accepted']
|
['s290932780', 's376336336', 's722504503', 's660410024']
|
[3188.0, 3188.0, 3188.0, 12488.0]
|
[18.0, 18.0, 18.0, 151.0]
|
[365, 365, 262, 282]
|
p03220
|
u896451538
| 2,000
| 1,048,576
|
A country decides to build a palace. In this country, the average temperature of a point at an elevation of x meters is T-x \times 0.006 degrees Celsius. There are N places proposed for the place. The elevation of Place i is H_i meters. Among them, Princess Joisino orders you to select the place whose average temperature is the closest to A degrees Celsius, and build the palace there. Print the index of the place where the palace should be built. It is guaranteed that the solution is unique.
|
['def MAP(): return list(map(int,input().split()))\ndef INT(): return int(input())\ndef FLOAT(): return float(input())\nMOD = 10**9+7\n\nn = INT()\nt,a = MAP()\nh = MAP()\n\nres = MOD\nfor i in range(n):\n tmp = abs(a-(t-(h[i]*0.006)))\n print(tmp)\n if res>tmp:\n res = tmp\n ans = i+1\nprint(ans)\n\n', 'def MAP(): return list(map(int,input().split()))\ndef INT(): return int(input())\ndef FLOAT(): return float(input())\nMOD = 10**9+7\n\nn = INT()\nt,a = MAP()\nh = MAP()\n\nres = MOD\nfor i in range(n):\n tmp = abs(a-(t-(h[i]*0.006)))\n if res>tmp:\n res = tmp\n ans = i+1\nprint(ans)\n\n']
|
['Wrong Answer', 'Accepted']
|
['s065093526', 's404160102']
|
[3188.0, 3188.0]
|
[19.0, 20.0]
|
[305, 290]
|
p03220
|
u897302879
| 2,000
| 1,048,576
|
A country decides to build a palace. In this country, the average temperature of a point at an elevation of x meters is T-x \times 0.006 degrees Celsius. There are N places proposed for the place. The elevation of Place i is H_i meters. Among them, Princess Joisino orders you to select the place whose average temperature is the closest to A degrees Celsius, and build the palace there. Print the index of the place where the palace should be built. It is guaranteed that the solution is unique.
|
['N = int(raw_inpit())\nT, A = map(int, raw_input().split())\nHs = list(map(int, raw_input().split()))\n\nTs = list(map(lambda x: T-x * 0.006), Hs)\n\ni = 0\nv = 0\nfor _i, _T in enumerate(Ts):\n if abs(_T-T) < v:\n v = abs(_T-T)\n i = _i\n\nprint(i)\n', 'N = int(raw_inpit())\nT, A = map(int, raw_input().split())\nHs = list(map(int, raw_input().split()))\n\nTs = list(map(lambda x: T-x * 0.006), Hs)\n\ni = 0\nv = 0\nfor _i, _T in enumerate(Ts):\n if abs(_T-T) < v:\n v = abs(_T-T)\n i = _i\n\nprint(i+1)\n', 'N = int(input())\nT, A = map(int, input().split())\nHs = list(map(int, input().split()))\n\nTs = list(map(lambda x: T-x * 0.006, Hs))\n\ni = 0\nv = None\nfor _i, _T in enumerate(Ts):\n print(v) \n if v is None or abs(_T-T) < v:\n v = abs(_T-T)\n i = _i\n\nprint(i+1)', 'N = int(input())\nT, A = map(int, input().split())\nHs = list(map(int, input().split()))\n\nTs = list(map(lambda x: T-x * 0.006), Hs)\n\ni = 0\nv = 0\nfor _i, _T in enumerate(Ts):\n if abs(_T-T) < v:\n v = abs(_T-T)\n i = _i\n\nprint(i+1)', 'N = int(input())\nT, A = map(int, input().split())\nHs = list(map(int, input().split()))\n\nTs = list(map(lambda x: T-x * 0.006, Hs))\n\ni = 0\nv = None\nfor _i, _T in enumerate(Ts):\n if v is None or abs(_T-A) < v:\n v = abs(_T-A)\n i = _i\n\nprint(i+1)']
|
['Runtime Error', 'Runtime Error', 'Wrong Answer', 'Runtime Error', 'Accepted']
|
['s117051387', 's558382488', 's622235607', 's763095496', 's503293149']
|
[3060.0, 3060.0, 3316.0, 3064.0, 3188.0]
|
[18.0, 17.0, 20.0, 19.0, 18.0]
|
[253, 255, 275, 242, 258]
|
p03220
|
u898967808
| 2,000
| 1,048,576
|
A country decides to build a palace. In this country, the average temperature of a point at an elevation of x meters is T-x \times 0.006 degrees Celsius. There are N places proposed for the place. The elevation of Place i is H_i meters. Among them, Princess Joisino orders you to select the place whose average temperature is the closest to A degrees Celsius, and build the palace there. Print the index of the place where the palace should be built. It is guaranteed that the solution is unique.
|
['n = int(input())\nt,a = map(int,input().split())\nh= list(map(int,input().split()))\n\nmin_diff = 10**10\nans = 0\nfor i in range(n):\n temp = abs(a - (t - h[i]*0.006))\n print(temp)\n if min_diff > temp:\n min_diff = temp\n ans = i+1\nprint(ans) ', 'n = int(input())\nt,a = map(int,input().split())\nh= list(map(int,input().split()))\n\nmin_diff = 10**10\nans = 0\nfor i in range(n):\n temp = abs(a - (t - h[i]*0.006)) \n if min_diff > temp:\n min_diff = temp\n ans = i+1\nprint(ans) ']
|
['Wrong Answer', 'Accepted']
|
['s053878263', 's533207478']
|
[3188.0, 3060.0]
|
[19.0, 18.0]
|
[247, 235]
|
p03220
|
u903596281
| 2,000
| 1,048,576
|
A country decides to build a palace. In this country, the average temperature of a point at an elevation of x meters is T-x \times 0.006 degrees Celsius. There are N places proposed for the place. The elevation of Place i is H_i meters. Among them, Princess Joisino orders you to select the place whose average temperature is the closest to A degrees Celsius, and build the palace there. Print the index of the place where the palace should be built. It is guaranteed that the solution is unique.
|
['N=int(input())\nT,A=map(int,input().split())\nH=[int(x) for x in input().split()]\ns=float("inf")\nj=0\nfor i in range(N):\n tempgap=abs(T-H[i]*0.006-A)\n if tempgap<s:\n s,j=tempgap,i\nprint(i+1)\n ', 'N=int(input())\nT,A=map(int,input().split())\nH=[int(x) for x in input().split()]\ns=float("inf")\nj=0\nfor i in range(N):\n tempgap=abs(T-H[i]*0.006-A)\n if tempgap<s:\n s,j=tempgap,i\nprint(j+1)\n ']
|
['Wrong Answer', 'Accepted']
|
['s312816709', 's513411046']
|
[3060.0, 3060.0]
|
[18.0, 19.0]
|
[195, 195]
|
p03220
|
u905582793
| 2,000
| 1,048,576
|
A country decides to build a palace. In this country, the average temperature of a point at an elevation of x meters is T-x \times 0.006 degrees Celsius. There are N places proposed for the place. The elevation of Place i is H_i meters. Among them, Princess Joisino orders you to select the place whose average temperature is the closest to A degrees Celsius, and build the palace there. Print the index of the place where the palace should be built. It is guaranteed that the solution is unique.
|
['N=int(input())\nt,a=map(int,input().split())\nH=list(map(int,input().split()))\njudge=10**18\nfor i,h in enumerate(H):\n if abs(a-(t-0.006*h)) < judge:\n ans=i\n judge=abs(a-(t-0.006*h))\n\nprint(ans)', 'N=int(input())\nt,a=map(int,input().split())\nH=list(map(int,input().split()))\njudge=10**18\nfor i,h in enumerate(H):\n if abs(a-(t-0.006*h)) < judge:\n ans=i+1\n judge=abs(a-(t-0.006*h))\n\nprint(ans)']
|
['Wrong Answer', 'Accepted']
|
['s153513844', 's984159008']
|
[3060.0, 3060.0]
|
[18.0, 18.0]
|
[198, 200]
|
p03220
|
u908763441
| 2,000
| 1,048,576
|
A country decides to build a palace. In this country, the average temperature of a point at an elevation of x meters is T-x \times 0.006 degrees Celsius. There are N places proposed for the place. The elevation of Place i is H_i meters. Among them, Princess Joisino orders you to select the place whose average temperature is the closest to A degrees Celsius, and build the palace there. Print the index of the place where the palace should be built. It is guaranteed that the solution is unique.
|
['N = input()\nT,A = input().split()\nH = list(map(lambda x: abs(T - int(x) * 0.006 - A),input().split()))\nprint(H.index(min(H))+1)', 'N = input()\nT,A = input().split()\nH = list(map(lambda x: abs(T - int(x) * 0.006 - A),input().split()))\nprint(H.index(min(H))+1)', 'N = input()\nT,A = int(input().split())\nH = list(map(lambda x: abs(T - int(x) * 0.006 - A),input().split()))\nprint(H.index(min(H))+1)', 'N = input()\nT,A = input().split()\nH = map(lambda x: abs(T - x * 0.006 - A),input().split())\nprint(min(H))', 'N = input()\nT,A = input().split()\nH = list(map(lambda x: abs(T - x * 0.006 - A),input().split()))\nprint(H.index(min(H))+1)', 'N = input()\nT,A = map(int,input().split())\nH = list(map(lambda x: abs(T - int(x) * 0.006 - A),input().split()))\nprint(H.index(min(H))+1)']
|
['Runtime Error', 'Runtime Error', 'Runtime Error', 'Runtime Error', 'Runtime Error', 'Accepted']
|
['s248414300', 's346724317', 's633840832', 's736904466', 's769699149', 's596695371']
|
[3060.0, 3060.0, 2940.0, 3060.0, 3060.0, 3060.0]
|
[18.0, 17.0, 17.0, 18.0, 17.0, 20.0]
|
[127, 127, 132, 105, 122, 136]
|
p03220
|
u909162870
| 2,000
| 1,048,576
|
A country decides to build a palace. In this country, the average temperature of a point at an elevation of x meters is T-x \times 0.006 degrees Celsius. There are N places proposed for the place. The elevation of Place i is H_i meters. Among them, Princess Joisino orders you to select the place whose average temperature is the closest to A degrees Celsius, and build the palace there. Print the index of the place where the palace should be built. It is guaranteed that the solution is unique.
|
['n = int(input())\nta = list(map(int, input().split()))\nt = ta[0]\na = ta[1]\nh = list(map(int, input().split()))\nmind = 10**6\nans = 0\nfor i in range(n):\n d = t - h[i] * 0.006\n if abs(d - a) < mind:\n mind = abs(d - a)\n ans = i + 1\n print(d -a,mind)\nprint(ans)', 'n = int(input())\nta = list(map(int, input().split()))\nt = ta[0]\na = ta[1]\nh = list(map(int, input().split()))\nmind = 10**6\nans = 0\nfor i in range(n):\n d = t - h[i] * 0.006\n if abs(d - a) < mind:\n mind = abs(d - a)\n ans = i + 1\nprint(ans)']
|
['Wrong Answer', 'Accepted']
|
['s463553325', 's889745215']
|
[3316.0, 3064.0]
|
[36.0, 18.0]
|
[278, 257]
|
p03220
|
u911153222
| 2,000
| 1,048,576
|
A country decides to build a palace. In this country, the average temperature of a point at an elevation of x meters is T-x \times 0.006 degrees Celsius. There are N places proposed for the place. The elevation of Place i is H_i meters. Among them, Princess Joisino orders you to select the place whose average temperature is the closest to A degrees Celsius, and build the palace there. Print the index of the place where the palace should be built. It is guaranteed that the solution is unique.
|
["import bisect\n\n\ndef palace():\n def average_temperature(height):\n return t - (height * 0.006)\n \n def get_key_from_value(dict, value):\n for k, v in dict.items():\n if v == value:\n return k\n \n n = int(input())\n t, a = map(float, input().split())\n \n h = list(map(int, input().split()))\n h_dict = {}\n for i in range(n):\n h_dict[i + 1] = average_temperature(h[i])\n \n h_sorted = sorted(h, reverse=True)\n temperatures = [average_temperature(height) for height in h_sorted]\n \n index = bisect.bisect_left(temperatures, a)\n if index - 1 >= 0 and index <= n - 1:\n print('a')\n choices = [temperatures[index - 1], temperatures[index]]\n abses = [abs(a - choices[0]), abs(a - choices[1])]\n if abses[0] >= abses[1]:\n print(get_key_from_value(h_dict, choices[1]))\n else:\n print(get_key_from_value(h_dict, choices[0]))\n else:\n if index - 1 >= 0:\n print('b')\n choice = temperatures[index - 1]\n print(get_key_from_value(h_dict, choice))\n if index <= n - 1:\n print('c')\n choice = temperatures[index + 1]\n print(get_key_from_value(h_dict, choice))\n\n\nif __name__ == '__main__':\n palace()\n", "import bisect\n\n\ndef palace():\n def average_temperature(height):\n return t - (height * 0.006)\n \n def get_key_from_value(dict, value):\n for k, v in dict.items():\n if v == value:\n return k\n \n n = int(input())\n t, a = map(float, input().split())\n \n h = list(map(int, input().split()))\n h_dict = {}\n for i in range(n):\n h_dict[i + 1] = average_temperature(h[i])\n \n h_sorted = sorted(h, reverse=True)\n temperatures = [average_temperature(height) for height in h_sorted]\n \n index = bisect.bisect_left(temperatures, a)\n if index - 1 >= 0 and index <= n - 1:\n choices = [temperatures[index - 1], temperatures[index]]\n abses = [abs(a - choices[0]), abs(a - choices[1])]\n if abses[0] >= abses[1]:\n print(get_key_from_value(h_dict, choices[1]))\n else:\n print(get_key_from_value(h_dict, choices[0]))\n else:\n if index - 1 >= 0:\n choice = temperatures[index - 1]\n print(get_key_from_value(h_dict, choice))\n if index <= n - 1:\n choice = temperatures[index + 1]\n print(get_key_from_value(h_dict, choice))\n\n\nif __name__ == '__main__':\n palace()\n"]
|
['Wrong Answer', 'Accepted']
|
['s267000537', 's139130399']
|
[3188.0, 3188.0]
|
[20.0, 19.0]
|
[1301, 1236]
|
p03220
|
u919633157
| 2,000
| 1,048,576
|
A country decides to build a palace. In this country, the average temperature of a point at an elevation of x meters is T-x \times 0.006 degrees Celsius. There are N places proposed for the place. The elevation of Place i is H_i meters. Among them, Princess Joisino orders you to select the place whose average temperature is the closest to A degrees Celsius, and build the palace there. Print the index of the place where the palace should be built. It is guaranteed that the solution is unique.
|
['n=int(input())\nt,a=map(int,input().split())\nh=[abs((t-int(i)*0.006)-a) for i in open(0).readline().split()]\nprint(h.index(min(h))+1)', 'n=int(input())\nt,a=map(int,input().split())\nh=[abs((t-int(i)*6/1000)-a) for i in input().split()]\nprint(h.index(min(h))+1)']
|
['Runtime Error', 'Accepted']
|
['s627379588', 's133824481']
|
[3188.0, 3060.0]
|
[17.0, 18.0]
|
[132, 122]
|
p03220
|
u923279197
| 2,000
| 1,048,576
|
A country decides to build a palace. In this country, the average temperature of a point at an elevation of x meters is T-x \times 0.006 degrees Celsius. There are N places proposed for the place. The elevation of Place i is H_i meters. Among them, Princess Joisino orders you to select the place whose average temperature is the closest to A degrees Celsius, and build the palace there. Print the index of the place where the palace should be built. It is guaranteed that the solution is unique.
|
['n=int(input())\nt,a=map(int,input().split())\nh=list(map(int,input().split()))\na=abs(t-a-h[0]*0.006)\nans=0\nfor i in range(1,n):\n if a>abs(t-a-h[i]*0.006):\n a=abs(t-a-h[i]*0.006)\n ans=i\nprint(i+1)', 'n=int(input())\nt,a=map(int,input().split())\nh=list(map(int,input().split()))\nb=abs(t-a-h[0]*0.006)\nans=0\nfor i in range(1,n):\n if b>abs(t-a-h[i]*0.006):\n b=abs(t-a-h[i]*0.006)\n ans=i\nprint(ans+1)']
|
['Wrong Answer', 'Accepted']
|
['s149928849', 's771502576']
|
[3060.0, 3064.0]
|
[18.0, 18.0]
|
[210, 212]
|
p03220
|
u923341003
| 2,000
| 1,048,576
|
A country decides to build a palace. In this country, the average temperature of a point at an elevation of x meters is T-x \times 0.006 degrees Celsius. There are N places proposed for the place. The elevation of Place i is H_i meters. Among them, Princess Joisino orders you to select the place whose average temperature is the closest to A degrees Celsius, and build the palace there. Print the index of the place where the palace should be built. It is guaranteed that the solution is unique.
|
['N = int(input())\nT, A = map(int, input().split())\nHs = list(map(int,input().split()))\nts = []\nfor H in Hs:\n ts.append(T - H * 0.006)\nmin_t = -10**6\nmin_idx = 0\nfor idx, t in enumerate(ts):\n print(idx)\n if abs(t - A) > min_t:\n min_idx = idx\nprint(min_idx+1)', 'N = int(input())\nT, A = map(int, input().split())\nHs = list(map(int,input().split()))\nts = []\nfor H in Hs:\n ts.append(T - H * 0.006)\nmin_t = 10**6\nmin_idx = 0\nfor idx, t in enumerate(ts):\n if abs(t - A) < min_t:\n min_t = abs(t - A)\n min_idx = idx\nprint(min_idx+1)']
|
['Wrong Answer', 'Accepted']
|
['s714478022', 's371756232']
|
[3316.0, 3064.0]
|
[19.0, 17.0]
|
[272, 283]
|
p03220
|
u924308178
| 2,000
| 1,048,576
|
A country decides to build a palace. In this country, the average temperature of a point at an elevation of x meters is T-x \times 0.006 degrees Celsius. There are N places proposed for the place. The elevation of Place i is H_i meters. Among them, Princess Joisino orders you to select the place whose average temperature is the closest to A degrees Celsius, and build the palace there. Print the index of the place where the palace should be built. It is guaranteed that the solution is unique.
|
['input()\nT,A=list(map(int,input().split(" ")))\nH=list(map(int,input().split(" ")))\navg=[]\nfor h in H:\n avg.append(T-h*0.006)\n#print(avg)\n\n\nmini=abs(A-avg[0])\nre=10000\nfor i in range(1,len(avg)):\n #print(abs(A-avg[i]),mini)\n if abs(A-avg[i])<mini:\n mini=abs(A-avg[i])\n #print(mini)\n re=i\nprint(re+1)\n \n \n\n \n \n\n', 'input()\nT,A=list(map(int,input().split(" ")))\nH=list(map(int,input().split(" ")))\navg=[]\nfor h in H:\n avg.append(T-h*0.006)\nprint(avg)\n\n\nmini=1000\nre=10000\nfor i in range(len(avg)):\n print(abs(A-avg[i]),mini)\n if abs(A-avg[i])<mini:\n mini=abs(A-avg[i])\n #print(mini)\n re=i\nprint(re+1)\n \n \n\n \n \n\n', 'input()\nT,A=list(map(int,input().split(" ")))\nH=list(map(int,input().split(" ")))\nX=[abs(A-(T-h*0.006)) for h in H]\n\nprint(X.index(min(X))+1) \n \n\n \n \n\n']
|
['Wrong Answer', 'Wrong Answer', 'Accepted']
|
['s351990962', 's494155092', 's016852860']
|
[3064.0, 3316.0, 3060.0]
|
[18.0, 22.0, 18.0]
|
[400, 387, 171]
|
p03220
|
u925406312
| 2,000
| 1,048,576
|
A country decides to build a palace. In this country, the average temperature of a point at an elevation of x meters is T-x \times 0.006 degrees Celsius. There are N places proposed for the place. The elevation of Place i is H_i meters. Among them, Princess Joisino orders you to select the place whose average temperature is the closest to A degrees Celsius, and build the palace there. Print the index of the place where the palace should be built. It is guaranteed that the solution is unique.
|
['a = int(input())\nx = 0\nlists = []\nass =[]\n\nb,standard = map(int,input().split())\n\nelev = list(map(int,input().split()))\n\nfor i in range(a):\n lists.append(abs(b - elev[i] * 0.006 - standard))\n print(lists)\n\nm = min(lists)\nmindex = lists.index(1.0)\nprint(mindex + 1)\n', 'import numpy as np\n\ndef getNearestValue(list, num):\n\n\n idx = np.abs(np.asarray(list) - num).argmin()\n return list[idx]\na = int(input())\nx = 0\nlists = []\n\nb,standard = map(int,input().split())\n\nelev = list(map(int,input().split()))\n\nfor i in range(a):\n lists.append(int(b - elev[i] * 0.006))\nprint(getNearestValue(lists, standard)) ', 'a = int(input())\nx = 0\nlists = []\nass =[]\n\nb,standard = map(int,input().split())\n\nelev = list(map(int,input().split()))\n\nfor i in range(a):\n lists.append(abs(b - elev[i] * 0.006 - standard))\n\nm = min(lists)\nmindex = lists.index(m)\nprint(mindex + 1)\n']
|
['Runtime Error', 'Wrong Answer', 'Accepted']
|
['s396033917', 's800655870', 's836441692']
|
[9460.0, 13532.0, 3060.0]
|
[364.0, 150.0, 18.0]
|
[326, 401, 307]
|
p03220
|
u927764913
| 2,000
| 1,048,576
|
A country decides to build a palace. In this country, the average temperature of a point at an elevation of x meters is T-x \times 0.006 degrees Celsius. There are N places proposed for the place. The elevation of Place i is H_i meters. Among them, Princess Joisino orders you to select the place whose average temperature is the closest to A degrees Celsius, and build the palace there. Print the index of the place where the palace should be built. It is guaranteed that the solution is unique.
|
['n = int(input())\nT, A = map(int,input().split())\nh = [int(i) for i in input().split()]\nmin_T = abs(T - h[0]*0.006)\ni_min = 0\n\nfor i,v in enumerate(h):\n if (min_T > abs(T - h[i]*0.006)):\n min_T = abs(T - h[i]*0.006);\n i_min = i\nprint(i_min+1)', 'n = int(input())\nT, A = map(int,input().split())\nh = [int(i) for i in input().split()]\nmin_T = abs(T - h[0]*0.006 - A)\ni_min = 0\n\nfor i,v in enumerate(h):\n if (min_T > abs(T - h[i]*0.006 - A)):\n min_T = abs(T - h[i]*0.006 - A);\n i_min = i\nprint(i_min+1)']
|
['Wrong Answer', 'Accepted']
|
['s805627059', 's852910949']
|
[3060.0, 3064.0]
|
[18.0, 18.0]
|
[258, 270]
|
p03220
|
u928784113
| 2,000
| 1,048,576
|
A country decides to build a palace. In this country, the average temperature of a point at an elevation of x meters is T-x \times 0.006 degrees Celsius. There are N places proposed for the place. The elevation of Place i is H_i meters. Among them, Princess Joisino orders you to select the place whose average temperature is the closest to A degrees Celsius, and build the palace there. Print the index of the place where the palace should be built. It is guaranteed that the solution is unique.
|
['# -*- coding: utf-8 -*-\nN = int(input())\nT,A = map(int,input().split())\nH = [int(i) for i in range(N)]\nb = []\nfor x in range(N):\n b.append(T - 0.006 * x - A)\nprint(min(b))\n ', 'n = int(input())\nt, a = map(int, input().split())\nans = []\nfor i, x in enumerate(map(int, input().split())):\n ans.append((abs(t - x * 0.006 - a), i))\nprint(min(ans)[1] + 1)']
|
['Wrong Answer', 'Accepted']
|
['s473691138', 's205106591']
|
[3060.0, 3188.0]
|
[19.0, 19.0]
|
[175, 175]
|
p03220
|
u931889893
| 2,000
| 1,048,576
|
A country decides to build a palace. In this country, the average temperature of a point at an elevation of x meters is T-x \times 0.006 degrees Celsius. There are N places proposed for the place. The elevation of Place i is H_i meters. Among them, Princess Joisino orders you to select the place whose average temperature is the closest to A degrees Celsius, and build the palace there. Print the index of the place where the palace should be built. It is guaranteed that the solution is unique.
|
["N = input()\nT, A = map(int, input().split())\nprint(T)\ntemperatures = list(map(int, input().split()))\n\nr = 50000000000000\nresults = ''\n\nlist = [T - t * 0.006 for t in temperatures]\nfor index, avg_temp in enumerate(list): \n ondo_sa = A - avg_temp\n if r > abs(ondo_sa):\n r = ondo_sa\n results = index + 1\nprint(results)", "N = input()\nT, A = map(int, input().split())\ntemperatures = list(map(int, input().split()))\n \nr = 50000000\nresults = ''\n \nlist = [T - t * 0.006 for t in temperatures]\nfor index, avg_temp in enumerate(list): \n\n if r > abs(ondo_sa):\n r = ondo_sa\n results = index + 1\nprint(results)", "N = input()\nT, A = map(int, input().split())\ntemperatures = list(map(int, input().split()))\n\nr = 50000000\nresults = ''\n\nlist = [T - t * 0.006 for t in temperatures]\nfor index, avg_temp in enumerate(list):\n \tif avg_temp < 0:\n \tavg_temp = avg_temp * -1\n \n ondo_sa = A - avg_temp\n if r > ondo_sa:\n r = ondo_sa\n results = index + 1\nprint(results)", "N = input()\nT, A = map(int, input().split())\nprint(T)\ntemperatures = list(map(int, input().split()))\n \nr = 50000000000000\nresults = ''\n \nlist = [T - t * 0.006 for t in temperatures]\nfor index, avg_temp in enumerate(list):\n ondo_sa = avg_temp - A\n\n if ondo_sa < 0:\n ondo_sa = - ondo_sa\n\n if r > abs(ondo_sa):\n r = ondo_sa\n results = index + 1\nprint(results)", "N = input()\nT, A = map(int, input().split())\ntemperatures = list(map(int, input().split()))\n \nr = 50000000000000\nresults = ''\n \nlist = [T - t * 0.006 for t in temperatures]\nfor index, avg_temp in enumerate(list):\n ondo_sa = avg_temp - A\n \n if ondo_sa < 0:\n ondo_sa = - ondo_sa\n \n if r > abs(ondo_sa):\n r = ondo_sa\n results = index + 1\nprint(results)"]
|
['Wrong Answer', 'Runtime Error', 'Runtime Error', 'Wrong Answer', 'Accepted']
|
['s228955712', 's349223603', 's526214161', 's606854588', 's594971378']
|
[3064.0, 3060.0, 2940.0, 3064.0, 3060.0]
|
[18.0, 18.0, 17.0, 18.0, 19.0]
|
[340, 301, 373, 386, 379]
|
p03220
|
u932868243
| 2,000
| 1,048,576
|
A country decides to build a palace. In this country, the average temperature of a point at an elevation of x meters is T-x \times 0.006 degrees Celsius. There are N places proposed for the place. The elevation of Place i is H_i meters. Among them, Princess Joisino orders you to select the place whose average temperature is the closest to A degrees Celsius, and build the palace there. Print the index of the place where the palace should be built. It is guaranteed that the solution is unique.
|
['n=int(input())\nn,a=map(int,input().split())\nh=list(map(int,input().split()))\nlist=[]\nfor hh in h:\n list.append(t-0.006*hh)\nans=[]\nfor l in list:\n ans.append(abs(a-l))\nprint(min(ans))\n ', 'n=int(input())\nt,a=map(int,input().split())\nh=list(map(int,input().split()))\nlist=[]\nfor hh in h:\n list.append(t-0.006*hh)\nans=[]\nfor l in list:\n ans.append(abs(a-l))\nprint(ans.index(min(ans))+1)\n ']
|
['Runtime Error', 'Accepted']
|
['s177571317', 's247946172']
|
[3060.0, 3060.0]
|
[17.0, 18.0]
|
[193, 206]
|
p03220
|
u934868410
| 2,000
| 1,048,576
|
A country decides to build a palace. In this country, the average temperature of a point at an elevation of x meters is T-x \times 0.006 degrees Celsius. There are N places proposed for the place. The elevation of Place i is H_i meters. Among them, Princess Joisino orders you to select the place whose average temperature is the closest to A degrees Celsius, and build the palace there. Print the index of the place where the palace should be built. It is guaranteed that the solution is unique.
|
['n = int(input())\nt, a = map(int, input().split())\nh = list(map(int, input().split()))\ndif = t-a\nans = 0\nfor i in range(n):\n if t-a-0.006*h[i] < dif:\n ans = i+1\n dif = t-a-0.006*h[i]\nprint(ans)', 'n = int(input())\nt, a = map(int, input().split())\nh = list(map(int, input().split()))\ndif = abs(t-a - 0.006*h[0])\nans = 1\nfor i in range(1, n):\n if abs(t-a-0.006*h[i]) < dif:\n ans = i+1\n dif = abs(t-a-0.006*h[i])\nprint(ans)']
|
['Wrong Answer', 'Accepted']
|
['s678582082', 's342820889']
|
[3064.0, 3064.0]
|
[18.0, 18.0]
|
[199, 230]
|
p03220
|
u939585142
| 2,000
| 1,048,576
|
A country decides to build a palace. In this country, the average temperature of a point at an elevation of x meters is T-x \times 0.006 degrees Celsius. There are N places proposed for the place. The elevation of Place i is H_i meters. Among them, Princess Joisino orders you to select the place whose average temperature is the closest to A degrees Celsius, and build the palace there. Print the index of the place where the palace should be built. It is guaranteed that the solution is unique.
|
['N = int(input())\nT, A = map(int,input().split())\nH = list(map(int,input().split()))\n\nans = []\nfor i in range(N):\n a_t = T - (H[i] * 0.006)\n Abs = abs(A - a_t)\n ans.append(int(Abs))\n\nprint(ans.index(min(ans)))', 'N = int(input())\nT, A = map(int,input().split())\nH = list(map(int,input().split()))\n\nans = []\nfor i in range(N):\n a_t = T - (H[i] * 0.006)\n Abs = abs(A - a_t)\n ans.append(Abs)\n\nprint(ans.index(min(ans)) + 1)']
|
['Wrong Answer', 'Accepted']
|
['s962671127', 's214978012']
|
[3060.0, 3060.0]
|
[18.0, 18.0]
|
[211, 210]
|
p03220
|
u939702463
| 2,000
| 1,048,576
|
A country decides to build a palace. In this country, the average temperature of a point at an elevation of x meters is T-x \times 0.006 degrees Celsius. There are N places proposed for the place. The elevation of Place i is H_i meters. Among them, Princess Joisino orders you to select the place whose average temperature is the closest to A degrees Celsius, and build the palace there. Print the index of the place where the palace should be built. It is guaranteed that the solution is unique.
|
['n = int(input())\nt, a = map(int, input().split())\nh_array = list(map(int, input().split()))\n\nt_array = [abs(t - 0.006 * h) - a for h in h_array]\nans = t_array.index(min(t_array)) + 1\nprint(ans)', 'n = int(input())\nt, a = map(int, input().split())\nh_array = list(map(int, input().split()))\n\nt_array = [abs(t - 0.006 * h - a) for h in h_array]\nans = t_array.index(min(t_array)) + 1\nprint(ans)']
|
['Wrong Answer', 'Accepted']
|
['s072980800', 's196833551']
|
[3060.0, 3060.0]
|
[19.0, 19.0]
|
[193, 193]
|
p03220
|
u940279019
| 2,000
| 1,048,576
|
A country decides to build a palace. In this country, the average temperature of a point at an elevation of x meters is T-x \times 0.006 degrees Celsius. There are N places proposed for the place. The elevation of Place i is H_i meters. Among them, Princess Joisino orders you to select the place whose average temperature is the closest to A degrees Celsius, and build the palace there. Print the index of the place where the palace should be built. It is guaranteed that the solution is unique.
|
['n = int(input())\nt, a = map(int,input().split())\nh = list(map(int,input().split()))\ntem = [ans(a - ( t - i * 0.006)) for i in h]\nprint(tem.index(min(tem)) + 1)', 'n = int(input())\nt,a = map(int,input().split())\nh = list(map(int,input().split()))\ntmp = 1000000\nans = 0\nh.sort(reverse = True)\n\nfor i in range(n):\n c = t - h[i] * 0.006\n d = a - c\n if d < 0:\n d = -d\n if d < tmp:\n tmp = d\n ans = i + 1\nprint(ans)', 'n = int(input())\nt,a = map(int,input().split())\nh = list(map(int,input().split()))\ntmp = 1000000\nans = 0\nh.sort(reverse = True)\n\nfor i in range(n):\n c = t - h[i] * 0.006\n d = a - c\n if d < 0:\n d = -d\n if d < tmp:\n tmp = d\n ans = i + 1\nprint(ans)', 'n = int(input())\nt, a = map(int,input().split())\nh = list(map(int,input().split()))\ntem = [abs(a - ( t - i * 0.006)) for i in h]\nprint(tem.index(min(tem)) + 1)']
|
['Runtime Error', 'Wrong Answer', 'Wrong Answer', 'Accepted']
|
['s161517748', 's452678984', 's580159997', 's996047526']
|
[3060.0, 3064.0, 3188.0, 3060.0]
|
[18.0, 18.0, 18.0, 18.0]
|
[159, 258, 258, 159]
|
p03220
|
u940743763
| 2,000
| 1,048,576
|
A country decides to build a palace. In this country, the average temperature of a point at an elevation of x meters is T-x \times 0.006 degrees Celsius. There are N places proposed for the place. The elevation of Place i is H_i meters. Among them, Princess Joisino orders you to select the place whose average temperature is the closest to A degrees Celsius, and build the palace there. Print the index of the place where the palace should be built. It is guaranteed that the solution is unique.
|
["\nn = int(input())\nt, a = list(map(int, input().split(' ')))\nhs = list(map(int, input().split(' ')))\n\ndiff_a = list(map(lambda h: int(abs(a - t + h * 0.006)), hs))\nprint(diff_a)\nans = 100_000\nresult = -1\nfor i in range(n):\n if diff_a[i] <= ans:\n result = i + 1\n ans = diff_a[i]\n\nprint(result)\n", "n = int(input())\nt, a = list(map(int, input().split(' ')))\nhn = list(map(int, input().split(' ')))\n\ndef get_dif(h):\n temp = t - h * 0.006\n dif = abs(temp - a)\n return dif\n\nresult = hn.index(min(hn, key=get_dif)) + 1\nprint(result)\n"]
|
['Runtime Error', 'Accepted']
|
['s848582884', 's648575630']
|
[2940.0, 3060.0]
|
[17.0, 18.0]
|
[309, 239]
|
p03220
|
u940780117
| 2,000
| 1,048,576
|
A country decides to build a palace. In this country, the average temperature of a point at an elevation of x meters is T-x \times 0.006 degrees Celsius. There are N places proposed for the place. The elevation of Place i is H_i meters. Among them, Princess Joisino orders you to select the place whose average temperature is the closest to A degrees Celsius, and build the palace there. Print the index of the place where the palace should be built. It is guaranteed that the solution is unique.
|
['N=int(input())\nT,A=map(int,input().split())\nS=list(map(int,input().split()))\nans=0\nt=0\ntemp=[]\nfor i in range(N):\n\tt = T-0.006*S[i] - A\n\tt = t*t\n\ttemp.append(t)\nprint(temp)\nprint(temp.index(min(temp))+1)', 'N=int(input())\nT,A=map(int,input().split())\nS=list(map(int,input().split()))\nans=0\nt=0\ntemp=[]\nfor i in range(N):\n\tt = T-0.006*S[i] - A\n\tt = t*t\n\ttemp.append(t)\nprint(temp.index(min(temp))+1)\t\t']
|
['Wrong Answer', 'Accepted']
|
['s707760747', 's704591216']
|
[3060.0, 3188.0]
|
[19.0, 20.0]
|
[203, 193]
|
p03220
|
u941022948
| 2,000
| 1,048,576
|
A country decides to build a palace. In this country, the average temperature of a point at an elevation of x meters is T-x \times 0.006 degrees Celsius. There are N places proposed for the place. The elevation of Place i is H_i meters. Among them, Princess Joisino orders you to select the place whose average temperature is the closest to A degrees Celsius, and build the palace there. Print the index of the place where the palace should be built. It is guaranteed that the solution is unique.
|
['a=int(input())\nave,risou= map(int, input().split())\nh=[0]*a\nh=list(map(int, input().split()))\nfor i in range(a):\n h[i]=abs(ave-(h[i]*0.006))\nprint(h.index(min(h))+1)', 'a=int(input())\nb,c= map(int, input().split())\np=[0]*a\nrisou=[0]*a\np=list(map(int, input().split()))\nfor i in range(a):\n p[i]=b-(p[i]*0.006)\n if p[i]>=0:\n risou[i]=p[i]\n else:\n risou[i]=p[i]*-1\nif 0 in risou:\n print(print(risou.index(0)+1))\nelse:\n print(risou.index(min(risou))+1)', 'a=int(input())\nave,risou= map(int, input().split())\nh=[0]*a\nh=list(map(int, input().split()))\nfor i in range(a):\n h[i]=risou-abs(ave-(h[i]*0.006))\nprint(h.index(max(h))+1)', 'a=int(input())\nave,risou= map(int, input().split())\nh=[0]*a\nh=list(map(int, input().split()))\nfor i in range(a):\n h[i]=abs(risou-(ave-(h[i]*0.006)))\nprint(h.index(min(h))+1)']
|
['Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Accepted']
|
['s021355263', 's181402091', 's942846579', 's060973920']
|
[3060.0, 3064.0, 3060.0, 3060.0]
|
[18.0, 18.0, 18.0, 18.0]
|
[168, 308, 174, 176]
|
p03220
|
u944396627
| 2,000
| 1,048,576
|
A country decides to build a palace. In this country, the average temperature of a point at an elevation of x meters is T-x \times 0.006 degrees Celsius. There are N places proposed for the place. The elevation of Place i is H_i meters. Among them, Princess Joisino orders you to select the place whose average temperature is the closest to A degrees Celsius, and build the palace there. Print the index of the place where the palace should be built. It is guaranteed that the solution is unique.
|
['n = int(input())\nt, a = map(int, input().split())\nh = list(map(float, input().split()))\n\ndt = 10000000\nans = 0\nfor i in range(len(h)):\n print(i)\n tmp = float(t) - 0.006 * h[i]\n print(i, h[i], tmp, dt, abs( a - tmp ))\n if dt > abs( a - tmp ):\n dt = abs( a - tmp )\n ans = i + 1\n\nprint(ans)\n', 'n = int(input())\nt, a = map(int, input().split())\nh = list(map(float, input().split()))\n\ndt = 10000000\nans = 0\nfor i in range(len(h)):\n print(i)\n tmp = float(t) - 0.006 * h[i]\n if dt > abs( a - tmp ):\n dt = abs( a - tmp )\n ans = i + 1\n\nprint(ans)\n', 'n = int(input())\nt, a = map(int, input().split())\nh = list(map(float, input().split()))\n\ndt = 1000\nans = 0\nfor i in range(len(h)):\n tmp = float(t) - 0.006 * h[i]\n if dt > abs( a - tmp ):\n dt = abs( a - tmp )\n ans = i + 1\n\nprint(ans)\n']
|
['Wrong Answer', 'Wrong Answer', 'Accepted']
|
['s913899289', 's940152686', 's169925287']
|
[9208.0, 9240.0, 9260.0]
|
[36.0, 29.0, 30.0]
|
[314, 270, 253]
|
p03220
|
u945181840
| 2,000
| 1,048,576
|
A country decides to build a palace. In this country, the average temperature of a point at an elevation of x meters is T-x \times 0.006 degrees Celsius. There are N places proposed for the place. The elevation of Place i is H_i meters. Among them, Princess Joisino orders you to select the place whose average temperature is the closest to A degrees Celsius, and build the palace there. Print the index of the place where the palace should be built. It is guaranteed that the solution is unique.
|
['N = int(input())\nT, A = map(float, input().split())\nH = list(map(float, input().split()))\nans = [0] * N\nfor i in range(N):\n ans[i] = abs(T - i * 0.006 - A)\n\nprint(ans.index(min(ans)) + 1)\n', 'N = float(input())\nT, A = map(float, input().split())\nH = list(map(float, input().split()))\nl = [i for i in H abs(T - i * 0.006)]\n\nprint(min(l))', 'N = int(input())\nT, A = map(float, input().split())\nH = list(map(float, input().split()))\nans = [0] * N\nfor i in range(N):\n ans[i] = abs(T - H[i] * 0.006 - A)\n\nprint(ans.index(min(ans)) + 1)\n']
|
['Wrong Answer', 'Runtime Error', 'Accepted']
|
['s712935117', 's725032502', 's504812479']
|
[3060.0, 2940.0, 3060.0]
|
[18.0, 17.0, 18.0]
|
[189, 144, 192]
|
p03220
|
u946026022
| 2,000
| 1,048,576
|
A country decides to build a palace. In this country, the average temperature of a point at an elevation of x meters is T-x \times 0.006 degrees Celsius. There are N places proposed for the place. The elevation of Place i is H_i meters. Among them, Princess Joisino orders you to select the place whose average temperature is the closest to A degrees Celsius, and build the palace there. Print the index of the place where the palace should be built. It is guaranteed that the solution is unique.
|
['N = int(input())\nT, A = map(int,input().split(" "))\nH = list(map(int,input().split(" ")))\n\nout = None\nnum = None\n\nfor i in range(N):\n avg = T - H[i]*0.006\n if num == None:\n out = i\n num = abs(avg)\n continue\n\n if num > abs(avg):\n out = i\n num = abs(avg)\n\nprint(out+1)', 'N = int(input())\nT, A = map(int,input().split(" "))\nH = list(map(int,input().split(" ")))\n\nout = None\nnum = None\n\nfor i in range(N):\n avg = T - H[i]*0.006\n if num == None:\n out = i\n num = abs(A - avg)\n continue\n\n if num > abs(A - avg):\n out = i\n num = abs(A - avg)\n\nprint(out+1)']
|
['Wrong Answer', 'Accepted']
|
['s452740711', 's690147761']
|
[3064.0, 3064.0]
|
[18.0, 19.0]
|
[311, 323]
|
p03220
|
u949406263
| 2,000
| 1,048,576
|
A country decides to build a palace. In this country, the average temperature of a point at an elevation of x meters is T-x \times 0.006 degrees Celsius. There are N places proposed for the place. The elevation of Place i is H_i meters. Among them, Princess Joisino orders you to select the place whose average temperature is the closest to A degrees Celsius, and build the palace there. Print the index of the place where the palace should be built. It is guaranteed that the solution is unique.
|
['import sys\nN = input()\nTA = input()\nT, A = TA.split()\nHinp = input()\nH = Hinp.split()\nans = None\nfor x in range(H):\n _ans = T - x * 0.006\n if _ans == ans:\n print(ans)\n sys.exit()\n if not ans or abs(A - _ans) < abs(A - ans):\n ans = _ans\nprint(ans)', 'N = input()\nTA = input()\nT, A = TA.split()\nHinp = input()\nH = Hinp.split()\nans = None\nfor x in range(H):\n _ans = T - x * 0.006\n if _ans == ans:\n print(ans)\n return\n if not ans or abs(A - _ans) < abs(A - ans):\n ans = _ans\nprint(ans)', 'import sys\nN = input()\nTA = input()\nT, A = TA.split()\nHinp = input()\nH = Hinp.split()\nansnum = None\nans = 0\ndef getdiff(A, ans):\n return abs(max(ans, A) - min(ans, A))\ndef chk(A, _ans, ans):\n new_d, old_d = getdiff(A, _ans), getdiff(A, ans)\n if new_d < old_d:\n return True\n return False\ndef showans(ans):\n print(ans)\n sys.exit()\nfor i, x in enumerate(H):\n _ans = int(T) - int(x) * 0.006\n if _ans == A:\n showans(i+1)\n if not ansnum or chk(int(A), _ans, ansnum):\n ans = i+1\n ansnum = _ans\nshowans(ans)']
|
['Runtime Error', 'Runtime Error', 'Accepted']
|
['s155348015', 's718014134', 's397824640']
|
[3060.0, 3064.0, 3064.0]
|
[17.0, 17.0, 20.0]
|
[276, 261, 554]
|
p03220
|
u951601135
| 2,000
| 1,048,576
|
A country decides to build a palace. In this country, the average temperature of a point at an elevation of x meters is T-x \times 0.006 degrees Celsius. There are N places proposed for the place. The elevation of Place i is H_i meters. Among them, Princess Joisino orders you to select the place whose average temperature is the closest to A degrees Celsius, and build the palace there. Print the index of the place where the palace should be built. It is guaranteed that the solution is unique.
|
['N=int(input())\nT,A=map(int,input().split())\nH_list=list(map(int,input().split()))\na=list(map(lambda x:abs(A-(T-x*0.006)), H_list))\n#print(a)\nprint(min(a))', 'N=int(input())\nT,A=map(int,input().split())\nH_list=list(map(int,input().split()))\na=list(map(lambda x:abs((T-x*0.006)-A), H_list))\n#print(a)\n#print(min(a))\nprint(a.index(min(a))+1)']
|
['Wrong Answer', 'Accepted']
|
['s983970064', 's600043292']
|
[3060.0, 3060.0]
|
[18.0, 20.0]
|
[154, 180]
|
p03220
|
u951980350
| 2,000
| 1,048,576
|
A country decides to build a palace. In this country, the average temperature of a point at an elevation of x meters is T-x \times 0.006 degrees Celsius. There are N places proposed for the place. The elevation of Place i is H_i meters. Among them, Princess Joisino orders you to select the place whose average temperature is the closest to A degrees Celsius, and build the palace there. Print the index of the place where the palace should be built. It is guaranteed that the solution is unique.
|
['import math\nN = int(input())\nT,A = map(int,input().split(" "))\nH = list(map(int,input().split(" ")))\n\ndef average_temperature(x):\n global T\n return T - x*0.006\n\nr = list(map(average_temperature,H))\nprint(r)\na = []\nfor i in range(len(H)):\n c = A - r[i]\n a.append((i,abs(c),))\n\nb = sorted(a,key=lambda x:x[1])\nprint(b[0][0]+1)\n', 'N = int(input())\nT,A = list(map(int,input().split(" ")))\nH = list(map(int,input().split(" ")))\nres = 1000000\nc = 1\nfor i in range(N):\n tmp = T-(H[i]*0.006)\n d = abs(tmp-A)\n if d < res:\n res = d\n c = i+1\nprint(c)\n\n\n\n']
|
['Wrong Answer', 'Accepted']
|
['s069090599', 's561351648']
|
[3188.0, 3060.0]
|
[19.0, 19.0]
|
[337, 238]
|
p03220
|
u953020348
| 2,000
| 1,048,576
|
A country decides to build a palace. In this country, the average temperature of a point at an elevation of x meters is T-x \times 0.006 degrees Celsius. There are N places proposed for the place. The elevation of Place i is H_i meters. Among them, Princess Joisino orders you to select the place whose average temperature is the closest to A degrees Celsius, and build the palace there. Print the index of the place where the palace should be built. It is guaranteed that the solution is unique.
|
['N = int(input())\nT,A = list(map(int, input().split()))\nH = list(map(int, input().split()))\nansx=100000000000\nfor i in range(N):\n subans=T-H[i]*0.006\n print(subans)\n if abs(A-subans)<=abs(ansx):\n ansx=subans\n ans=i+1\nprint(ans)\n', 'N = int(input())\nT,A = list(map(int, input().split()))\nH = list(map(int, input().split()))\nansx=T-H[0]*0.006\nans=1\nfor i in range(N):\n subans=T-H[i]*0.006\n if abs(A-subans)<abs(A-ansx):\n ansx=subans\n ans=i+1\nprint(ans)\n']
|
['Wrong Answer', 'Accepted']
|
['s521442342', 's666577743']
|
[3316.0, 3060.0]
|
[19.0, 18.0]
|
[250, 239]
|
p03220
|
u959651981
| 2,000
| 1,048,576
|
A country decides to build a palace. In this country, the average temperature of a point at an elevation of x meters is T-x \times 0.006 degrees Celsius. There are N places proposed for the place. The elevation of Place i is H_i meters. Among them, Princess Joisino orders you to select the place whose average temperature is the closest to A degrees Celsius, and build the palace there. Print the index of the place where the palace should be built. It is guaranteed that the solution is unique.
|
['n = int(input())\nt,a = map(int,input().split())\nh = list(int(input()) for i in range(n))\n\nmi = 1234567890\nfor i in range(n):\n ti = t - h[i] * 0.006\n if abs(mi - a) > abs(ti - a):\n mi = ti\n ans = i + 1\n \nprint(ans)', 'n = int(input())\nt,a = map(int,input().split())\nh = list(map(int,input().split()))\n\nminimum = 1234567890\nfor i in range(n):\n ti = t - h[i] * 0.006\n if abs(minimum - a) > abs(ti - a):\n minimum = ti\n ans = i + 1\n \nprint(ans)']
|
['Runtime Error', 'Accepted']
|
['s171495361', 's090655807']
|
[3060.0, 3060.0]
|
[18.0, 18.0]
|
[240, 249]
|
p03220
|
u961674365
| 2,000
| 1,048,576
|
A country decides to build a palace. In this country, the average temperature of a point at an elevation of x meters is T-x \times 0.006 degrees Celsius. There are N places proposed for the place. The elevation of Place i is H_i meters. Among them, Princess Joisino orders you to select the place whose average temperature is the closest to A degrees Celsius, and build the palace there. Print the index of the place where the palace should be built. It is guaranteed that the solution is unique.
|
['n=int(input())\nt,a=map(int,input().split())\nh=list(map(int,input().split()))\np=0\nq=100\nx=0\nfor i in range(n):\n p=abs(a-t+h[i]*0.006)\n if p<q:\n x=i\n q=p\nprint(i+1)', 'n=int(input())\nt,a=map(int,input().split())\nh=list(map(int,input().split()))\ndt=1000000\nans=-1\nth=0\nfor i in range(n):\n th=abs(a-t+h[i]*0.006)\n if th<dt:\n ans=i+1\n dt=th\n print(th)\nprint(ans)', 'n=int(input())\nt,a=map(int,input().split())\nh=list(map(int,input().split()))\nm=100\nans=-1\nfor i in range(n):\n h[i]=abs(a-t+h[i]*0.006)\n print(h[i])\n if i<m:\n ans=i+1\n m=h[i]\nprint(ans)', 'n=int(input())\nt,a=map(int,input().split())\nh=list(map(int,input().split()))\np=0\nq=100\nx=0\nfor i in range(n):\n p=abs(a-t-h[i]*0.006)\n if p<q:\n x=i\n q=p\nprint(i+1)', 'n=int(input())\nt,a=map(int,input().split())\nh=list(map(int,input().split()))\ndt=1000000\nans=-1\nth=0\nfor i in range(n):\n th=abs(a-t+h[i]*0.006)\n if th<dt:\n ans=i+1\n dt=th\nprint(ans)']
|
['Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Accepted']
|
['s104914849', 's278478068', 's505441919', 's838123290', 's546849763']
|
[3064.0, 3188.0, 3188.0, 3188.0, 3064.0]
|
[19.0, 20.0, 20.0, 19.0, 18.0]
|
[170, 200, 193, 170, 188]
|
p03220
|
u962197874
| 2,000
| 1,048,576
|
A country decides to build a palace. In this country, the average temperature of a point at an elevation of x meters is T-x \times 0.006 degrees Celsius. There are N places proposed for the place. The elevation of Place i is H_i meters. Among them, Princess Joisino orders you to select the place whose average temperature is the closest to A degrees Celsius, and build the palace there. Print the index of the place where the palace should be built. It is guaranteed that the solution is unique.
|
['n = int(input())\nt, a = map(int,input().split())\nh = list(map(int,input().split()))\nh = [abs((t - x * 0.006) - a) for x in h]\nprint(h.index(min(h)))', 'n = int(input())\nt, a = map(int,input().split())\nh = list(map(int,input().split()))\nh = [abs((t - x * 0.006) - a) for x in h]\nprint(h.index(min(h))+1)']
|
['Wrong Answer', 'Accepted']
|
['s426813037', 's754163496']
|
[3060.0, 3060.0]
|
[18.0, 18.0]
|
[148, 150]
|
p03220
|
u963903527
| 2,000
| 1,048,576
|
A country decides to build a palace. In this country, the average temperature of a point at an elevation of x meters is T-x \times 0.006 degrees Celsius. There are N places proposed for the place. The elevation of Place i is H_i meters. Among them, Princess Joisino orders you to select the place whose average temperature is the closest to A degrees Celsius, and build the palace there. Print the index of the place where the palace should be built. It is guaranteed that the solution is unique.
|
['import numpy; input(); t,a=map(int,input().split())\nh=list(map(lambda x: abs(a-(t-int(x)*0.006)),input().split()))\nprint(numpy.argmin(h))', 'import numpy; input(); t,a=map(int,input().split())\nh=list(map(lambda x: abs(a-(t-int(x)*0.006)),input().split()))\nprint(numpy.argmin(h)+1)']
|
['Wrong Answer', 'Accepted']
|
['s248454603', 's086634960']
|
[21276.0, 12832.0]
|
[344.0, 170.0]
|
[137, 139]
|
p03220
|
u971091945
| 2,000
| 1,048,576
|
A country decides to build a palace. In this country, the average temperature of a point at an elevation of x meters is T-x \times 0.006 degrees Celsius. There are N places proposed for the place. The elevation of Place i is H_i meters. Among them, Princess Joisino orders you to select the place whose average temperature is the closest to A degrees Celsius, and build the palace there. Print the index of the place where the palace should be built. It is guaranteed that the solution is unique.
|
['n = int(input())\nt, a = map(int, input().split())\nh = list(map(int, input().split()))\nm = h[0]\nans = 0\n\nfor i in range(1, n):\n num = abs(a-(t-h[i]*0.006))\n if num < m:\n ans = i\n m = num\n\nprint(ans+1)', 'n = int(input())\nt, a = map(int, input().split())\nh = list(map(int, input().split()))\nm = abs(a-(t-h[0]*0.006))\nans = 0\n\nfor i in range(1, n):\n num = abs(a-(t-h[i]*0.006))\n if num < m:\n ans = i\n m = num\n\nprint(ans+1)']
|
['Wrong Answer', 'Accepted']
|
['s645970656', 's531647750']
|
[3188.0, 3064.0]
|
[18.0, 18.0]
|
[219, 236]
|
p03220
|
u976871772
| 2,000
| 1,048,576
|
A country decides to build a palace. In this country, the average temperature of a point at an elevation of x meters is T-x \times 0.006 degrees Celsius. There are N places proposed for the place. The elevation of Place i is H_i meters. Among them, Princess Joisino orders you to select the place whose average temperature is the closest to A degrees Celsius, and build the palace there. Print the index of the place where the palace should be built. It is guaranteed that the solution is unique.
|
['#coding:UTF-8\nnum = int(input())\ns = input()\nss = s.split(" ")\nt = int(ss[0])\na = int(ss[1])\nhigh = input()\nhigh_list = high.split(" ")\ncalc_list = list()\nfor i in range(num):\n high_work = int(high_list[i])\n work = t-high_work*0.006\n calc_list.append(abs(a-work))\nprint(calc_list)\nprint(calc_list.index(min(calc_list))+1)', '#coding:UTF-8\nnum = int(input())\ns = input()\nss = s.split(" ")\nt = int(ss[0])\na = int(ss[1])\nhigh = input()\nhigh_list = high.split(" ")\ncalc_list = list()\nfor i in range(num):\n high_work = int(high_list[i])\n work = t-high_work*0.006\n calc_list.append(abs(a-work))\nprint(calc_list.index(min(calc_list))+1)']
|
['Wrong Answer', 'Accepted']
|
['s057380204', 's271470798']
|
[3064.0, 3064.0]
|
[19.0, 18.0]
|
[324, 307]
|
p03220
|
u977349332
| 2,000
| 1,048,576
|
A country decides to build a palace. In this country, the average temperature of a point at an elevation of x meters is T-x \times 0.006 degrees Celsius. There are N places proposed for the place. The elevation of Place i is H_i meters. Among them, Princess Joisino orders you to select the place whose average temperature is the closest to A degrees Celsius, and build the palace there. Print the index of the place where the palace should be built. It is guaranteed that the solution is unique.
|
['N = input()\nT, A = map(int, input().split())\nH = list(map(int, input().split()))\n\nfor i in range(N)\n H[i] = abs(A - (T - H[i] * 0.006))\nprint(H.index(min(H)) + 1)', 'N = int(input())\nT, A = map(int, input().split())\nH = list(map(int, input().split()))\n\nfor i in range(N):\n H[i] = abs(A - (T - H[i] * 0.006))\nprint(H.index(min(H)) + 1)\n']
|
['Runtime Error', 'Accepted']
|
['s761181755', 's196959377']
|
[2940.0, 3060.0]
|
[17.0, 18.0]
|
[165, 172]
|
p03220
|
u977642052
| 2,000
| 1,048,576
|
A country decides to build a palace. In this country, the average temperature of a point at an elevation of x meters is T-x \times 0.006 degrees Celsius. There are N places proposed for the place. The elevation of Place i is H_i meters. Among them, Princess Joisino orders you to select the place whose average temperature is the closest to A degrees Celsius, and build the palace there. Print the index of the place where the palace should be built. It is guaranteed that the solution is unique.
|
['input_str = input().split("\\n")\nnumber = int(input_str[0])\n\ntemp = int(input_str[1].split()[0])\ngoal = int(input_str[1].split()[1])\n\nHn = list(map(int, input_str[2].split()))\n\navg_temp = [(temp - (Hn * 0.006)) / goal for Hn in Hn]\n\nif goal >= 0:\n print(int((avg_temp.index(max(avg_temp))) + 1))\nelse:\n print(int((avg_temp.index(min(avg_temp))) + 1))', 'input_str = input().split("\\n")\nnumber = int(input_str[0])\n\ntemp = int(input_str[1].split()[0])\ngoal = int(input_str[1].split()[1])\n\nHn = list(map(int, input_str[2].split()))\n\navg_temp = [int(temp - (Hn * 0.006)) for Hn in Hn]\n\nprint(int((avg_temp.index(max(avg_temp)))+1))\n', '\n\ninput_str = input().split("\\n")\n# a = [int(x) for x in a]\nnumber = int(input_str[0])\n\ntemp = int(input_str[1].split()[0])\ngoal = int(input_str[1].split()[1])\n\nHn = list(map(int, input_str[2].split()))\n\navg_temp = [(temp - (Hn * 0.006)) for Hn in Hn]\n\nprint(int((avg_temp.index(max(avg_temp))) + 1))\n', 'input_str = input().split("\\n")\nnumber = int(input_str[0])\n\ntemp = int(input_str[1].split()[0])\ngoal = int(input_str[1].split()[1])\n\nHn = list(map(int, input_str[2].split()))\n\navg_temp = [int(temp - (Hn * 0.006)) for Hn in Hn]\n\nprint(int((avg_temp.index(max(avg_temp)))+1))\n', '\n\ninput_str = input().split("\\n")\n# a = [int(x) for x in a]\nnumber = int(input_str[0])\n\ntemp = int(input_str[1].split()[0])\ngoal = int(input_str[1].split()[1])\n\nHn = list(map(int, input_str[2].split()))\n\navg_temp = [(temp - (Hn * 0.006)) / goal for Hn in Hn]\n\nif goal >= 0:\n print(int((avg_temp.index(max(avg_temp))) + 1))\nelse:\n print(int((avg_temp.index(min(avg_temp))) + 1))', 'def main(n, t, a, h):\n def formula(t, x): return t - x * 0.006\n res = []\n\n for _h in h:\n res.append(abs(a - formula(t, _h)))\n\n print(res.index(min(res)) + 1)\n\n\nif __name__ == "__main__":\n n = int(input())\n t, a = map(int, input().split(\' \'))\n h = list(map(int, input().split(\' \')))\n\n main(n, t, a, h)\n']
|
['Runtime Error', 'Runtime Error', 'Runtime Error', 'Runtime Error', 'Runtime Error', 'Accepted']
|
['s177423471', 's306278572', 's332460800', 's629301780', 's970334246', 's593225115']
|
[3064.0, 3060.0, 3060.0, 3060.0, 3064.0, 3060.0]
|
[17.0, 17.0, 17.0, 17.0, 18.0, 18.0]
|
[355, 274, 330, 274, 412, 332]
|
p03220
|
u981931040
| 2,000
| 1,048,576
|
A country decides to build a palace. In this country, the average temperature of a point at an elevation of x meters is T-x \times 0.006 degrees Celsius. There are N places proposed for the place. The elevation of Place i is H_i meters. Among them, Princess Joisino orders you to select the place whose average temperature is the closest to A degrees Celsius, and build the palace there. Print the index of the place where the palace should be built. It is guaranteed that the solution is unique.
|
['N = int(input())\nt , x = map(int,input().split())\nh_list = list(map(int,input().split()))\ntmp = []\nfor h in h_list:\n tmp1 = abs(x - (t - h * 0.006))\n tmp.append(tmp1)\nprint(tmp)\nprint(tmp.index(min(tmp)) + 1)', 'N = int(input())\nt , x = map(int,input().split())\nh_list = list(map(int,input().split()))\ntmp = []\nfor h in h_list:\n tmp1 = abs(x - (t - h * 0.006))\n tmp.append(tmp1)\nprint(tmp.index(min(tmp)) + 1)']
|
['Wrong Answer', 'Accepted']
|
['s148184037', 's252268864']
|
[3064.0, 3060.0]
|
[19.0, 18.0]
|
[214, 203]
|
p03220
|
u982749462
| 2,000
| 1,048,576
|
A country decides to build a palace. In this country, the average temperature of a point at an elevation of x meters is T-x \times 0.006 degrees Celsius. There are N places proposed for the place. The elevation of Place i is H_i meters. Among them, Princess Joisino orders you to select the place whose average temperature is the closest to A degrees Celsius, and build the palace there. Print the index of the place where the palace should be built. It is guaranteed that the solution is unique.
|
['n = int(input())\nt, a = map(int, input().split())\ny = 0\nz = 0\n\nh = list(map(int, input().split()))\nfor i in range(1,n+1):\n x = t - (h[i-1] * 0.006)\n print(x)\n if y ==0:\n y=x\n z=i\n else:\n if abs(x-a) <= abs(y-a):\n y = x\n z = i\nprint(z)', 'n = int(input())\nt, a = map(int, input().split())\ny = 0\n\nh = list(map(int, input().split()))\ndef comp(a,b,c):\n if abs(a-c) >= abs(b-c):\n return a\n else:\n return b\nfor i in range(n):\n x = t - (h[i] * 0.006)\n #print(x)\n if y ==0:\n y=x\n else:\n y=comp(x,y,a)\n z=i+1\nprint(z)', 'n = int(input())\nt, a = map(int, input().split())\ny = 0\nz = 0\n\nh = list(map(int, input().split()))\nfor i in range(1,n+1):\n x = t - (h[i-1] * 0.006)\n# print(x)\n if y ==0:\n y=x\n z=i\n else:\n if abs(x-a) <= abs(y-a):\n y = x\n z = i\nprint(z)\n']
|
['Wrong Answer', 'Wrong Answer', 'Accepted']
|
['s511492589', 's814663993', 's229767872']
|
[3188.0, 3060.0, 3060.0]
|
[20.0, 18.0, 18.0]
|
[284, 318, 286]
|
p03220
|
u989611356
| 2,000
| 1,048,576
|
A country decides to build a palace. In this country, the average temperature of a point at an elevation of x meters is T-x \times 0.006 degrees Celsius. There are N places proposed for the place. The elevation of Place i is H_i meters. Among them, Princess Joisino orders you to select the place whose average temperature is the closest to A degrees Celsius, and build the palace there. Print the index of the place where the palace should be built. It is guaranteed that the solution is unique.
|
['def calc_height(t, h):\n return (t - h) * 0.006\n\nn = int(input())\nt, a = map(int, input().split())\nhs = input().split()\n\nans = 1\ndiff = abs(calc_height(t, int(hs[0])))\nfor i, h in enumerate(hs):\n if calc_height(t, int(h)) < diff:\n ans = i + 1\n\nprint (ans)\n', '# input\nn = int(input())\nt, a = map(int, input().split())\nhs = list(map(int, input().split()))\n\n# 1st point set\nans = 0\nans_diff = float("inf")\n\n# check all point\nfor i in range(n):\n i_diff = abs(t - hs[i] * 0.006 - a)\n if i_diff < ans_diff:\n ans = i + 1\n ans_diff = i_diff\nprint (ans)\n']
|
['Wrong Answer', 'Accepted']
|
['s223707628', 's724609549']
|
[3060.0, 3060.0]
|
[18.0, 18.0]
|
[268, 306]
|
p03220
|
u990849962
| 2,000
| 1,048,576
|
A country decides to build a palace. In this country, the average temperature of a point at an elevation of x meters is T-x \times 0.006 degrees Celsius. There are N places proposed for the place. The elevation of Place i is H_i meters. Among them, Princess Joisino orders you to select the place whose average temperature is the closest to A degrees Celsius, and build the palace there. Print the index of the place where the palace should be built. It is guaranteed that the solution is unique.
|
["N = int(input())\nT, A = map(int, input().split())\nH = list(map(int, input().split()))\n\nmini = 0\nmin = float('inf')\n\nfor i in range(len(H)):\n if min > abs(A - (T - 0.006 * H[i])):\n mini = i + 1\n\nprint(mini)\n", "N = int(input())\nT, A = map(int, input().split())\nH = list(map(int, input().split()))\n\nmini = 0\nmin = float('inf')\n\nfor i in range(len(H)):\n if min > abs(A - (T - 0.006 * H[i])):\n min = abs(A - (T - 0.006 * H[i]))\n mini = i + 1\n\nprint(mini)\n"]
|
['Wrong Answer', 'Accepted']
|
['s479753047', 's086068654']
|
[3060.0, 3060.0]
|
[18.0, 19.0]
|
[216, 258]
|
p03220
|
u992910889
| 2,000
| 1,048,576
|
A country decides to build a palace. In this country, the average temperature of a point at an elevation of x meters is T-x \times 0.006 degrees Celsius. There are N places proposed for the place. The elevation of Place i is H_i meters. Among them, Princess Joisino orders you to select the place whose average temperature is the closest to A degrees Celsius, and build the palace there. Print the index of the place where the palace should be built. It is guaranteed that the solution is unique.
|
['N=int(input())\nT,A=map(int,input().split())\nH=list(map(int,input().split()))\nminval=10**5\nans=0\nfor i in range(N):\n val=abs(A-(T-H[i]*0.006))\n if val<minval:\n val=minval\n ans=i\nprint(ans+1)', 'N=int(input())\nT,A=map(int,input().split())\nH=list(map(int,input().split()))\nminval=10**5\nans=0\nfor i in range(N):\n val=abs(T-(12-H[i]*0.006))\n if val<minval:\n val=minval\n ans=i\nprint(ans+1)', 'N=int(input())\nT,A=map(int,input().split())\nH=list(map(int,input().split()))\n\nminval=[abs(A-(T-item*0.006)) for item in H]\nprint(minval.index(min(minval))+1)']
|
['Wrong Answer', 'Wrong Answer', 'Accepted']
|
['s044043928', 's138223325', 's361778563']
|
[3064.0, 3060.0, 3060.0]
|
[18.0, 18.0, 18.0]
|
[209, 210, 157]
|
p03220
|
u995062424
| 2,000
| 1,048,576
|
A country decides to build a palace. In this country, the average temperature of a point at an elevation of x meters is T-x \times 0.006 degrees Celsius. There are N places proposed for the place. The elevation of Place i is H_i meters. Among them, Princess Joisino orders you to select the place whose average temperature is the closest to A degrees Celsius, and build the palace there. Print the index of the place where the palace should be built. It is guaranteed that the solution is unique.
|
['n = int(input())\nt, a = map(int,input().split())\n\nh = list(map(int, (input().split())))\nmin = abs(a - (t - h[i]*0.006))\n\nfor i in range(1, n):\n if(min > abs(a - (t - h[i]*0.006))):\n min = a - (t - h[i]*0.006)\n ans = i+1\n\nprint(ans)', 'n = int(input())\nt, a = map(int,input().split())\nmin = 10000\n\nh = list(map(int, (input().split())))\n\nfor i in range(n):\n print(a-(t-h[i]*0.006))\n if(min > a - (t - h[i]*0.006)):\n min = a - (t - h[i]*0.006)\n ans = i+1\n\nprint(ans) ', 'n = int(input())\nt, a = map(int,input().split())\n\nh = list(map(int, (input().split())))\nmin = abs(a - (t - h[0]*0.006))\nans = 1\n\nfor i in range(1, n):\n if (min > abs(a - (t - h[i]*0.006))):\n min = abs(a - (t - h[i]*0.006))\n ans = i+1\n\nprint(ans) ']
|
['Runtime Error', 'Wrong Answer', 'Accepted']
|
['s023530987', 's814687733', 's138945122']
|
[3060.0, 3188.0, 3064.0]
|
[17.0, 19.0, 17.0]
|
[248, 253, 265]
|
p03220
|
u996952235
| 2,000
| 1,048,576
|
A country decides to build a palace. In this country, the average temperature of a point at an elevation of x meters is T-x \times 0.006 degrees Celsius. There are N places proposed for the place. The elevation of Place i is H_i meters. Among them, Princess Joisino orders you to select the place whose average temperature is the closest to A degrees Celsius, and build the palace there. Print the index of the place where the palace should be built. It is guaranteed that the solution is unique.
|
["n = int(input())\nt, a = [int(i) for i in input().split(' ')]\nh = [int(i) for i in input().split(' ')]\n\ntemp = []\nfor i in h:\n temp.append(t - i * 0.006)\n\nnear = 10001\nans = 0\nfor i, v in enumerate(temp):\n sub = a - v\n print(sub)\n if abs(near) > abs(sub):\n near = sub\n ans = i+1\n\nprint(ans)\n", "n = int(input())\nt, a = [int(i) for i in input().split(' ')]\nh = [int(i) for i in input().split(' ')]\n\ntemp = []\nfor i in h:\n temp.append(t - i * 0.006)\n\nnear = 10001\nans = 0\nfor i, v in enumerate(temp):\n sub = a - v\n if abs(near) > abs(sub):\n near = sub\n ans = i+1\n\nprint(ans)\n"]
|
['Wrong Answer', 'Accepted']
|
['s888254915', 's911114324']
|
[3188.0, 3060.0]
|
[20.0, 18.0]
|
[316, 301]
|
p03220
|
u998082063
| 2,000
| 1,048,576
|
A country decides to build a palace. In this country, the average temperature of a point at an elevation of x meters is T-x \times 0.006 degrees Celsius. There are N places proposed for the place. The elevation of Place i is H_i meters. Among them, Princess Joisino orders you to select the place whose average temperature is the closest to A degrees Celsius, and build the palace there. Print the index of the place where the palace should be built. It is guaranteed that the solution is unique.
|
['n = int(input())\nt, a = map(int, input().split())\nh = list(map(int, input().split()))\ngap = float("inf")\nfor i in range(n):\n print(gap)\n if abs(t - h[i] * 0.006 - a) < gap:\n ans = i + 1\n gap = abs(t - h[i] * 0.006 - a)\nprint(ans)', 'n = int(input())\nt, a = map(int, input().split())\nh = list(map(int, input().split()))\ngap = float("")\nfor i in range(n):\n print(gap)\n if abs(t - h[i] * 0.006 - a) < gap:\n ans = i + 1\n gap = abs(t - h[i] * 0.006 - a)\nprint(ans)', 'n = int(input())\nt, a = map(int, input().split())\nh = list(map(int, input().split()))\ngap = float("inf")\nfor i in range(n):\n if abs(t - h[i] * 0.006 - a) < gap:\n ans = i + 1\n gap = abs(t - h[i] * 0.006 - a)\nprint(ans)']
|
['Wrong Answer', 'Runtime Error', 'Accepted']
|
['s126673779', 's189074025', 's924381618']
|
[3188.0, 3060.0, 3060.0]
|
[19.0, 17.0, 18.0]
|
[249, 246, 234]
|
p03221
|
u010437136
| 2,000
| 1,048,576
|
In Republic of Atcoder, there are N prefectures, and a total of M cities that belong to those prefectures. City i is established in year Y_i and belongs to Prefecture P_i. You can assume that there are no multiple cities that are established in the same year. It is decided to allocate a 12-digit ID number to each city. If City i is the x-th established city among the cities that belong to Prefecture i, the first six digits of the ID number of City i is P_i, and the last six digits of the ID number is x. Here, if P_i or x (or both) has less than six digits, zeros are added to the left until it has six digits. Find the ID numbers for all the cities. Note that there can be a prefecture with no cities.
|
['import sys\ndef solve(n,m,a,b):\n ans = ""\n \n #for s1,s2 in a:\n # b[s1-1].append(s2)\n for i in range(len(b)):\n b[i].sort()\n for i in range(m):\n ans += str(a[i][0]).zfill(6) + str(b[a[i][0]-1].index(a[i][1])+1).zfill(6) + "\\n"\n return ans\n\ndef readQuestion():\n ws = sys.stdin.readline().strip().split()\n N = int(ws[0])\n M = int(ws[1])\n ls_PY = []\n ls_b = [[] for i in range(N)]\n for i in range(M):\n p,y = map(int, sys.stdin.readline().strip().split())\n ls_PY.append([p,y])\n ls_b[p-1].append(y)\n #ls_PY = [list(map(int, sys.stdin.readline().strip().split())) for j in range(M)]\n return (N, M, ls_PY, ls_b)\n\ndef main():\n N, M, ls_PY, ls_b = readQuestion()\n answer = solve(N, M, ls_PY, ls_b)\n print(answer)\n\n#if __name__ == \'__main__\':\n# main()', 'import sys\ndef solve(n,m,a):\n bb = {i+1:[] for i in range(n)}\n for [s1,s2] in a:\n bb[s1].append(s2)\n b = [i for i in bb.values()]\n for i in range(len(b)):\n b[i].sort()\n c = {s2:s1 for [s1,s2] in a}\n d = [s2 for [s1,s2] in a]\n\n ans = ""\n for i in range(m):\n\n ken = str(c[d[i]])\n ban = str(b[c[d[i]]-1].index(d[i])+1)\n\n zero = ""\n for i in range(6-len(ken)):\n zero += "0"\n ans += zero\n ans += ken\n zero = ""\n for i in range(6-len(ban)):\n zero += "0"\n ans += zero\n ans += ban\n ans += "\\n"\n \n return ans \ndef readQuestion():\n ws = sys.stdin.readline().strip().split()\n N = int(ws[0])\n M = int(ws[1])\n ls_PY = [list(map(int, sys.stdin.readline().strip().split())) for j in range(N+1)]\n return (N, M, ls_PY)\n\ndef main():\n N, M, ls_PY = readQuestion()\n answer = solve(N, M, ls_PY)\n print(answer)\n\nif __name__ == \'__main__\':\n main()', 'n,m = map(int,input().split( ))\nls_a = []\nls_b = [[] for i in range(n)]\nfor i in range(M):\n p,y = map(int,input().split( ))\n ls_a.append([p,y])\n ls_b[p-1].append(y)\nfor i in range(n):\n ls_b[i].sort()\nfor i in range(m):\n print(str(ls_a[i][0]).zfill(6) + str(ls_b[ls_a[i][0]-1].index(ls_a[i][1])+1).zfill(6))', 'import sys\n\ndef solve(N, T, ls_ct):\n radi={}\n radi2={}\n for line in ls_ct:\n if line[0] not in radi:\n radi[line[1]] = line[0]\n if line[0] not in radi2:\n radi2[line[0]] = [line[1]]\n else:\n radi2[line[0]].append(line[1])\n #print(radi)\n #print(radi2)\n \n re=[i for i in radi2.values()]\n for i in range(len(re)):\n re[i].sort()\n #print(re)\n redic={}\n for i in range(len(re)):\n rank = 1\n for ii in re[i]:\n redic[ii] = rank\n rank += 1\n #print(redic)\n ans = []\n cnt = 0\n for i in radi.keys():\n a = str(radi[i]).zfill(6)\n b = str(redic[i]).zfill(6)\n ans.append(a + b)\n cnt += 1\n #print(radi)\n return \'\\n\'.join(ans)+"\\n"\n\ndef readQuestion():\n ws = sys.stdin.readline().strip().split()\n N = int(ws[0])\n T = int(ws[1])\n ls_ct = [list(map(int, sys.stdin.readline().strip().split())) for j in range(T)]\n return (N, T, ls_ct)\n\ndef main():\n N, M, ls_PY = readQuestion()\n answer = solve(N, M, ls_PY)\n print(answer)\n\nif __name__ == \'__main__\':\n main()', 'import sys\ndef solve(n,m,a):\n ans = ""\n bb = {i+1:[] for i in range(n)}\n for [s1,s2] in a:\n bb[s1].append(s2)\n b = [i for i in bb.values()]\n for i in range(len(b)):\n b[i].sort()\n for i in range(m):\n ans += str(a[i][0]).zfill(6) + str(b[a[i][0]-1].index(a[i][1])+1).zfill(6) + "\\n"\n \n return ans \ndef readQuestion():\n ws = sys.stdin.readline().strip().split()\n N = int(ws[0])\n M = int(ws[1])\n ls_PY = [list(map(int, sys.stdin.readline().strip().split())) for j in range(M)]\n return (N, M, ls_PY)\n\ndef main():\n N, M, ls_PY = readQuestion()\n answer = solve(N, M, ls_PY)\n print(answer)\n\nif __name__ == \'__main__\':\n main()', 'n,m = map(int,input().split( ))\nls_a = []\nls_b = [[] for i in range(n)]\nfor i in range(m):\n p,y = map(int,input().split( ))\n ls_a.append([p,y])\n ls_b[p-1].append(y)\nfor i in range(n):\n if len(a[i]) !=0:\n ls_b[i].sort()\nfor i in range(m):\n print(str(ls_a[i][0]).zfill(6) + str(ls_b[ls_a[i][0]-1].index(ls_a[i][1])+1).zfill(6))', 'import sys\ndef solve(n,m,a):\n ans = ""\n b = [[] for i in range(n)]\n for s1,s2 in a:\n b[s1-1].append(s2)\n for i in range(len(b)):\n b[i].sort()\n zero = ["00000","0000","000","00","0",""]\n for i in range(m):\n ken = str(a[i][0])\n ban = str(b[a[i][0]-1].index(a[i][1])+1)\n ans += zero[len(ken)-1] + ken + zero[len(ban)-1] + ban + "\\n"\n \n return ans \ndef readQuestion():\n ws = sys.stdin.readline().strip().split()\n N = int(ws[0])\n M = int(ws[1])\n ls_PY = [list(map(int, sys.stdin.readline().strip().split())) for j in range(M)]\n return (N, M, ls_PY)\n\ndef main():\n N, M, ls_PY = readQuestion()\n answer = solve(N, M, ls_PY)\n print(answer)\n\nif __name__ == \'__main__\':\n main()', 'n,m = map(int,input().split( ))\nans = ""\nls_a = []\nls_b = [[] for i in range(n)]\nfor i in range(m):\n p,y = map(int,input().split( ))\n ls_a.append([p,y])\n ls_b[p-1].append(y)\nfor i in range(n):\n if len(b[i]) !=0:\n ls_b[i].sort()\nfor i in range(m):\n ans += str(ls_a[i][0]).zfill(6) + str(ls_b[ls_a[i][0]-1].index(ls_a[i][1])+1).zfill(6)+"\\n"\nprint(ans)', 'import sys\ndef solve(n,m,a):\n bb = {i+1:[] for i in range(n)}\n for [s1,s2] in a:\n bb[s1].append(s2)\n b = [i for i in bb.values()]\n for i in range(len(b)):\n b[i].sort()\n c = {s2:s1 for [s1,s2] in a}\n d = [s2 for [s1,s2] in a]\n #print(" a=",a,"\\n","b=",b,"\\n","c=",c,"\\n","d=",d)\n ans = ""\n zero = ["00000","0000","000","00","0",""]\n for i in range(m):\n ken = str(c[d[i]])\n ban = str(b[c[d[i]]-1].index(d[i])+1)\n ans += zero[len(ken)-1] + ken\n ans += zero[len(ban)-1] + ban + "\\n"\n \n return ans \ndef readQuestion():\n ws = sys.stdin.readline().strip().split()\n N = int(ws[0])\n M = int(ws[1])\n ls_PY = [list(map(int, sys.stdin.readline().strip().split())) for j in range(M)]\n return (N, M, ls_PY)\n\ndef main():\n N, M, ls_PY = readQuestion()\n answer = solve(N, M, ls_PY)\n print(answer)\n\nif __name__ == \'__main__\':\n main()', 'import sys\ndef solve(n,m,a,b):\n ans = ""\n \n #for s1,s2 in a:\n # b[s1-1].append(s2)\n for i in range(len(b)):\n b[i].sort()\n for i in range(m):\n ans += str(a[i][0]).zfill(6) + str(b[a[i][0]-1].index(a[i][1])+1).zfill(6) + "\\n"\n return ans\n\ndef readQuestion():\n ws = sys.stdin.readline().strip().split()\n N = int(ws[0])\n M = int(ws[1])\n ls_PY = []\n ls_b = [[] for i in range(N)]\n for i in range(M):\n p,y = map(int, sys.stdin.readline().strip().split())\n ls_PY.append([p,y])\n ls_b[p-1].append(y)\n #ls_PY = [list(map(int, sys.stdin.readline().strip().split())) for j in range(M)]\n return (N, M, ls_PY, ls_b)\n\ndef main():\n N, M, ls_PY, ls_b = readQuestion()\n answer = solve(N, M, ls_PY, ls_b)\n print(answer)\n\nif __name__ == \'__main__\':\n main()', 'n,m = map(int,input().split( ))\nls_a = []\nls_b = [[] for i in range(n)]\nfor i in range(m):\n p,y = map(int,input().split( ))\n ls_a.append([p,y])\n ls_b[p-1].append(y)\nfor i in range(n):\n if len(b[i]) !=0:\n ls_b[i].sort()\nfor i in range(m):\n print(str(ls_a[i][0]).zfill(6) + str(ls_b[ls_a[i][0]-1].index(ls_a[i][1])+1).zfill(6))', 'import sys\n\ndef solve(M,list_PY,list_Y):\n for i in range(M):\n ken = str(list_PY[i][0]).zfill(6)\n ban = str(list_Y[list_PY[i][0]-1].index(list_PY[i][1])+1).zfill(6)\n print(ken + ban)\n\ndef readQuestion():\n N,M = map(int, sys.stdin.readline().strip().split())\n list_PY = []\n list_Y = [[] for i in range(N)]\n \n for i in range(M):\n P,Y = map(int, sys.stdin.readline().strip().split())\n list_PY.append([P,Y])\n list_Y[P-1].append(Y)\n\n for i in range(N):\n if len(list_Y[i]) > 1:\n list_Y[i].sort()\n print("sort",list_Y)\n return (M, list_PY, list_Y)\n\ndef main():\n M, list_PY, list_Y = readQuestion()\n answer = solve(M, list_PY, list_Y)\n return answer\n\nif __name__ == \'__main__\':\n main()\n\n', 'n,m = map(int,input().split( ))\nans = ""\nls_a = []\nls_b = [[] for i in range(n)]\nfor i in range(m):\n p,y = map(int,input().split( ))\n ls_a.append([p,y])\n ls_b[p-1].append(y)\nfor i in range(n):\n if len(ls_b[i]) !=0:\n ls_b[i].sort()\nfor i in range(m):\n ans += str(ls_a[i][0]).zfill(6) + str(ls_b[ls_a[i][0]-1].index(ls_a[i][1])+1).zfill(6)+"\\n"\nprint(ans)', 'import sys\ndef solve():\n ws = sys.stdin.readline().strip().split()\n n = int(ws[0])\n m = int(ws[1])\n ls_a = []\n ls_b = [[] for i in range(n)]\n for i in range(M):\n p,y = map(int, sys.stdin.readline().strip().split())\n ls_a.append([p,y])\n ls_b[p-1].append(y)\n for i in range(n):\n ls_b[i].sort()\n for i in range(m):\n print(str(ls_a[i][0]).zfill(6) + str(ls_b[ls_a[i][0]-1].index(ls_a[i][1])+1).zfill(6))\nsolve()', 'import sys\ndef solve(n,m,a):\n bb = {i+1:[] for i in range(n)}\n for [s1,s2] in a:\n bb[s1].append(s2)\n b = [i for i in bb.values()]\n for i in range(len(b)):\n b[i].sort()\n c = {s2:s1 for [s1,s2] in a}\n d = [s2 for [s1,s2] in a]\n #print(" a=",a,"\\n","b=",b,"\\n","c=",c,"\\n","d=",d)\n ans = ""\n zero = ["00000","0000","000","00","0",""]\n for i in range(m):\n ken = str(c[d[i]])\n ban = str(b[c[d[i]]-1].index(d[i])+1)\n ans += zero[len(ken)-1] + ken + zero[len(ban)-1] + ban + "\\n"\n \n return ans \ndef readQuestion():\n ws = sys.stdin.readline().strip().split()\n N = int(ws[0])\n M = int(ws[1])\n ls_PY = [list(map(int, sys.stdin.readline().strip().split())) for j in range(M)]\n return (N, M, ls_PY)\n\ndef main():\n N, M, ls_PY = readQuestion()\n answer = solve(N, M, ls_PY)\n print(answer)\n\nif __name__ == \'__main__\':\n main()', 'import sys\ndef solve(n,m,a):\n bb = {i+1:[] for i in range(n)}\n for [s1,s2] in a:\n bb[s1].append(s2)\n b = [i for i in bb.values()]\n for i in range(len(b)):\n b[i].sort()\n c = {s2:s1 for [s1,s2] in a}\n ans = ""\n zero = ["00000","0000","000","00","0",""]\n for i in range(m):\n ken = str(c[a[i][1]])\n ban = str(b[c[a[i][1]]-1].index(a[i][1])+1)\n ans += zero[len(ken)-1] + ken + zero[len(ban)-1] + ban + "\\n"\n \n return ans \ndef readQuestion():\n ws = sys.stdin.readline().strip().split()\n N = int(ws[0])\n M = int(ws[1])\n ls_PY = [list(map(int, sys.stdin.readline().strip().split())) for j in range(M)]\n return (N, M, ls_PY)\n\ndef main():\n N, M, ls_PY = readQuestion()\n answer = solve(N, M, ls_PY)\n print(answer)\n\nif __name__ == \'__main__\':\n main()', 'import sys\ndef solve(n,m,a):\n bb = {i+1:[] for i in range(n)}\n for [s1,s2] in a:\n bb[s1].append(s2)\n b = [i for i in bb.values()]\n for i in range(len(b)):\n b[i].sort()\n c = {s2:s1 for [s1,s2] in a}\n d = [s2 for [s1,s2] in a]\n #print(" a=",a,"\\n","b=",b,"\\n","c=",c,"\\n","d=",d)\n ans = ""\n for i in range(m):\n ken = str(c[d[i]])\n ban = str(b[c[d[i]]-1].index(d[i])+1)\n\n zero = ""\n for i in range(6-len(ken)):\n zero += "0"\n ans += zero\n ans += ken\n zero = ""\n for i in range(6-len(ban)):\n zero += "0"\n ans += zero\n ans += ban\n ans += "\\n"\n \n return ans \ndef readQuestion():\n ws = sys.stdin.readline().strip().split()\n N = int(ws[0])\n M = int(ws[1])\n ls_PY = [list(map(int, sys.stdin.readline().strip().split())) for j in range(M)]\n return (N, M, ls_PY)\n\ndef main():\n N, M, ls_PY = readQuestion()\n answer = solve(N, M, ls_PY)\n print(answer)\n\nif __name__ == \'__main__\':\n main()', 'import sys,io\n\nws = sys.stdin.readline().strip().split()\nn = int(ws[0])\nm = int(ws[1])\nls_a = []\nls_b = [[] for i in range(n)]\nfor i in range(M):\n p,y = map(int, sys.stdin.readline().strip().split())\n ls_a.append([p,y])\n ls_b[p-1].append(y)\nfor i in range(n):\n ls_b[i].sort()\nfor i in range(m):\n print(str(ls_a[i][0]).zfill(6) + str(ls_b[ls_a[i][0]-1].index(ls_a[i][1])+1).zfill(6))', 'import sys\ndef solve(n,m,a):\n bb = {i+1:[] for i in range(n)}\n for [s1,s2] in a:\n bb[s1].append(s2)\n b = [i for i in bb.values()]\n for i in range(len(b)):\n b[i].sort()\n c = {s2:s1 for [s1,s2] in a}\n d = [s2 for [s1,s2] in a]\n\n ans = ""\n for i in range(m):\n\n ken = str(c[d[i]])\n ban = str(b[c[d[i]]-1].index(d[i])+1)\n\n zero = ""\n for i in range(6-len(ken)):\n zero += "0"\n ans += zero\n ans += ken\n zero = ""\n for i in range(6-len(ban)):\n zero += "0"\n ans += zero\n ans += ban\n ans += "\\n"\n \n return ans \ndef readQuestion():\n ws = sys.stdin.readline().strip().split()\n N = int(ws[0])\n M = int(ws[1])\n ls_PY = [list(map(int, sys.stdin.readline().strip().split())) for j in range(N+1)]\n return (N, M, ls_PY)\n\ndef main():\n N, M, ls_PY = readQuestion()\n answer = solve(N, M, ls_PY)\n print(answer)\n ', 'import sys\ndef solve(n,m,a):\n ans = ""\n b = [[] for i in range(n)]\n for s1,s2 in a:\n b[s1-1].append(s2)\n for i in range(len(b)):\n b[i].sort()\n for i in range(m):\n ans += str(a[i][0]).zfill(6) + str(b[a[i][0]-1].index(a[i][1])+1).zfill(6) + "\\n"\n \n return ans \ndef readQuestion():\n ws = sys.stdin.readline().strip().split()\n N = int(ws[0])\n M = int(ws[1])\n ls_PY = [list(map(int, sys.stdin.readline().strip().split())) for j in range(M)]\n return (N, M, ls_PY)\n\ndef main():\n N, M, ls_PY = readQuestion()\n answer = solve(N, M, ls_PY)\n print(answer)\n\nif __name__ == \'__main__\':\n main()', 'N,M=map(int,input().split())\nPY=[list(map(int,input().split()))+[i] for i in range(M)] \n \nPY.sort(key= lambda x:x[1])\nnum=[0]*N\nw=[""]*M\n \nfor p,y,i in PY:\n\tnum[p-1]+=1\n\tw[i]=str(p).zfill(6)+str(num[p-1]).zfill(6)\n\nfor i in range(M):\n \tprint(w[i])\n']
|
['Wrong Answer', 'Runtime Error', 'Runtime Error', 'Wrong Answer', 'Time Limit Exceeded', 'Runtime Error', 'Time Limit Exceeded', 'Runtime Error', 'Time Limit Exceeded', 'Time Limit Exceeded', 'Runtime Error', 'Wrong Answer', 'Time Limit Exceeded', 'Runtime Error', 'Time Limit Exceeded', 'Time Limit Exceeded', 'Time Limit Exceeded', 'Runtime Error', 'Wrong Answer', 'Time Limit Exceeded', 'Accepted']
|
['s033201249', 's063976259', 's106186796', 's147296111', 's163818739', 's281738565', 's320802175', 's457912151', 's459705722', 's517730800', 's526712818', 's555012611', 's568791307', 's569639796', 's587158487', 's672928894', 's721474461', 's804086651', 's819292253', 's985475421', 's704550310']
|
[3064.0, 56928.0, 10288.0, 61328.0, 45088.0, 31456.0, 35912.0, 31356.0, 57056.0, 35252.0, 31352.0, 152884.0, 35188.0, 10292.0, 56984.0, 59076.0, 57056.0, 10288.0, 3064.0, 35952.0, 32608.0]
|
[18.0, 2106.0, 38.0, 445.0, 2106.0, 465.0, 2105.0, 468.0, 2107.0, 2105.0, 462.0, 2106.0, 2105.0, 39.0, 2107.0, 2107.0, 2106.0, 37.0, 17.0, 2105.0, 774.0]
|
[860, 994, 321, 1135, 689, 347, 752, 372, 920, 858, 347, 956, 375, 466, 907, 830, 1046, 397, 960, 650, 262]
|
p03221
|
u011062360
| 2,000
| 1,048,576
|
In Republic of Atcoder, there are N prefectures, and a total of M cities that belong to those prefectures. City i is established in year Y_i and belongs to Prefecture P_i. You can assume that there are no multiple cities that are established in the same year. It is decided to allocate a 12-digit ID number to each city. If City i is the x-th established city among the cities that belong to Prefecture i, the first six digits of the ID number of City i is P_i, and the last six digits of the ID number is x. Here, if P_i or x (or both) has less than six digits, zeros are added to the left until it has six digits. Find the ID numbers for all the cities. Note that there can be a prefecture with no cities.
|
['n, m = map(int, input().split())\nlist_PY = [ list(map(int,input().split(" "))) for i in range(m)]\n\nlist_PY.sort(key=lambda x:(x[0], x[1]))\ncnt = 0\nk = 0\n\nfor i in range(m):\n list_P = ["0" for _ in range(6)]\n list_X = ["0" for _ in range(6)]\n l = list_PY[i]\n if l[0] == k:\n cnt += 1\n a = list(str(l[0]))\n b = list(str(cnt))\n for j in range(1, len(a)+1):\n list_P[-j] = a[-j]\n for j in range(1, len(b)+1):\n list_X[-j] = b[-j]\n else:\n k = l[0]\n cnt = 1\n a = list(str(l[0]))\n b = list(str(cnt))\n for j in range(1, len(a)+1):\n list_P[-j] = a[-j]\n for j in range(1, len(b)+1):\n list_X[-j] = b[-j]\n\n c = list_P + list_X\n ans = "".join(c)\n print(ans)', 'n, m = map(int, input().split())\nlist_PY = [ list(map(int,input().split(" "))) for i in range(m)]\n\nfor i in range(m):\n l = list_PY[i]\n l.append(i)\nlist_PY.sort(key=lambda x:(x[0], x[1]))\n\ncnt = 0\nk = 0\nfor i in range(m):\n l = list_PY[i]\n if l[0] == k:\n cnt += 1\n a = len(list(str(l[0])))\n b = "0"*(6 - a) + str(l[0])\n c = len(list(str(cnt)))\n d = "0"*(6 - c) + str(cnt)\n else:\n k = l[0]\n cnt = 1\n a = len(list(str(l[0])))\n b = "0" * (6 - a) + str(l[0])\n c = len(list(str(cnt)))\n d = "0" * (6 - c) + str(cnt)\n l.append(b+d)\n\n\nlist_PY.sort(key=lambda x:x[2])\n\nfor i in range(m):\n print(list_PY[i][3])']
|
['Wrong Answer', 'Accepted']
|
['s570881295', 's395098521']
|
[36100.0, 38692.0]
|
[1221.0, 967.0]
|
[786, 696]
|
p03221
|
u013408661
| 2,000
| 1,048,576
|
In Republic of Atcoder, there are N prefectures, and a total of M cities that belong to those prefectures. City i is established in year Y_i and belongs to Prefecture P_i. You can assume that there are no multiple cities that are established in the same year. It is decided to allocate a 12-digit ID number to each city. If City i is the x-th established city among the cities that belong to Prefecture i, the first six digits of the ID number of City i is P_i, and the last six digits of the ID number is x. Here, if P_i or x (or both) has less than six digits, zeros are added to the left until it has six digits. Find the ID numbers for all the cities. Note that there can be a prefecture with no cities.
|
["import sys\nimport bisect\nn,m=map(int,input().split())\nl=[[int(i) for i in l.split()] for l in sys.stdin]\ns=[[0] for i in range(10**5+1)]\nfor i in l:\n s[i[0]].append(i[1])\nfor i in range(len(s)):\n s[i].sort()\nfor i in l:\n print('{:06}{:06}'.format(i[0],bisect.bisect_left(s[i[0]],i[1]))", "import sys\nn,m=map(int,input().split())\nl=[[int(i) for i in l.split()] for l in sys.stdin]\ns=[[0]*(10**5+1)]\nfor i in l:\n if s[i[0]].append(i[1])\nfor i in range(len(s)):\n s[i].sort()\nfor i in l:\n print('{:0>6}{:0>6}'.format(str(i[0]),str(s[i[0]].index(i[1]))))", "import sys\nimport bisect\nn,m=map(int,input().split())\nl=[[int(i) for i in l.split()] for l in sys.stdin]\ns=[[0] for i in range(10**5+1)]\nfor i in l:\n s[i[0]].append(i[1])\nfor i in range(len(s)):\n s[i].sort()\nfor i in l:\n print('{:06}{:06}'.format(i[0],bisect.bisect_left(s[i[0]],i[1])))"]
|
['Runtime Error', 'Runtime Error', 'Accepted']
|
['s268768814', 's300012222', 's822980732']
|
[3064.0, 2940.0, 35316.0]
|
[17.0, 17.0, 479.0]
|
[288, 263, 289]
|
p03221
|
u017415492
| 2,000
| 1,048,576
|
In Republic of Atcoder, there are N prefectures, and a total of M cities that belong to those prefectures. City i is established in year Y_i and belongs to Prefecture P_i. You can assume that there are no multiple cities that are established in the same year. It is decided to allocate a 12-digit ID number to each city. If City i is the x-th established city among the cities that belong to Prefecture i, the first six digits of the ID number of City i is P_i, and the last six digits of the ID number is x. Here, if P_i or x (or both) has less than six digits, zeros are added to the left until it has six digits. Find the ID numbers for all the cities. Note that there can be a prefecture with no cities.
|
['n,m=map(int,input().split())\nd=[]\nfor i in range(m):\n d.append(list(map(int,input().split())))\n d[i].append(1)\ns=sorted(d)\nk=0\nif m>1:\n for i in range(m-1):\n if s[i][0]==s[i+1][0]:\n s[i][2]=k\n s[i+1][2]=k+1\n k=k+1\n else:\n k=1\n s[i+1][2]=k\n \n for i in range(m):\n ans=1000000000000+d[i][0]*1000000+d[i][2]\n print(str(ans)[1:])\nelse:\n print("000001000001")\n\n', 'n,m=map(int,input().split())\nd=[]\nfor i in range(m):\n d.append(list(map(int,input().split())))\n d[i].append(0)\ns=sorted(d)\nk=1\nif m>1:\n for i in range(m-1):\n if s[i][0]==s[i+1][0]:\n s[i][2]=k\n s[i+1][2]=k+1\n k=k+1\n else:\n k=1\n s[i+1][2]=k\n s[i][2]=k\n \n for i in range(m):\n ans=1000000000000+d[i][0]*1000000+d[i][2]\n print(str(ans)[1:])\n\nelse:\n print("000001000001")\n\n', 'n,m=map(int,input().split())\nd=[]\nfor i in range(m):\n d.append(list(map(int,input().split())))\n d[i].append(1)\ns=sorted(d)\nk=1\nif m>1:\n for i in range(m-1):\n if s[i][0]==s[i+1][0]:\n s[i][2]=k\n s[i+1][2]=k+1\n k=k+1\n else:\n k=1\n s[i+1][2]=k\n \nfor i in range(m):\n ans=1000000000000+d[i][0]*1000000+d[i][2]\n print(str(ans)[1:])\n\n']
|
['Wrong Answer', 'Wrong Answer', 'Accepted']
|
['s696128002', 's729187795', 's848137163']
|
[32680.0, 32776.0, 32788.0]
|
[689.0, 738.0, 720.0]
|
[402, 419, 366]
|
p03221
|
u020390084
| 2,000
| 1,048,576
|
In Republic of Atcoder, there are N prefectures, and a total of M cities that belong to those prefectures. City i is established in year Y_i and belongs to Prefecture P_i. You can assume that there are no multiple cities that are established in the same year. It is decided to allocate a 12-digit ID number to each city. If City i is the x-th established city among the cities that belong to Prefecture i, the first six digits of the ID number of City i is P_i, and the last six digits of the ID number is x. Here, if P_i or x (or both) has less than six digits, zeros are added to the left until it has six digits. Find the ID numbers for all the cities. Note that there can be a prefecture with no cities.
|
['n,m=map(int,input().split())\ncity_list = [[] for _ in range(n)]\n\npy = [list(map(int,input().split())) for _ in range(m)]\n\nfor ppyy in py:\n city_list[ppyy[0]-1].append(ppyy[1])\n\nfor index, ppyy in enumerate(city_list):\n ppyy.sort()\n for index2, pppyyy in enumerate(ppyy):\n print(str(index+1).zfill(6)+str(index2+1).zfill(6))', '#!/usr/bin/env python3\nimport sys\n\n\ndef solve(N: int, M: int, P: "List[int]", Y: "List[int]"):\n hashTable = {}\n\n for i in range(M):\n if hashTable.get(P[i]) == None:\n hashTable[P[i]] = [Y[i]]\n else:\n hashTable[P[i]].append(Y[i])\n \n # Year: idnumber\n answerTable = {}\n\n for key,value in hashTable.items():\n value.sort()\n \n for i,v in enumerate(value):\n answerTable[v] = str(key).zfill(6) + str(i+1).zfill(6)\n \n for i in range(M):\n print(answerTable[Y[i]])\n\n return\n\n\ndef main():\n def iterate_tokens():\n for line in sys.stdin:\n for word in line.split():\n yield word\n tokens = iterate_tokens()\n N = int(next(tokens)) # type: int\n M = int(next(tokens)) # type: int\n P = [int()] * (M) # type: "List[int]"\n Y = [int()] * (M) # type: "List[int]"\n for i in range(M):\n P[i] = int(next(tokens))\n Y[i] = int(next(tokens))\n solve(N, M, P, Y)\n\nif __name__ == \'__main__\':\n main()\n']
|
['Wrong Answer', 'Accepted']
|
['s902851851', 's652200977']
|
[36768.0, 44268.0]
|
[641.0, 432.0]
|
[329, 1045]
|
p03221
|
u020604402
| 2,000
| 1,048,576
|
In Republic of Atcoder, there are N prefectures, and a total of M cities that belong to those prefectures. City i is established in year Y_i and belongs to Prefecture P_i. You can assume that there are no multiple cities that are established in the same year. It is decided to allocate a 12-digit ID number to each city. If City i is the x-th established city among the cities that belong to Prefecture i, the first six digits of the ID number of City i is P_i, and the last six digits of the ID number is x. Here, if P_i or x (or both) has less than six digits, zeros are added to the left until it has six digits. Find the ID numbers for all the cities. Note that there can be a prefecture with no cities.
|
['N,M = map(int,input().split())\nL = []\nfor i in range(M):\n l = list(map(int,input().split()))+[i]\n L.append(l)\ncnt = 0\ntmp = []\nM = sorted(L,key = lambda x: (x[0],x[1]))\nfor x in M:\n if tmp == x[0]:\n x.append(cnt+1)\n cnt += 1\n else:\n tmp = x[0]\n cnt = 0\n x.append(cnt)\nM = sorted(L,key = lambda x:x[2])\nprint(M)\nfor x in M:\n st = str(x[0]).zfill(5)\n st += str(x[3]+1).zfill(5)\n print(st)\n', "import sys\ninput = sys.stdin.readline\nN,M=map(int, input().split())\nL=[ [] for _ in range(N)]\n\nX=[]\nfor _ in range(M):\n a,b = input().split()\n a=int(a)\n b=int(b)\n L[a-1].append(b)\n X.append({a:b})\nY=[ (sorted(L[_])) for _ in range(N) ]\nfor i in range(M) :\n for k,v in X[i].items():\n z='%06d' % \n Z='%06d' % k\n print('%06d%06d' % (k,(Y[k-1].index(v)+1)))\n", 'N,M = map(int,input().split())\nL = []\nfor i in range(M):\n l = list(map(int,input().split()))+[i]\n L.append(l)\ncnt = 0\ntmp = []\nM = sorted(L,key = lambda x: (x[0],x[1]))\nfor x in M:\n if tmp == x[0]:\n x.append(cnt+1)\n cnt += 1\n else:\n tmp = x[0]\n cnt = 0\n x.append(cnt)\nM = sorted(L,key = lambda x:x[2])\n#print(M)\nfor x in M:\n st = str(x[0]).zfill(5)\n st += str(x[3]+1).zfill(5)\n print(st)\n', 'N,M = map(int,input().split())\nL = []\nfor i in range(M):\n l = list(map(int,input().split()))+[i]\n L.append(l)\ncnt = 0\ntmp = []\nM = sorted(L,key = lambda x: (x[0],x[1]))\nfor x in M:\n if tmp == x[0]:\n x.append(cnt+1)\n cnt += 1\n else:\n tmp = x[0]\n cnt = 0\n x.append(cnt)\nM = sorted(L,key = lambda x:x[2])\n#print(M)\nfor x in M:\n st = str(x[0]).zfill(6)\n st += str(x[3]+1).zfill(6)\n print(st)\n']
|
['Wrong Answer', 'Runtime Error', 'Wrong Answer', 'Accepted']
|
['s345058493', 's935732621', 's996033133', 's776719875']
|
[46188.0, 3064.0, 37228.0, 37228.0]
|
[975.0, 18.0, 819.0, 844.0]
|
[443, 393, 444, 444]
|
p03221
|
u020962106
| 2,000
| 1,048,576
|
In Republic of Atcoder, there are N prefectures, and a total of M cities that belong to those prefectures. City i is established in year Y_i and belongs to Prefecture P_i. You can assume that there are no multiple cities that are established in the same year. It is decided to allocate a 12-digit ID number to each city. If City i is the x-th established city among the cities that belong to Prefecture i, the first six digits of the ID number of City i is P_i, and the last six digits of the ID number is x. Here, if P_i or x (or both) has less than six digits, zeros are added to the left until it has six digits. Find the ID numbers for all the cities. Note that there can be a prefecture with no cities.
|
['n,m = map(int,input().split())\nC = [[i, list(map(int,input().split()))] for i in range(m)]\nC.sort(key=lambda x:(x[1][0],x[1][1]))\nD = {}\nrank=1\nfor i in range(m):\n name=C[i][0]\n if i>1 and C[i][1][0] != C[i-1][1][0]:\n rank = 1\n D[name] = str(C[i][1][0]).zfill(6)+str(rank).zfill(6)\n rank+=1\n print(D[name])', 'n,m = map(int,input().split())\nC = [[i, list(map(int,input().split()))] for i in range(m)]\nC.sort(key=lambda x:(x[1][0],x[1][1]))\nD = {}\nprint(C)\nrank=1\nfor i in range(m):\n name=C[i][0]\n if i>1 and C[i][1][0] != C[i-1][1][0]:\n rank = 1\n D[name] = str(C[i][1][0]).zfill(6)+str(rank).zfill(6)\n rank+=1\nfor i in range(m):\n print(D[i])', "N, M = map(int, input().split())\nss = [[] for _ in range(N)]\nfor i in range(M):\n p, y = map(int, input().split())\n ss[p-1].append((i, y))\nls = [''] * M\nfor p in range(N):\n s = ss[p]\n s.sort(key=lambda g: g[1])\n for d, (i, y) in enumerate(s):\n ps = str(p+1).zfill(6)\n ds = str(d+1).zfill(6)\n ls[i] = ps+ds\nfor l in ls:\n print(l)"]
|
['Wrong Answer', 'Wrong Answer', 'Accepted']
|
['s529954902', 's961004119', 's147768709']
|
[54400.0, 59080.0, 35944.0]
|
[827.0, 936.0, 773.0]
|
[328, 353, 366]
|
p03221
|
u023229441
| 2,000
| 1,048,576
|
In Republic of Atcoder, there are N prefectures, and a total of M cities that belong to those prefectures. City i is established in year Y_i and belongs to Prefecture P_i. You can assume that there are no multiple cities that are established in the same year. It is decided to allocate a 12-digit ID number to each city. If City i is the x-th established city among the cities that belong to Prefecture i, the first six digits of the ID number of City i is P_i, and the last six digits of the ID number is x. Here, if P_i or x (or both) has less than six digits, zeros are added to the left until it has six digits. Find the ID numbers for all the cities. Note that there can be a prefecture with no cities.
|
['N,M=map(int,input().split())\nPY=[list(map(int,input().split()))+[i] for i in range(M)] \n\nPY.sort(key= lambda x:x[1])\nnum=[0]*N\nw=[""]*M\n\nfor p,y,i in PY:\n\tnum[p-1]+=1\n\tw[i]=str(p).zfill(6)+str(num[p-1]).zfill(6)\n\nfor a in range(M):\n\tprint(w)', 'N,M=map(int,input().split())\nPY=[list(map(int,input().split()))+[i] for i in range(M)] \n\nPY.sort(key= lambda x:x[1])\nnum=[0]*N\nw=[""]*M\n\nfor p,y,i in PY:\n\tnum[p-1]+=1\n\tw[i]=str(p).zfill(6)+str(num[p-1]).zfill(6)\n\nfor i in range(M):\n \tprint(w[i])\n']
|
['Runtime Error', 'Accepted']
|
['s989921443', 's309072103']
|
[166892.0, 32564.0]
|
[2105.0, 654.0]
|
[254, 260]
|
p03221
|
u036340997
| 2,000
| 1,048,576
|
In Republic of Atcoder, there are N prefectures, and a total of M cities that belong to those prefectures. City i is established in year Y_i and belongs to Prefecture P_i. You can assume that there are no multiple cities that are established in the same year. It is decided to allocate a 12-digit ID number to each city. If City i is the x-th established city among the cities that belong to Prefecture i, the first six digits of the ID number of City i is P_i, and the last six digits of the ID number is x. Here, if P_i or x (or both) has less than six digits, zeros are added to the left until it has six digits. Find the ID numbers for all the cities. Note that there can be a prefecture with no cities.
|
["n, m = map(int, input().split())\n\ncities = {}\n\ndef to_id(x):\n return '0' * (6 - len(str(x))) + str(x)\n\nfor i in range(m):\n p, y = map(int, input().split())\n if p in cities.keys():\n cities[p] += 1\n else:\n cities[p] = 1\n \nfor p in range(1, n+1):\n if p in cities.keys():\n p_id = to_id(p)\n for i in range(cities[p]):\n print(p_id + to_id(i+1))", "n, m = map(int, input().split())\n\ncities = []\nps = {}\n\ndef to_id(x):\n return '0' * (6 - len(str(x))) + str(x)\n\nfor i in range(m):\n p, y = map(int, input().split())\n cities.append([p, y, ''])\n if p in ps.keys():\n ps[p].append([y, i])\n else:\n ps[p] = [[y, i]]\n \nyears = {}\nids = {}\nfor p in ps.keys():\n years[p] = sorted(ps[p], key=lambda x: x[0])\n for i, year in enumerate(years[p]):\n cities[year[1]][2] += to_id(p) + to_id(i+1)\n\nfor i in range(m):\n print(cities[i][2])"]
|
['Wrong Answer', 'Accepted']
|
['s204965765', 's732515639']
|
[15076.0, 75036.0]
|
[593.0, 1301.0]
|
[361, 486]
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.