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
p03325
u362560965
2,000
1,024,000
As AtCoder Beginner Contest 100 is taking place, the office of AtCoder, Inc. is decorated with a sequence of length N, a = {a_1, a_2, a_3, ..., a_N}. Snuke, an employee, would like to play with this sequence. Specifically, he would like to repeat the following operation as many times as possible: For every i satisfying 1 \leq i \leq N, perform one of the following: "divide a_i by 2" and "multiply a_i by 3". Here, choosing "multiply a_i by 3" for every i is not allowed, and the value of a_i after the operation must be an integer. At most how many operations can be performed?
['N = int(input())\na = [int(i) for i in input().split()]\n\ncounter = 0\nfor i in range(N):\n A = a[i]\n while 2 * 2 <= A:\n while A % 2 == 0:\n A /= 2\n counter += 1\n break\nprint(int(counter))\n', 'N = int(input())\na = [int(i) for i in input().split()]\n\ncounter = 0\nfor i in range(N):\n A = a[i]\n while 2 * 2 <= A:\n while A % 2 == 0:\n A /= 2\n counter += 1\n break\nprint(int(counter))\n', 'N = int(input())\na = [int(i) for i in input().split()]\n\ncounter = 0\nfor i in range(N):\n A = a[i]\n while 2 * 2 <= A:\n while A % 2 == 0:\n A = A/2\n counter += 1\n break\nprint(counter)\n', 'N = int(input())\na = [int(i) for i in input().split()]\n\ncounter = 0\nfor i in range(N):\n A = a[i]\n # while 2 * 2 <= A:\n while A % 2 == 0:\n A /= 2\n counter += 1\n # break\nprint(int(counter))\n']
['Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Accepted']
['s131330976', 's283770221', 's384606587', 's548866897']
[4148.0, 4148.0, 4140.0, 4148.0]
[105.0, 120.0, 109.0, 120.0]
[226, 226, 222, 218]
p03325
u364386647
2,000
1,024,000
As AtCoder Beginner Contest 100 is taking place, the office of AtCoder, Inc. is decorated with a sequence of length N, a = {a_1, a_2, a_3, ..., a_N}. Snuke, an employee, would like to play with this sequence. Specifically, he would like to repeat the following operation as many times as possible: For every i satisfying 1 \leq i \leq N, perform one of the following: "divide a_i by 2" and "multiply a_i by 3". Here, choosing "multiply a_i by 3" for every i is not allowed, and the value of a_i after the operation must be an integer. At most how many operations can be performed?
['def resolve():\n N = int(input())\n a = list(map(int, input().split()))\n ans = 0\n for i in a:\n ans += prime_factorize(i).count(2)\n\n print(ans)\n\n return\n\nresolve()', 'def prime_factorize(n):\n a = []\n while n % 2 == 0:\n a.append(2)\n n //= 2\n f = 3\n while f * f <= n:\n if n % f == 0:\n a.append(f)\n n //= f\n else:\n f += 2\n if n != 1:\n a.append(n)\n return a\n\ndef resolve():\n N = int(input())\n a = list(map(int, input().split()))\n ans = 0\n for i in a:\n ans += prime_factorize(i).count(2)\n\n print(ans)\n\n return\n\nresolve()']
['Runtime Error', 'Accepted']
['s669553813', 's231275491']
[9956.0, 10148.0]
[28.0, 1696.0]
[185, 459]
p03325
u368796742
2,000
1,024,000
As AtCoder Beginner Contest 100 is taking place, the office of AtCoder, Inc. is decorated with a sequence of length N, a = {a_1, a_2, a_3, ..., a_N}. Snuke, an employee, would like to play with this sequence. Specifically, he would like to repeat the following operation as many times as possible: For every i satisfying 1 \leq i \leq N, perform one of the following: "divide a_i by 2" and "multiply a_i by 3". Here, choosing "multiply a_i by 3" for every i is not allowed, and the value of a_i after the operation must be an integer. At most how many operations can be performed?
['n = int(input())\nl = list(map(int,input().split()))\ncount = 0\nfor i in l:\n while i % 2 == 0:\n count += 1\n i // 2\nprint(count)', 'n = int(input())\nl = list(map(int,input().split()))\ncount = 0\nfor i in l:\n while i % 2 == 0:\n count += 1\n i //= 2\nprint(count)\n']
['Time Limit Exceeded', 'Accepted']
['s925837478', 's237400080']
[4148.0, 4148.0]
[2107.0, 79.0]
[132, 134]
p03325
u384679440
2,000
1,024,000
As AtCoder Beginner Contest 100 is taking place, the office of AtCoder, Inc. is decorated with a sequence of length N, a = {a_1, a_2, a_3, ..., a_N}. Snuke, an employee, would like to play with this sequence. Specifically, he would like to repeat the following operation as many times as possible: For every i satisfying 1 \leq i \leq N, perform one of the following: "divide a_i by 2" and "multiply a_i by 3". Here, choosing "multiply a_i by 3" for every i is not allowed, and the value of a_i after the operation must be an integer. At most how many operations can be performed?
['N = int(input())\na = [int(input()) for i in range(N) ]\ncount = 0\nfor i in range(N):\n\tfor j in range(len(a)):\n \t\tif a[j] % 2 == 0:\n \t\tcount += 1\n a[j] /= 2\nprint(count)', 'N = int(input())\na = list(map(int, input().split()))\ncount = 0\nfor i in range(N):\n for n in a:\n if n % 2 == 0:\n count += 1\n n /= 2\nprint(count)', 'N = int(input())\na = [int(input()) for i in range(N) ]\ncount = 0\nfor i in range(N):\n\tfor n in a:\n \t\tif n % 2 == 0:\n \t\tcount += 1\n n /= 2\nprint(count)', 'N = int(input())\na = list(map(int, input().split()))\ncount = 0\nfor i in range(N):\n\tfor j in range(N):\n\t\tif a[j] % 2 == 0:\n\t\t\tcount += 1\n\t\t\ta[j] /= 2\n\tprint(a)\nprint(count)', 'N = int(input())\na = list(map(int, input().split()))\nans = 0\nfor i in range(N):\n odd = 0\n if a[i] % 2 != 0:\n odd += 1\n else:\n ans += 1\n if odd == len(a):\n break\nprint(ans)', 'N = int(input())\na = list(map(int, input().split()))\ncount = 0\nfor i in range(N):\n\tfor n in a:\n \t\tif n % 2 == 0:\n \t\tcount += 1\n n /= 2\nprint(count)', 'N = int(input())\na = list(map(int, input().split()))\nans = 0\nwhile True:\n\todd = 0 \n\tfor i in range(len(a)):\n\t\tif a[i] % 2 == 0:\n\t\t\ta[i] /= 2\n\t\t\tans += 1\n\t\telse:\n\t\t\todd += 1\n\tif odd == len(a):\n\t\tbreak\nprint(ans) ']
['Runtime Error', 'Wrong Answer', 'Runtime Error', 'Wrong Answer', 'Wrong Answer', 'Runtime Error', 'Accepted']
['s374552896', 's664817383', 's815767370', 's823611165', 's862599953', 's888377380', 's235585430']
[2940.0, 4148.0, 2940.0, 61884.0, 4148.0, 2940.0, 4148.0]
[17.0, 2104.0, 17.0, 2104.0, 23.0, 17.0, 141.0]
[181, 157, 163, 171, 184, 161, 211]
p03325
u401487574
2,000
1,024,000
As AtCoder Beginner Contest 100 is taking place, the office of AtCoder, Inc. is decorated with a sequence of length N, a = {a_1, a_2, a_3, ..., a_N}. Snuke, an employee, would like to play with this sequence. Specifically, he would like to repeat the following operation as many times as possible: For every i satisfying 1 \leq i \leq N, perform one of the following: "divide a_i by 2" and "multiply a_i by 3". Here, choosing "multiply a_i by 3" for every i is not allowed, and the value of a_i after the operation must be an integer. At most how many operations can be performed?
['i=input;i()\ni(sum([len(bin(a&-a))-3 for a in map(int,i().split())]))\n', 'input()\nprint(sum([len(bin(a&-a))-3 for a in map(int,input().split())]))\n']
['Runtime Error', 'Accepted']
['s733102632', 's066287224']
[9800.0, 9684.0]
[29.0, 34.0]
[69, 73]
p03325
u403331159
2,000
1,024,000
As AtCoder Beginner Contest 100 is taking place, the office of AtCoder, Inc. is decorated with a sequence of length N, a = {a_1, a_2, a_3, ..., a_N}. Snuke, an employee, would like to play with this sequence. Specifically, he would like to repeat the following operation as many times as possible: For every i satisfying 1 \leq i \leq N, perform one of the following: "divide a_i by 2" and "multiply a_i by 3". Here, choosing "multiply a_i by 3" for every i is not allowed, and the value of a_i after the operation must be an integer. At most how many operations can be performed?
['n=int(input())\na=list(map(int,input().split()))\ncnt=0\nfor i in range(n):\n if a[i]%2==0:\n while a[i]%2==0:\n cnt+=1\n a[i]//2\nprint(cnt)', 'n=int(input())\na=list(map(int,input().split()))\ncnt=0\nfor i in range(n):\n if a[i]%2==0:\n b=a[i]\n while b%2==0:\n cnt+=1\n b=b//2\nprint(cnt)\n']
['Time Limit Exceeded', 'Accepted']
['s684013832', 's550768175']
[4148.0, 4148.0]
[2104.0, 81.0]
[147, 155]
p03325
u404629709
2,000
1,024,000
As AtCoder Beginner Contest 100 is taking place, the office of AtCoder, Inc. is decorated with a sequence of length N, a = {a_1, a_2, a_3, ..., a_N}. Snuke, an employee, would like to play with this sequence. Specifically, he would like to repeat the following operation as many times as possible: For every i satisfying 1 \leq i \leq N, perform one of the following: "divide a_i by 2" and "multiply a_i by 3". Here, choosing "multiply a_i by 3" for every i is not allowed, and the value of a_i after the operation must be an integer. At most how many operations can be performed?
['n=int(input())\n\na=list(map(int,input().split()))\nb=[]\n\nfor i in range(n):\n cnt=1\n while (a[i])%(2**cnt)==0:\n cnt+=1\n b.append(cnt-1)\n\nb.sort()\nprint(n*b[-1])', 'n=int(input())\n\na=list(map(int,input().split()))\nb=[]\nsum=0\n\nfor i in range(n):\n cnt=1\n while (a[i])%(2**cnt)==0:\n cnt+=1\n b.append(cnt-1)\n\nfor i in range(n):\n sum=sum+b[i]\n \nprint(sum)']
['Wrong Answer', 'Accepted']
['s124455604', 's296777560']
[4148.0, 4148.0]
[140.0, 139.0]
[163, 193]
p03325
u439333295
2,000
1,024,000
As AtCoder Beginner Contest 100 is taking place, the office of AtCoder, Inc. is decorated with a sequence of length N, a = {a_1, a_2, a_3, ..., a_N}. Snuke, an employee, would like to play with this sequence. Specifically, he would like to repeat the following operation as many times as possible: For every i satisfying 1 \leq i \leq N, perform one of the following: "divide a_i by 2" and "multiply a_i by 3". Here, choosing "multiply a_i by 3" for every i is not allowed, and the value of a_i after the operation must be an integer. At most how many operations can be performed?
['n = int(input())\naas = list(map(int, input().split()))\n\nr = 0\ni = 1\n\nprint(aas)\nwhile True:\n f = False\n for a in aas:\n if a%2**i == 0:\n r += 1\n f = True\n if not f:\n break\n i += 1\nprint(r)\n\n', 'n = int(input())\nas = list(map(int, input().split()))\n\nr = 0\ni = 1\nwhile True:\n for a in as:\n f = False\n if a%2 == 0:\n a /= 2\n r += 1\n f = True\n if not f:\n break\nprint(r)\n ', 'n = int(input())\naas = list(map(int, input().split()))\n\nr = 0\ni = 1\nwhile True:\n f = False\n for a in aas:\n if a%2 == 0:\n a /= 2\n r += 1\n f = True\n if not f:\n break\nprint(r)\n \n', 'n = int(input())\nas = list(map(int, input().split()))\n\nr = 0\ni = 1\nwhile True:\n f = False\n for a in as:\n if a%2 == 0:\n a /= 2\n r += 1\n f = True\n if not f:\n break\nprint(r)\n ', 'n = int(input())\naas = list(map(int, input().split()))\n\nr = 0\ni = 1\n\nwhile True:\n f = False\n for a in aas:\n if a%2**i == 0:\n r += 1\n f = True\n if not f:\n break\n i += 1\nprint(r)\n\n']
['Wrong Answer', 'Runtime Error', 'Time Limit Exceeded', 'Runtime Error', 'Accepted']
['s063101147', 's254025512', 's398609903', 's501314518', 's686755941']
[4148.0, 2940.0, 4148.0, 2940.0, 4148.0]
[143.0, 17.0, 2104.0, 17.0, 147.0]
[209, 203, 200, 197, 198]
p03325
u445380615
2,000
1,024,000
As AtCoder Beginner Contest 100 is taking place, the office of AtCoder, Inc. is decorated with a sequence of length N, a = {a_1, a_2, a_3, ..., a_N}. Snuke, an employee, would like to play with this sequence. Specifically, he would like to repeat the following operation as many times as possible: For every i satisfying 1 \leq i \leq N, perform one of the following: "divide a_i by 2" and "multiply a_i by 3". Here, choosing "multiply a_i by 3" for every i is not allowed, and the value of a_i after the operation must be an integer. At most how many operations can be performed?
['\ndef bunkai(num):\n a = []\n while num % 2 == 0:\n a.append(2)\n num //= 2\n f = 3\n while f * f <= num:\n if num % f == 0:\n a.append(f)\n num //= f\n else:\n f += 2\n a.append(num)\n if len(a) == 1:\n a.append(1)\n return a\ngyouretu = list(map(int, input().split()))\ndst = 0\nfor g in gyouretu:\n for i in bunkai(g):\n if i == 2:\n dst += 1\nprint(dst)\n', '\ndef bunkai(num):\n a = []\n while num % 2 == 0:\n a.append(2)\n num //= 2\n f = 3\n while f * f <= num:\n if num % f == 0:\n a.append(f)\n num //= f\n else:\n f += 2\n a.append(num)\n if len(a) == 1:\n a.append(1)\n return a\n_ = input()\ngyouretu = list(map(int, input().split()))\nprint(gyouretu)\ndst = 0\nfor g in gyouretu:\n for i in bunkai(g):\n if i == 2:\n dst += 1\nprint(dst)\n', 'def bunkai(num):\n count = 0\n while num % 2 == 0:\n count += 1\n num /= 2\n return count\n_ = input()\ngyouretu = list(map(int, input().split()))\ndst = 0\nfor g in gyouretu:\n dst += bunkai(g)\nprint(dst)\n']
['Wrong Answer', 'Wrong Answer', 'Accepted']
['s429896639', 's523531065', 's569709508']
[3064.0, 4148.0, 4148.0]
[17.0, 2104.0, 87.0]
[460, 488, 222]
p03325
u448743361
2,000
1,024,000
As AtCoder Beginner Contest 100 is taking place, the office of AtCoder, Inc. is decorated with a sequence of length N, a = {a_1, a_2, a_3, ..., a_N}. Snuke, an employee, would like to play with this sequence. Specifically, he would like to repeat the following operation as many times as possible: For every i satisfying 1 \leq i \leq N, perform one of the following: "divide a_i by 2" and "multiply a_i by 3". Here, choosing "multiply a_i by 3" for every i is not allowed, and the value of a_i after the operation must be an integer. At most how many operations can be performed?
['n=int(input())\na=[int(i) for i in input().split()]\ncount=0\nfor ai in a:\n while ai%2==0\n ai=ai/2\n count+=1\nprint(count)', 'n=int(input())\na=[int(i) for i in input().split()]\ncount=0\nfor ai in a:\n if ai%2==0:\n while ai!=1:\n ai=ai/=2\n count+=1\nprint(count)', 'n=int(input())\na=[int(i) for i in input().split()]\ncount=0\nfor ai in a:\n while ai%2==0:\n ai=ai/2\n count+=1\nprint(count)\n']
['Runtime Error', 'Runtime Error', 'Accepted']
['s340270208', 's757293477', 's566358658']
[2940.0, 2940.0, 4148.0]
[18.0, 17.0, 119.0]
[147, 163, 149]
p03325
u450904670
2,000
1,024,000
As AtCoder Beginner Contest 100 is taking place, the office of AtCoder, Inc. is decorated with a sequence of length N, a = {a_1, a_2, a_3, ..., a_N}. Snuke, an employee, would like to play with this sequence. Specifically, he would like to repeat the following operation as many times as possible: For every i satisfying 1 \leq i \leq N, perform one of the following: "divide a_i by 2" and "multiply a_i by 3". Here, choosing "multiply a_i by 3" for every i is not allowed, and the value of a_i after the operation must be an integer. At most how many operations can be performed?
['def hoge(num):\n for i in range(num):\n if(num % (2 * i) != 0):\n return i\nn = int(input())\nprint(sum(list(map(lambda x: hoge(int(x)), input().split()))))\n', 'def hoge(num):\n for i in range(10**10):\n if(num % (2 ** i) != 0):\n return i - 1\n \nn = int(input())\nprint(sum(list(map(lambda x: hoge(int(x)), input().split()))))\n']
['Runtime Error', 'Accepted']
['s687701819', 's928819602']
[3828.0, 3828.0]
[18.0, 117.0]
[161, 174]
p03325
u478266845
2,000
1,024,000
As AtCoder Beginner Contest 100 is taking place, the office of AtCoder, Inc. is decorated with a sequence of length N, a = {a_1, a_2, a_3, ..., a_N}. Snuke, an employee, would like to play with this sequence. Specifically, he would like to repeat the following operation as many times as possible: For every i satisfying 1 \leq i \leq N, perform one of the following: "divide a_i by 2" and "multiply a_i by 3". Here, choosing "multiply a_i by 3" for every i is not allowed, and the value of a_i after the operation must be an integer. At most how many operations can be performed?
['import collections\nimport numpy as np\n\ndef prime_factorize(n):\n a = []\n if n%2 ==1:\n\t\ta=0\n \n while n % 2 == 0:\n\t\ta.append(2)\n n //= 2\n return a\n\nN =int(input())\n\na = [int(i) for i in input().split()]\n\nans_array = np.zeros(N)\n\nfor i in range(N):\n dummy = prime_factorize(a[i])\n \n ans_array[i] = dummy\nans = int(sum(ans_array))\nprint(ans)', 'import collections\nimport numpy as np\n\ndef prime_factorize(n):\n\ta = 0 \n\twhile n % 2 == 0:\n\t\ta+=1\n\t\tn //= 2\n\treturn a\n\nN =int(input())\n\na = [int(i) for i in input().split()]\n\nans_array = np.zeros(N)\n\nfor i in range(N):\n dummy = prime_factorize(a[i])\n \n ans_array[i] = dummy\nans = int(sum(ans_array))\nprint(ans)\n']
['Runtime Error', 'Accepted']
['s265836138', 's330897558']
[3060.0, 13188.0]
[18.0, 201.0]
[367, 319]
p03325
u488934106
2,000
1,024,000
As AtCoder Beginner Contest 100 is taking place, the office of AtCoder, Inc. is decorated with a sequence of length N, a = {a_1, a_2, a_3, ..., a_N}. Snuke, an employee, would like to play with this sequence. Specifically, he would like to repeat the following operation as many times as possible: For every i satisfying 1 \leq i \leq N, perform one of the following: "divide a_i by 2" and "multiply a_i by 3". Here, choosing "multiply a_i by 3" for every i is not allowed, and the value of a_i after the operation must be an integer. At most how many operations can be performed?
["def sanbun2(n , al):\n\n ans = 0\n\n for i in al:\n ans += i // 2\n\n return ans\n\ndef main():\n n = int(input())\n al = list(map(int , input().split()))\n print(sanbun2(n , al))\n\nif __name__ == '__main__':\n main()", "def sanbun2(n , al):\n\n ans = 0\n\n for i in al:\n while i % 2 == 0:\n ans += 1\n i /= 2\n\n return ans\n\ndef main():\n n = int(input())\n al = list(map(int , input().split()))\n print(sanbun2(n , al))\n\nif __name__ == '__main__':\n main()"]
['Wrong Answer', 'Accepted']
['s734205468', 's443071869']
[4148.0, 4148.0]
[20.0, 114.0]
[231, 275]
p03325
u495166526
2,000
1,024,000
As AtCoder Beginner Contest 100 is taking place, the office of AtCoder, Inc. is decorated with a sequence of length N, a = {a_1, a_2, a_3, ..., a_N}. Snuke, an employee, would like to play with this sequence. Specifically, he would like to repeat the following operation as many times as possible: For every i satisfying 1 \leq i \leq N, perform one of the following: "divide a_i by 2" and "multiply a_i by 3". Here, choosing "multiply a_i by 3" for every i is not allowed, and the value of a_i after the operation must be an integer. At most how many operations can be performed?
['import math\nN=int(input())\narr=[int(a) for a in input().split()]\nans=0\nfor i in range(N):\n ans=ans+int(math.log2(arr[N]))\n\nprint(ans)\n', 'import math\nN=int(input())\narr=[int(a) for a in input().split()]\nans=0\nfor i in range(N):\n ans=ans+int(math.log2(arr[i]))\n\nprint(ans)\n', 'N=int(input())\narr=[int(a) for a in input().split()]\nans=0\nfor i in range(i):\n c=0\n while arr[i]%2 ==0:\n arr[i]=arr[i]//2\n c=c+1\n ans=ans+c\n\nprint(ans)\n', 'import math\nN=int(input())\narr=[int(a) for a in input().split()]\nans=0\nfor i in range(N):\n ans=ans+math.log2(arr[N])\n\nprint(ans)', 'N=int(input())\narr=[int(a) for a in input().split()]\nans=0\nfor i in range(N):\n c=0\n while arr[i]%2 ==0:\n arr[i]=arr[i]//2\n c=c+1\n ans=ans+c\n\nprint(ans)\n']
['Runtime Error', 'Wrong Answer', 'Runtime Error', 'Runtime Error', 'Accepted']
['s054795060', 's198643063', 's612313846', 's896247045', 's854882695']
[4148.0, 4148.0, 4148.0, 4148.0, 4148.0]
[20.0, 26.0, 20.0, 23.0, 107.0]
[136, 136, 168, 130, 168]
p03325
u503111914
2,000
1,024,000
As AtCoder Beginner Contest 100 is taking place, the office of AtCoder, Inc. is decorated with a sequence of length N, a = {a_1, a_2, a_3, ..., a_N}. Snuke, an employee, would like to play with this sequence. Specifically, he would like to repeat the following operation as many times as possible: For every i satisfying 1 \leq i \leq N, perform one of the following: "divide a_i by 2" and "multiply a_i by 3". Here, choosing "multiply a_i by 3" for every i is not allowed, and the value of a_i after the operation must be an integer. At most how many operations can be performed?
['N = int(input())\nA = list(map(int,input().split()))\nresult = 0\nfor i in A:\n B = A\n while B % 2 == 0:\n result += 1\n B = B // 2\nprint(result)', 'N = int(input())\nA = list(map(int,input().split()))\nresult = 0\nfor i in A:\n B = i\n while B % 2 == 0:\n result += 1\n B = B // 2\nprint(result)\n']
['Runtime Error', 'Accepted']
['s591446313', 's503170103']
[4148.0, 4148.0]
[20.0, 79.0]
[147, 148]
p03325
u518042385
2,000
1,024,000
As AtCoder Beginner Contest 100 is taking place, the office of AtCoder, Inc. is decorated with a sequence of length N, a = {a_1, a_2, a_3, ..., a_N}. Snuke, an employee, would like to play with this sequence. Specifically, he would like to repeat the following operation as many times as possible: For every i satisfying 1 \leq i \leq N, perform one of the following: "divide a_i by 2" and "multiply a_i by 3". Here, choosing "multiply a_i by 3" for every i is not allowed, and the value of a_i after the operation must be an integer. At most how many operations can be performed?
['n=input()\nl=list(map(int,input().split()))\ncount=0\nfor i in range(n):\n num=l[i]\n while num%2==0:\n count+=1\n num=num//2\nprint(count)', 'n=int(input())\nl=list(map(int,input().split()))\ncount=0\nfor i in range(n):\n num=l[i]\n while num%2==0:\n count+=1\n num=num//2\nprint(count)\n']
['Runtime Error', 'Accepted']
['s214705476', 's833986780']
[4148.0, 4148.0]
[20.0, 79.0]
[139, 145]
p03325
u518064858
2,000
1,024,000
As AtCoder Beginner Contest 100 is taking place, the office of AtCoder, Inc. is decorated with a sequence of length N, a = {a_1, a_2, a_3, ..., a_N}. Snuke, an employee, would like to play with this sequence. Specifically, he would like to repeat the following operation as many times as possible: For every i satisfying 1 \leq i \leq N, perform one of the following: "divide a_i by 2" and "multiply a_i by 3". Here, choosing "multiply a_i by 3" for every i is not allowed, and the value of a_i after the operation must be an integer. At most how many operations can be performed?
['n=int(input())\na=list(map(int,input().split()))\ns=0\nfor i in range(a):\n x=0\n while x==0:\n if a[i]%2!=0:\n x=1\n else:\n s+=1\n a[i]/=2\nprint(s)\n ', 'n=int(input())\na=list(map(int,input().split()))\ns=0\nfor i in range(len(a)):\n x=0\n while x==0:\n if a[i]%2!=0:\n x=1\n else:\n s+=1\n a[i]/=2\nprint(s)\n \n\n']
['Runtime Error', 'Accepted']
['s504215419', 's646978110']
[4148.0, 4148.0]
[19.0, 136.0]
[202, 209]
p03325
u527261492
2,000
1,024,000
As AtCoder Beginner Contest 100 is taking place, the office of AtCoder, Inc. is decorated with a sequence of length N, a = {a_1, a_2, a_3, ..., a_N}. Snuke, an employee, would like to play with this sequence. Specifically, he would like to repeat the following operation as many times as possible: For every i satisfying 1 \leq i \leq N, perform one of the following: "divide a_i by 2" and "multiply a_i by 3". Here, choosing "multiply a_i by 3" for every i is not allowed, and the value of a_i after the operation must be an integer. At most how many operations can be performed?
['n=int(input())\na=list(map(int,input().split()))\nm=0\ndef yakusu(x):\n lst=[]\n for i in range(x**(0.5)):\n if x%i==0:\n lst.append(i)\n lst.append(x//i)\n return lst \nfor i in range(n):\n Lst=yakusu(a[i])\n for j in len(Lst):\n while a[j]%2==0:\n a[j]==a[j]//2\n m+=1\nprint(m)\n\n \n', "n=int(input())\na=list(map(int,input().split()))\nb=[]\nm=0\nfor i in range(n):\n b.append(bin(a[i]))\nfor j in range(n):\n b[j]=b[j][2:]\nfor k in range(n):\n m=max(m,sum(map(int,''.join(b[j]))))\nprint(m)\n\n \n", 'n=int(input())\na=list(map(int,input().split()))\nb=[]\nm=0\nc=[]\nfor i in range(n):\n b.append(bin(a[i]))\nfor j in range(n):\n c.append(b[j][2:])\nfor k in range(n):\n m=max(m,sum(list(map(int,c[k]))))\nprint(m)\n\n \n', 'n=int(input())\na=list(map(int,input().split()))\nm=0\ndef yakusu(x):\n lst=[]\n for i in range(x**(0.5)):\n if x%i==0:\n lst.append(i)\n lst.append(x//i)\n return lst \nfor i in range(n):\n for j in range(len(yakusu(a[i]))):\n while yakusu(a[i])[j]%2==0:\n yakusu(a[i])[j]==yakusu(a[i])[j]//2\n m+=1\nprint(m)\n\n \n', "n=int(input())\na=list(map(int,input().split()))\nb=[]\nm=0\nfor i in range(n):\n b.append(bin(a[i]))\nfor j in range(n):\n b[j]=b[j][2:]\nfor k in range(n):\n m=max(m,sum(map(int,''.join(b[j]))))\n\n\n ", 'n=int(input())\na=list(map(int,input().split()))\nb=[]\nm=0\nfor i in range(n):\n b.append(bin(a[i]))\nfor j in range(n):\n b[j]=b[j][2:]\nfor k in range(n):\n m=max(m,sum(list(map(int,b[j]))))\nprint(m)\n\n \n', 'n=int(input())\na=list(map(int,input().split()))\nm=0\ndef yakusu(x):\n lst=[]\n for i in range(1,x**(0.5)+1):\n if x%i==0:\n lst.append(i)\n lst.append(x//i)\n return list(set(lst)) \nfor i in range(n):\n for j in range(len(yakusu(a[i]))):\n while (yakusu(a[i]))[j]%2==0:\n (yakusu(a[i]))[j]==(yakusu(a[i]))[j]//2\n m+=1\nprint(m)\n\n \n', 'n=int(input())\na=list(map(int,input().split()))\nm=0\ndef yakusu(x):\n lst=[]\n for i in range(x**(0.5)):\n if x%i==0:\n lst.append(i)\n lst.append(x//i)\n return lst \nfor i in range(n):\n for j in len(yakusu(a[i])):\n while yakusu(a[i])[j]%2==0:\n yakusu(a[i])[j]==yakusu(a[i])[j]//2\n m+=1\nprint(m)\n\n \n', 'n=int(input())\na=list(map(int,input().split()))\nm=0\nfor i in range(n):\n while a[i]%2==0:\n a[i]==a[i]//2\n m+=a[i]\nprint(m)\n\n \n', 'n=int(input())\na=list(map(int,input().split()))\nm=0\ndef yakusu(x):\n lst=[]\n for i in range(1,x**(0.5)+1):\n if x%i==0:\n lst.append(i)\n lst.append(x//i)\n return lst \nfor i in range(n):\n for j in range(len(yakusu(a[i]))):\n while yakusu(a[i])[j]%2==0:\n yakusu(a[i])[j]==yakusu(a[i])[j]//2\n m+=1\nprint(m)\n\n \n', 'n=int(input())\na=list(map(int,input().split()))\nm=0\ndef yakusu(x):\n lst=[]\n for i in range(1,x**(0.5)+1):\n if x%i==0:\n lst.append(i)\n lst.append(x//i)\n return list(set(lst)) \nfor i in range(n):\n y=yakusu(a[i])\n for j in range(len(y)):\n while y[j]%2==0:\n y[j]==y[j]//2\n m+=1\nprint(m)\n\n \n', 'n=int(input())\na=list(map(int,input().split()))\nm=0\nfor i in range(n):\n while a[i]%2==0:\n a[i]=a[i]//2\n m+=1\nprint(m)\n\n \n']
['Runtime Error', 'Wrong Answer', 'Wrong Answer', 'Runtime Error', 'Wrong Answer', 'Wrong Answer', 'Runtime Error', 'Runtime Error', 'Wrong Answer', 'Runtime Error', 'Runtime Error', 'Accepted']
['s101578074', 's181464642', 's195613818', 's604839226', 's606359904', 's635180452', 's724761194', 's820412174', 's822054333', 's865833192', 's886616728', 's016661523']
[4148.0, 4404.0, 5292.0, 4148.0, 4396.0, 4468.0, 4148.0, 4148.0, 4148.0, 4148.0, 4148.0, 4148.0]
[20.0, 81.0, 77.0, 20.0, 81.0, 76.0, 20.0, 21.0, 2104.0, 20.0, 20.0, 107.0]
[303, 204, 211, 333, 195, 201, 354, 326, 131, 337, 321, 129]
p03325
u527420996
2,000
1,024,000
As AtCoder Beginner Contest 100 is taking place, the office of AtCoder, Inc. is decorated with a sequence of length N, a = {a_1, a_2, a_3, ..., a_N}. Snuke, an employee, would like to play with this sequence. Specifically, he would like to repeat the following operation as many times as possible: For every i satisfying 1 \leq i \leq N, perform one of the following: "divide a_i by 2" and "multiply a_i by 3". Here, choosing "multiply a_i by 3" for every i is not allowed, and the value of a_i after the operation must be an integer. At most how many operations can be performed?
['N = int(input())\na = []\nfor i in range(N):\n a.append(int(input()))\nb = 0\n#print(a)\nfor i in range(N):\n while a[i] %2 == 0:\n b += 1\n a[i] /= 2\nprint(b)', 'N = int(input())\na = list(map(int, input().split()))\nb = 0\nfor i in range(N):\n while a[i] %2 == 0:\n b += 1\n a[i] /= 2\nprint(b)']
['Runtime Error', 'Accepted']
['s663869745', 's514311164']
[3316.0, 4148.0]
[18.0, 140.0]
[170, 143]
p03325
u528124741
2,000
1,024,000
As AtCoder Beginner Contest 100 is taking place, the office of AtCoder, Inc. is decorated with a sequence of length N, a = {a_1, a_2, a_3, ..., a_N}. Snuke, an employee, would like to play with this sequence. Specifically, he would like to repeat the following operation as many times as possible: For every i satisfying 1 \leq i \leq N, perform one of the following: "divide a_i by 2" and "multiply a_i by 3". Here, choosing "multiply a_i by 3" for every i is not allowed, and the value of a_i after the operation must be an integer. At most how many operations can be performed?
['import numpy\nn = input()\na =[int(e) for e in input().split(" ")]\n\na_n = numpy.array(a)\ncount = 0\n\nfor kk in range(10000):\n TF = a_n%2==0\n if any(TF):\n print(a_n)\n tmp = 0\n tmp_i = 0\n for i,j in enumerate(TF): \n if j:\n if tmp <= a_n[i]:\n tmp = a_n[i]\n tmp_i = i\n a_n = a_n * 3\n a_n[tmp_i] = a_n[tmp_i]/6\n if numpy.max(a_n) <= 1000000000:\n count += 1\n else:\n break\n else:\n break\nprint(count)\n \n ', 'n = input()\na =[int(e) for e in input().split(" ")]\n\ncount = 0\nfor i in a:\n tmp = i\n for j in range(10000):\n if tmp%2 == 0:\n tmp /=2\n count += 1\n else:\n break\n\nprint(count)\n \n ']
['Wrong Answer', 'Accepted']
['s789261038', 's422774847']
[13280.0, 4148.0]
[157.0, 122.0]
[569, 241]
p03325
u538739837
2,000
1,024,000
As AtCoder Beginner Contest 100 is taking place, the office of AtCoder, Inc. is decorated with a sequence of length N, a = {a_1, a_2, a_3, ..., a_N}. Snuke, an employee, would like to play with this sequence. Specifically, he would like to repeat the following operation as many times as possible: For every i satisfying 1 \leq i \leq N, perform one of the following: "divide a_i by 2" and "multiply a_i by 3". Here, choosing "multiply a_i by 3" for every i is not allowed, and the value of a_i after the operation must be an integer. At most how many operations can be performed?
['n=int(input())\na=list(map(int,input().split()))\n#print(n)\n#print(a)\ncount=0\nflag=True\nwhile(flag):\n flag=False\n for i in range(n):\n if(a[i]%2==0):\n #print(i)\n #a=list(map(lambda x:x*3,a))\n a[i]=int(a[i]/2)\n print(a)\n count+=1\n flag=True\n break\nprint(count)', 'n=int(input())\na=list(map(int,input().split()))\n#print(n)\n#print(a)\ncount=0\ni=0\nflag=True\nwhile(flag):\n flag=False\n for i in range(n):\n if(flag=True):\n a[i]=a[i]*3\n elif(a[i]%2==0):\n #print(i)\n a[i]=a[i]/2\n count+=1\n flag=True\n else:\n a[i]=a[i]*3\nprint(count)', 'n=int(input())\na=list(map(int,input().split()))\n#print(n)\n#print(a)\ncount=0\nflag=True\nwhile(flag):\n flag=False\n for i in range(n):\n while(a[i]%2==0):\n #print(i)\n #a=list(map(lambda x:x*3,a))\n a[i]=int(a[i]/2)\n #print(a)\n count+=1\n flag=True\n #break\nprint(count)\n\n']
['Runtime Error', 'Runtime Error', 'Accepted']
['s449490943', 's732915362', 's734506538']
[135264.0, 2940.0, 4148.0]
[1384.0, 17.0, 160.0]
[346, 352, 455]
p03325
u539517139
2,000
1,024,000
As AtCoder Beginner Contest 100 is taking place, the office of AtCoder, Inc. is decorated with a sequence of length N, a = {a_1, a_2, a_3, ..., a_N}. Snuke, an employee, would like to play with this sequence. Specifically, he would like to repeat the following operation as many times as possible: For every i satisfying 1 \leq i \leq N, perform one of the following: "divide a_i by 2" and "multiply a_i by 3". Here, choosing "multiply a_i by 3" for every i is not allowed, and the value of a_i after the operation must be an integer. At most how many operations can be performed?
['n=int(input())\na=list(map(int,input().split()))\ns=0\nfor _ i range(n):\n b=a[_]\n while b%2==0:\n b=b/2\n s+=1\nprint(s)', 'n=int(input())\na=list(map(int,input().split()))\ns=0\nfor _ in range(n):\n b=a[_]\n while b%2==0:\n b=b/2\n s+=1\nprint(s)']
['Runtime Error', 'Accepted']
['s303460351', 's978964548']
[3064.0, 4148.0]
[18.0, 113.0]
[122, 123]
p03325
u557523358
2,000
1,024,000
As AtCoder Beginner Contest 100 is taking place, the office of AtCoder, Inc. is decorated with a sequence of length N, a = {a_1, a_2, a_3, ..., a_N}. Snuke, an employee, would like to play with this sequence. Specifically, he would like to repeat the following operation as many times as possible: For every i satisfying 1 \leq i \leq N, perform one of the following: "divide a_i by 2" and "multiply a_i by 3". Here, choosing "multiply a_i by 3" for every i is not allowed, and the value of a_i after the operation must be an integer. At most how many operations can be performed?
['n = int(input())\nf = lambda x: 0 if x % 2 > 0 else 1 + f(x // 2)\nprint((f(int(x)) for x in input().split()))', 'n = int(input())\nf = lambda x: 0 if x % 2 > 0 else 1 + f(x // 2)\nprint(sum(f(int(x)) for x in input().split()))']
['Wrong Answer', 'Accepted']
['s900653587', 's766208693']
[3828.0, 3892.0]
[18.0, 76.0]
[108, 111]
p03325
u560072805
2,000
1,024,000
As AtCoder Beginner Contest 100 is taking place, the office of AtCoder, Inc. is decorated with a sequence of length N, a = {a_1, a_2, a_3, ..., a_N}. Snuke, an employee, would like to play with this sequence. Specifically, he would like to repeat the following operation as many times as possible: For every i satisfying 1 \leq i \leq N, perform one of the following: "divide a_i by 2" and "multiply a_i by 3". Here, choosing "multiply a_i by 3" for every i is not allowed, and the value of a_i after the operation must be an integer. At most how many operations can be performed?
['N=int(input())\nA=list(int, input().split())\ncounter=[]\nfor num in range(N):\n counter.append(0)\nfor num in range(N):\n while A[num]%2=0:\n A[num]=A[num]/2\n counter[num]+=1\nprint(sum(counter))\n ', 'N=int(input())\nA=list(int, input().split())\ncounter=[]\nfor num in range(N):\n counter.append(0)\nfor num in range(N):\n while A[num]%2==0:\n A[num]=A[num]/2\n counter[num]+=1\nprint(sum(counter))\n ', 'N=int(input())\nA=list(int, input().split())\ncounter=[]\nfor num in range(len(A)):\n counter.append(0)\nfor num in range(len(A)):\n while A[num]%2==0:\n A[num]=A[num]/2\n counter[num]+=1\nprint(sum(counter))\n ', 'N=int(input())\nA=list(map(int, input().split()))\ncounter=[]\nfor num in range(len(A)):\n counter.append(0)\nfor num in range(len(A)):\n while A[num]%2==0:\n A[num]=A[num]/2\n counter[num]+=1\nprint(sum(counter))\n ']
['Runtime Error', 'Runtime Error', 'Runtime Error', 'Accepted']
['s280873832', 's353552491', 's915735457', 's434940277']
[8892.0, 9820.0, 9812.0, 10164.0]
[21.0, 24.0, 27.0, 101.0]
[199, 200, 210, 215]
p03325
u570944601
2,000
1,024,000
As AtCoder Beginner Contest 100 is taking place, the office of AtCoder, Inc. is decorated with a sequence of length N, a = {a_1, a_2, a_3, ..., a_N}. Snuke, an employee, would like to play with this sequence. Specifically, he would like to repeat the following operation as many times as possible: For every i satisfying 1 \leq i \leq N, perform one of the following: "divide a_i by 2" and "multiply a_i by 3". Here, choosing "multiply a_i by 3" for every i is not allowed, and the value of a_i after the operation must be an integer. At most how many operations can be performed?
['input()\ndef f(a):\n a = int(a)\n r = 0\n while a % 2 == 0:\n a /= 2\n r += 1\n return r\nprint(sum(map(f,input.split())))', 'input()\ndef f(a):\n a = int(a)\n r = 0\n while a % 2 == 0:\n a /= 2\n r += 1\n return r\nprint(sum(map(f, input().split())))\n']
['Runtime Error', 'Accepted']
['s452436686', 's625563240']
[3060.0, 3884.0]
[17.0, 91.0]
[124, 128]
p03325
u576432509
2,000
1,024,000
As AtCoder Beginner Contest 100 is taking place, the office of AtCoder, Inc. is decorated with a sequence of length N, a = {a_1, a_2, a_3, ..., a_N}. Snuke, an employee, would like to play with this sequence. Specifically, he would like to repeat the following operation as many times as possible: For every i satisfying 1 \leq i \leq N, perform one of the following: "divide a_i by 2" and "multiply a_i by 3". Here, choosing "multiply a_i by 3" for every i is not allowed, and the value of a_i after the operation must be an integer. At most how many operations can be performed?
['def m2p(ai):\n aii=ai\n k=0\n ra=aii%2\n while ra==0 and aii>0:\n k=k+1\n aii=aii//2\n ra=aii%2\n return k \n\nn=int(input())\na=list(map(int,input().split()))\n\nm=0\nfor i in range(n):\n m=m+m2p(a[i])\n print(a[i],m2p(a[i]))\nprint(m)', 'n=int(input())\na=list(map(int,input().split()))\n\nicnt=0\nfor ai in a:\n while ai>0:\n if ai%2==0:\n icnt+=1\n ai=ai//2\n else:\n break\nprint(icnt)\n']
['Wrong Answer', 'Accepted']
['s329504834', 's649911211']
[4240.0, 4148.0]
[122.0, 99.0]
[268, 190]
p03325
u579699847
2,000
1,024,000
As AtCoder Beginner Contest 100 is taking place, the office of AtCoder, Inc. is decorated with a sequence of length N, a = {a_1, a_2, a_3, ..., a_N}. Snuke, an employee, would like to play with this sequence. Specifically, he would like to repeat the following operation as many times as possible: For every i satisfying 1 \leq i \leq N, perform one of the following: "divide a_i by 2" and "multiply a_i by 3". Here, choosing "multiply a_i by 3" for every i is not allowed, and the value of a_i after the operation must be an integer. At most how many operations can be performed?
['def I(): return int(input())\ndef LI(): return list(map(int,input().split()))\n##################################################\nN = I()\na = [x for x in LI() if x%2==0]\nans = 0\nwhile 1:\n if len(a)==0:\n print(ans)\n break\n print(a)\n for i,x in enumerate(a):\n if i==0:\n a[i] /= 2\n a = [x for x in a if x%2==0]\n ans += 1\n', 'def I(): return int(input())\ndef LI(): return list(map(int,input().split()))\n##################################################\nN = I()\na = [x for x in LI() if x%2==0]\nans = 0\nwhile 1:\n if len(a)==0:\n print(ans)\n break\n ans += len(a)\n a = [x/2 for x in a if x/2%2==0]']
['Wrong Answer', 'Accepted']
['s184744245', 's896201859']
[88684.0, 4148.0]
[2104.0, 111.0]
[363, 290]
p03325
u592248346
2,000
1,024,000
As AtCoder Beginner Contest 100 is taking place, the office of AtCoder, Inc. is decorated with a sequence of length N, a = {a_1, a_2, a_3, ..., a_N}. Snuke, an employee, would like to play with this sequence. Specifically, he would like to repeat the following operation as many times as possible: For every i satisfying 1 \leq i \leq N, perform one of the following: "divide a_i by 2" and "multiply a_i by 3". Here, choosing "multiply a_i by 3" for every i is not allowed, and the value of a_i after the operation must be an integer. At most how many operations can be performed?
['#include <stdio.h>\nint main(void){\n int n,i;\n scanf("%d",&n);\n long long a[n],ans=0;\n for(i=0;i<n;i++){\n scanf("%lld",&a[i]);\n }\n for(i=0;i<n;i++){\n while(a[i]%2==0){\n a[i]+=a[i]/2;\n ans++;\n }\n }\n printf("%lld",ans);\n return 0;\n}', 'n = int(input())\na = list(map(int,input().split()))\nans = 0\nfor i in range(n):\n while a[i]%2==0:\n a[i] = a[i]//2\n ans+=1\nprint(ans)']
['Runtime Error', 'Accepted']
['s307297489', 's027622919']
[8876.0, 10064.0]
[24.0, 84.0]
[299, 148]
p03325
u595643170
2,000
1,024,000
As AtCoder Beginner Contest 100 is taking place, the office of AtCoder, Inc. is decorated with a sequence of length N, a = {a_1, a_2, a_3, ..., a_N}. Snuke, an employee, would like to play with this sequence. Specifically, he would like to repeat the following operation as many times as possible: For every i satisfying 1 \leq i \leq N, perform one of the following: "divide a_i by 2" and "multiply a_i by 3". Here, choosing "multiply a_i by 3" for every i is not allowed, and the value of a_i after the operation must be an integer. At most how many operations can be performed?
['def xx(x: int):\n \n counter = 0\n while True:\n x_, _ = divmod(x, 2)\n if x_ == 0:\n return counter\n x, counter = x_, counter + 1\n\nns = list(map(int, input().split()))\nevens = list()\nfor n in ns:\n if n % 2 == 0:\n evens.append(n)\nres = 0\nfor e in evens:\n res += xx(e)\nprint(res)', 'def xx(x: int):\n \n counter = 0\n while True:\n x_, y = divmod(x, 2)\n if y != 0:\n return counter\n x, counter = x_, counter + 1\n\nn = int(input())\nns = list(map(int, input().split()))\n\nres = 0\nfor n in ns:\n res += xx(n)\nprint(res)']
['Wrong Answer', 'Accepted']
['s982419197', 's518896787']
[3064.0, 4148.0]
[17.0, 80.0]
[368, 311]
p03325
u596297663
2,000
1,024,000
As AtCoder Beginner Contest 100 is taking place, the office of AtCoder, Inc. is decorated with a sequence of length N, a = {a_1, a_2, a_3, ..., a_N}. Snuke, an employee, would like to play with this sequence. Specifically, he would like to repeat the following operation as many times as possible: For every i satisfying 1 \leq i \leq N, perform one of the following: "divide a_i by 2" and "multiply a_i by 3". Here, choosing "multiply a_i by 3" for every i is not allowed, and the value of a_i after the operation must be an integer. At most how many operations can be performed?
['n = input()\nlow = list(map(int, input().split()))\nfor i in range(n)\n\tcount = 0\n\ttmp = low[i]\n\twhile tmp % 2 == 0:\n\t\ttmp = tmp % 2 \n\t\tcount = count + 1\n \nprint(count)', 'n=int(input())\n#print(n)\nlow = list(map(int,input().split()))\n#print("INPUT = ")\n#print(low)\ncount = 0\nfor i in range(n):\n\ttmp = int(low[i])\n\twhile tmp % 2 == 0 and tmp !=0:\n\t\ttmp = tmp// 2\n\t\tcount = count + 1\n#\t\tprint("COUNT=", count, "TMP=",tmp)\n#print("ANS = ")\nprint(count)']
['Runtime Error', 'Accepted']
['s031773465', 's394427323']
[2940.0, 4148.0]
[18.0, 93.0]
[172, 277]
p03325
u597374218
2,000
1,024,000
As AtCoder Beginner Contest 100 is taking place, the office of AtCoder, Inc. is decorated with a sequence of length N, a = {a_1, a_2, a_3, ..., a_N}. Snuke, an employee, would like to play with this sequence. Specifically, he would like to repeat the following operation as many times as possible: For every i satisfying 1 \leq i \leq N, perform one of the following: "divide a_i by 2" and "multiply a_i by 3". Here, choosing "multiply a_i by 3" for every i is not allowed, and the value of a_i after the operation must be an integer. At most how many operations can be performed?
['n=int(input())\na=list(map(int,input().split()))\nc=0\nfor i in a:while i%2==0:i,c=i/2,c+1\nprint(c)', 'n=int(input())\na=list(map(int,input().split()))\nc=0\nfor i in a:\n while i%2==0:i,c=i/2,c+1\nprint(c)']
['Runtime Error', 'Accepted']
['s479882023', 's802030489']
[2940.0, 4148.0]
[18.0, 130.0]
[96, 101]
p03325
u600261652
2,000
1,024,000
As AtCoder Beginner Contest 100 is taking place, the office of AtCoder, Inc. is decorated with a sequence of length N, a = {a_1, a_2, a_3, ..., a_N}. Snuke, an employee, would like to play with this sequence. Specifically, he would like to repeat the following operation as many times as possible: For every i satisfying 1 \leq i \leq N, perform one of the following: "divide a_i by 2" and "multiply a_i by 3". Here, choosing "multiply a_i by 3" for every i is not allowed, and the value of a_i after the operation must be an integer. At most how many operations can be performed?
['#include <bits/stdc++.h>\nusing namespace std;\n\nint main(){\n int N;\n int ans = 0;\n for (int i = 0; i < N; i++){\n int A;\n cin >> A;\n while (A%2 == 0){\n ans++;\n A = A/2\n }\n }\n cout << ans << endl;\n}', 'def resolve():\n N = int(input())\n A = list(map(int, input().split()))\n ans = 0\n for i in A:\n while i%2 == 0:\n ans += 1\n i = i//2\n print(ans)', 'def resolve():\n N = int(input())\n A = list(map(int, input().split()))\n ans = 0\n for i in A:\n while i%2 == 0:\n ans += 1\n i = i//2\n print(ans)\nresolve()']
['Runtime Error', 'Wrong Answer', 'Accepted']
['s446840329', 's664230965', 's858059569']
[8860.0, 8944.0, 9964.0]
[26.0, 25.0, 54.0]
[222, 184, 194]
p03325
u607729897
2,000
1,024,000
As AtCoder Beginner Contest 100 is taking place, the office of AtCoder, Inc. is decorated with a sequence of length N, a = {a_1, a_2, a_3, ..., a_N}. Snuke, an employee, would like to play with this sequence. Specifically, he would like to repeat the following operation as many times as possible: For every i satisfying 1 \leq i \leq N, perform one of the following: "divide a_i by 2" and "multiply a_i by 3". Here, choosing "multiply a_i by 3" for every i is not allowed, and the value of a_i after the operation must be an integer. At most how many operations can be performed?
['from functools import lru_cache\nimport sys\nimport numpy as np\n\nsys.setrecursionlimit(10**8)\n\nN = int, input().split()\nX = list(map(int, input().split()))\n\n@lru_cache(maxsize=None)\ndef dp(*x):\n xnum = np.array(x)\n x_seki = xnum.prod()\n result = 0\n while x_seki % 2 == 0:\n x_seki /= 2\n result += 1\n return result - 1\nprint(dp(*X))', "N = input()\nxs = map(int, input().split())\ncnt = lambda n: bin(n)[::-1].find('1')\nprint(sum(cnt(x) for x in xs))"]
['Wrong Answer', 'Accepted']
['s178658748', 's782391545']
[15660.0, 3828.0]
[2108.0, 25.0]
[357, 112]
p03325
u617037231
2,000
1,024,000
As AtCoder Beginner Contest 100 is taking place, the office of AtCoder, Inc. is decorated with a sequence of length N, a = {a_1, a_2, a_3, ..., a_N}. Snuke, an employee, would like to play with this sequence. Specifically, he would like to repeat the following operation as many times as possible: For every i satisfying 1 \leq i \leq N, perform one of the following: "divide a_i by 2" and "multiply a_i by 3". Here, choosing "multiply a_i by 3" for every i is not allowed, and the value of a_i after the operation must be an integer. At most how many operations can be performed?
['N = int(input())\nL = [i for i in map(int,input().split()) if i%2 == 0]\neven = 1\ni = 0\nfor i in range(len(L)):\n even *= L[i]\nwhile even // 2 == 0 and even / 2**i >= 1:\n i += 1\nprint(i)', 'N = int(input())\nL = [i for i in map(int,input().split()) if i%2 == 0]\neven = 1\nj = 0\nprint(L)\nfor i in range(len(L)):\n even *= L[i]\nwhile (even % 2**j == 0):\n j += 1\nprint(j-1)', 'import sys\nimport numpy\nN = int(input())\nL = [i for i in map(int,input().split()) if i%2 == 0]\nL2 = [0 for i in range(len(L))]\nif L == []:\n print(0)\n sys.exit(0)\nfor i in range(len(L)):\n s = 1\n while L[i] % 2**s == 0:\n s += 1\n L2[i] = s-1\nQ = numpy.sum(L2)\nprint(Q)']
['Wrong Answer', 'Wrong Answer', 'Accepted']
['s078443466', 's979096928', 's448756991']
[4136.0, 4144.0, 13200.0]
[91.0, 2104.0, 275.0]
[185, 179, 283]
p03325
u625549378
2,000
1,024,000
As AtCoder Beginner Contest 100 is taking place, the office of AtCoder, Inc. is decorated with a sequence of length N, a = {a_1, a_2, a_3, ..., a_N}. Snuke, an employee, would like to play with this sequence. Specifically, he would like to repeat the following operation as many times as possible: For every i satisfying 1 \leq i \leq N, perform one of the following: "divide a_i by 2" and "multiply a_i by 3". Here, choosing "multiply a_i by 3" for every i is not allowed, and the value of a_i after the operation must be an integer. At most how many operations can be performed?
['import math\n\nN = int(input())\nlists = [ int(v) for v in input().split(" ") ]\n\ntotal = 0\n\nprint(math.log2(10))\n\nfor l in lists:\n if l % 2 == 0:\n while True:\n if l % 2 == 0:\n l = int(l/2)\n total += 1 \n else:\n break\nprint(total)', 'import math\n\nN = int(input())\nlists = [ int(v) for v in input().split(" ") ]\n\ntotal = 0\n\nfor l in lists:\n if l % 2 == 0:\n while True:\n if l % 2 == 0:\n l = int(l/2)\n total += 1 \n else:\n break\nprint(total)']
['Wrong Answer', 'Accepted']
['s713883977', 's552695243']
[10036.0, 10040.0]
[94.0, 92.0]
[265, 243]
p03325
u626337957
2,000
1,024,000
As AtCoder Beginner Contest 100 is taking place, the office of AtCoder, Inc. is decorated with a sequence of length N, a = {a_1, a_2, a_3, ..., a_N}. Snuke, an employee, would like to play with this sequence. Specifically, he would like to repeat the following operation as many times as possible: For every i satisfying 1 \leq i \leq N, perform one of the following: "divide a_i by 2" and "multiply a_i by 3". Here, choosing "multiply a_i by 3" for every i is not allowed, and the value of a_i after the operation must be an integer. At most how many operations can be performed?
['N = int(input())\nA = list(map(int, input().split()))\n\nsum_div = 0\nfor i in range(N):\n temp_div = A[i]\n while True:\n if temp_div%2 == 0:\n sum_div += 1\n temp_div = A[i]//2\n else:\n break\nprint(sum_div)', 'N = int(input())\nA = list(map(int, input().split()))\n\nsum_div = 0\nfor i in range(N):\n temp_div = A[i]\n while True:\n if temp_div%2 == 0:\n sum_div += 1\n temp_div = temp_div//2\n else:\n break\nprint(sum_div)']
['Time Limit Exceeded', 'Accepted']
['s611039304', 's576864936']
[4148.0, 4148.0]
[2104.0, 80.0]
[221, 225]
p03325
u626468554
2,000
1,024,000
As AtCoder Beginner Contest 100 is taking place, the office of AtCoder, Inc. is decorated with a sequence of length N, a = {a_1, a_2, a_3, ..., a_N}. Snuke, an employee, would like to play with this sequence. Specifically, he would like to repeat the following operation as many times as possible: For every i satisfying 1 \leq i \leq N, perform one of the following: "divide a_i by 2" and "multiply a_i by 3". Here, choosing "multiply a_i by 3" for every i is not allowed, and the value of a_i after the operation must be an integer. At most how many operations can be performed?
['n = int(input())\na = list(map(int,input().split()))\n\nans = 10**9\nfor i in range(n):\n cnt = 0\n while(1):\n if a[i]%2==0:\n cnt+=1\n a[i]/=2\n else:\n break\n ans = min(ans,cnt)\n \nprint(ans)', 'n = int(input())\na = list(map(int,input().split()))\n\nans = 0\nfor i in range(n):\n while(1):\n if a[i]%2==0:\n ans+=1\n a[i]/=2\n else:\n break \nprint(ans)']
['Wrong Answer', 'Accepted']
['s374315470', 's257568466']
[4148.0, 4276.0]
[140.0, 124.0]
[241, 200]
p03325
u642528832
2,000
1,024,000
As AtCoder Beginner Contest 100 is taking place, the office of AtCoder, Inc. is decorated with a sequence of length N, a = {a_1, a_2, a_3, ..., a_N}. Snuke, an employee, would like to play with this sequence. Specifically, he would like to repeat the following operation as many times as possible: For every i satisfying 1 \leq i \leq N, perform one of the following: "divide a_i by 2" and "multiply a_i by 3". Here, choosing "multiply a_i by 3" for every i is not allowed, and the value of a_i after the operation must be an integer. At most how many operations can be performed?
['import math\n\nN = int(input())\na = list(map(int,input().split()))\nans = 0\nfor i in a:\n ans += math.log(i,2)\n \n \nprint(ans) ', 'import math\n\nN = int(input())\na = list(map(int,input().split()))\nans = 0\n\nfor i in a:\n while True:\n if i %2==0:\n i = i/2\n ans += 1\n else:\n break\n\nprint(ans)\n ']
['Wrong Answer', 'Accepted']
['s867197790', 's059370762']
[9988.0, 10164.0]
[36.0, 83.0]
[132, 215]
p03325
u652656291
2,000
1,024,000
As AtCoder Beginner Contest 100 is taking place, the office of AtCoder, Inc. is decorated with a sequence of length N, a = {a_1, a_2, a_3, ..., a_N}. Snuke, an employee, would like to play with this sequence. Specifically, he would like to repeat the following operation as many times as possible: For every i satisfying 1 \leq i \leq N, perform one of the following: "divide a_i by 2" and "multiply a_i by 3". Here, choosing "multiply a_i by 3" for every i is not allowed, and the value of a_i after the operation must be an integer. At most how many operations can be performed?
['N,M = map(int,input().split())\nL = list(map(int,input().split()))\nL = sorted(L)\nS = []\nif N >= M:\n print(0)\n exit()\n\nfor i in range(M-1):\n S.append(abs(L[i+1]-L[i]))\n\n S=sorted(S)\nprint(sum(S[0:M-N]))\n\n', 'N,M = map(int,input().split())\nL = list(map(int,input().split()))\nL = sorted(L)\nS = []\nif N >= M:\n\tprint(0)\n\texit()\n\nfor i in range(M-1):\n\tS.append(abs(L[i+1]-L[i]))\nS=sorted(S)\nprint(sum(S[0:M-N]))\n\n', 'N = int(input())\na = list(map(int, input().split()))\nans = 0\n\nfor i in a:\n while True:\n if i % 2 == 0:\n ans += 1\n i //= 2\n else:\n break\nprint(ans)\n']
['Runtime Error', 'Runtime Error', 'Accepted']
['s275586934', 's409212278', 's444038361']
[3060.0, 3060.0, 4148.0]
[17.0, 18.0, 79.0]
[206, 200, 197]
p03325
u655048024
2,000
1,024,000
As AtCoder Beginner Contest 100 is taking place, the office of AtCoder, Inc. is decorated with a sequence of length N, a = {a_1, a_2, a_3, ..., a_N}. Snuke, an employee, would like to play with this sequence. Specifically, he would like to repeat the following operation as many times as possible: For every i satisfying 1 \leq i \leq N, perform one of the following: "divide a_i by 2" and "multiply a_i by 3". Here, choosing "multiply a_i by 3" for every i is not allowed, and the value of a_i after the operation must be an integer. At most how many operations can be performed?
['N = int(input())\nA = list(map(int,input().split()))\nK = 0\nfor i in range(N):\n while True:\n if(A[i]%2==0):\n A[i]==A[i]//2\n K+=1\n else:\n break\nprint(K)', 'N = int(input())\nA = list(map(int,input().split()))\nK = 0\nbreaker = 0\nwhile True:\n if(breaker==0):\n break\n M = len(A)\n n = -1\n while True:\n n+=1\n if(n>=M):\n break\n else:\n if(A[n]%2==0):\n A[n]==A[n]//2\n K+=1\n else:\n del A[n]\n M -= 1\n if(len(A)==0):\n breaker+=1\nprint(K)', 'N = int(input())\nA = list(map(int,input().split()))\nK = 0\nwhile !(len(A)==0):\nfor i in range(len(A)):\n if(A[i]%2==0):\n A[i]==A[i]//2\n K+=1\n else:\n del A[i]\nprint(K)', 'N = int(input())\nA = list(map(int, input().split()))\ncnt = 0\n\nfor i in range(N):\n while A[i] % 2 == 0:\n A[i] = A[i] // 2\n cnt += 1\n\nprint(cnt)\n']
['Time Limit Exceeded', 'Wrong Answer', 'Runtime Error', 'Accepted']
['s536004508', 's963660027', 's986846144', 's106638268']
[4148.0, 4148.0, 2940.0, 4148.0]
[2104.0, 20.0, 17.0, 109.0]
[171, 343, 175, 160]
p03325
u680851063
2,000
1,024,000
As AtCoder Beginner Contest 100 is taking place, the office of AtCoder, Inc. is decorated with a sequence of length N, a = {a_1, a_2, a_3, ..., a_N}. Snuke, an employee, would like to play with this sequence. Specifically, he would like to repeat the following operation as many times as possible: For every i satisfying 1 \leq i \leq N, perform one of the following: "divide a_i by 2" and "multiply a_i by 3". Here, choosing "multiply a_i by 3" for every i is not allowed, and the value of a_i after the operation must be an integer. At most how many operations can be performed?
['n=int(input())\nl=list(map(int, input().split()))\n\nz=[]\nfor i in range(n):\n x,y=0,l[i]\n while y%2==0:\n x+=1\n y=y//2\n else:\n z.append(x)\n break\n\nprint(sum(z))', 'n=int(input())\nl=list(map(int, input().split()))\n\nz=[]\nfor i in range(n):\n x,y=0,l[i]\n while y%2==0:\n x+=1\n y=y//2\n else:\n z.append(x)\n\nprint(sum(z))']
['Wrong Answer', 'Accepted']
['s617427353', 's389978904']
[4148.0, 4148.0]
[20.0, 90.0]
[193, 179]
p03325
u686713618
2,000
1,024,000
As AtCoder Beginner Contest 100 is taking place, the office of AtCoder, Inc. is decorated with a sequence of length N, a = {a_1, a_2, a_3, ..., a_N}. Snuke, an employee, would like to play with this sequence. Specifically, he would like to repeat the following operation as many times as possible: For every i satisfying 1 \leq i \leq N, perform one of the following: "divide a_i by 2" and "multiply a_i by 3". Here, choosing "multiply a_i by 3" for every i is not allowed, and the value of a_i after the operation must be an integer. At most how many operations can be performed?
['D, N = map(int,input().split())\nif D == 2:\n if N < 100:\n print(N*10000)\n else:\n print(1010000)\nelif D == 1:\n if N < 100:\n print(N*100)\n else:\n print(10100)\nelse:\n if N < 100:\n print(N)\n else:\n print(101)\n', 'def time2(n):\n ans = 0\n while n % 2 == 0:\n n /= 2\n ans += 1\n return ans\nN = int(input())\nLA = list(map(int, input().split()))\nsum = sum(map(time2, LA))\nprint(sum)\n']
['Runtime Error', 'Accepted']
['s912410814', 's272652665']
[3060.0, 4148.0]
[17.0, 90.0]
[228, 172]
p03325
u687053495
2,000
1,024,000
As AtCoder Beginner Contest 100 is taking place, the office of AtCoder, Inc. is decorated with a sequence of length N, a = {a_1, a_2, a_3, ..., a_N}. Snuke, an employee, would like to play with this sequence. Specifically, he would like to repeat the following operation as many times as possible: For every i satisfying 1 \leq i \leq N, perform one of the following: "divide a_i by 2" and "multiply a_i by 3". Here, choosing "multiply a_i by 3" for every i is not allowed, and the value of a_i after the operation must be an integer. At most how many operations can be performed?
['\n\nimport math\nimport collections\nN = int(input())\nA = list(map(int, input().split()))\n\ndef trial_division(n):\n \n factor = []\n \n tmp = int(math.sqrt(n)) + 1\n for num in range(2,tmp):\n while n % num == 0:\n n //= num\n factor.append(num)\n \n if not factor:\n return 0\n else:\n factor.append(n)\n counter = collections.Counter(factor)\n return counter[2]\n\nresult = 0\n\nfor a in A:\n if a % 2 != 0: continue\n result += trial_division(a)\n\nprint(result)', '\n\nimport math\nimport collections\nN = int(input())\nA = list(map(int, input().split()))\n\ndef trial_division(n):\n \n counter = 0\n while n % 2 == 0:\n n //= 2\n counter += 1\n return counter\n\nresult = 0\n\nfor a in A:\n if a % 2 != 0: continue\n if a == 2:\n result += 1\n else:\n result += trial_division(a)\n\nprint(result)']
['Wrong Answer', 'Accepted']
['s748157380', 's888607081']
[4532.0, 4524.0]
[2104.0, 65.0]
[607, 365]
p03325
u689322583
2,000
1,024,000
As AtCoder Beginner Contest 100 is taking place, the office of AtCoder, Inc. is decorated with a sequence of length N, a = {a_1, a_2, a_3, ..., a_N}. Snuke, an employee, would like to play with this sequence. Specifically, he would like to repeat the following operation as many times as possible: For every i satisfying 1 \leq i \leq N, perform one of the following: "divide a_i by 2" and "multiply a_i by 3". Here, choosing "multiply a_i by 3" for every i is not allowed, and the value of a_i after the operation must be an integer. At most how many operations can be performed?
['#coding: utf-8\nN = int(input())\nL = list(map(int, input().split()))\n\ncnt = 0\ntri_cnt = 0\n\nmem = 0\n\n\nwhile(tri_cnt != len(L)):\n if(L[mem]%2 == 0):\n mem += 1\n else:\n L[mem] /= 2\n for i in range(len(L)):\n if(i != mem):\n L[i] *= 3\n cnt += 1\n \n for i in range(len(L)):\n if (L[i] % 3 == 0):\n tri_cnt += 1\n\nelse:\n print(cnt)', '#coding: utf-8\nN = int(input())\nL = list(map(int, input().split()))\n\ncnt = 0\nfor i in range(len(L)):\n if(L[i]%2 == 0):\n cnt += 1\n\nans = 2**cnt\n\nprint(ans)', "#coding: utf-8\nN = int(input())\nL = list(map(int, input().split()))\n\ncnt = 0\ntri_cnt = 0\nmem = 0\n\n\nwhile(mem != len(L)):\n if(L[mem]%2 != 0):\n mem += 1\n else:\n L[mem] //= 2\n \n # if(i != mem):\n # L[i] = L[i] * 3\n # print('',end='')\n cnt += 1\n\n # tri_cnt = 0\n \n # if (L[i] % 2 != 0):\n # tri_cnt += 1\nelse:\n print(cnt)"]
['Runtime Error', 'Wrong Answer', 'Accepted']
['s166822979', 's308628135', 's865038301']
[4840.0, 4148.0, 4148.0]
[2104.0, 22.0, 137.0]
[461, 164, 515]
p03325
u690536347
2,000
1,024,000
As AtCoder Beginner Contest 100 is taking place, the office of AtCoder, Inc. is decorated with a sequence of length N, a = {a_1, a_2, a_3, ..., a_N}. Snuke, an employee, would like to play with this sequence. Specifically, he would like to repeat the following operation as many times as possible: For every i satisfying 1 \leq i \leq N, perform one of the following: "divide a_i by 2" and "multiply a_i by 3". Here, choosing "multiply a_i by 3" for every i is not allowed, and the value of a_i after the operation must be an integer. At most how many operations can be performed?
['v=map(int,input().split())\nv=sorted(v)[::-1]\nc=0\ncnt=0\nwhile 1:\n while 1:\n if v[c]%2:break\n cnt+=1\n v[c]/=2\n c+=1 \n if c>=len(v):break\nprint(cnt)\n', 'n=int(input())\nv=map(int,input().split())\nv=sorted(v)[::-1]\nc=0\ncnt=0\nwhile 1:\n while 1:\n if v[c]%2:break\n cnt+=1\n v[c]/=2\n c+=1 \n if c>=n:break\nprint(cnt)\n']
['Wrong Answer', 'Accepted']
['s606547560', 's083150776']
[3060.0, 4148.0]
[18.0, 145.0]
[176, 186]
p03325
u691018832
2,000
1,024,000
As AtCoder Beginner Contest 100 is taking place, the office of AtCoder, Inc. is decorated with a sequence of length N, a = {a_1, a_2, a_3, ..., a_N}. Snuke, an employee, would like to play with this sequence. Specifically, he would like to repeat the following operation as many times as possible: For every i satisfying 1 \leq i \leq N, perform one of the following: "divide a_i by 2" and "multiply a_i by 3". Here, choosing "multiply a_i by 3" for every i is not allowed, and the value of a_i after the operation must be an integer. At most how many operations can be performed?
['n = int(input())\na = list(map(int, input().split()))\nans = 0\nfor i in range(n):\n for j in range(30):\n if a[i]%2 == 0:\n a[i] %= 2\n ans += 1\n else:\n break\nprint(ans)', 'import sys\nread = sys.stdin.buffer.read\nreadline = sys.stdin.buffer.readline\nreadlines = sys.stdin.buffer.readlines\nsys.setrecursionlimit(10 ** 7)\n\nn = int(readline())\na = list(map(int, readline().split()))\ncnt = 0\nfor aa in a:\n for i in range(aa):\n if aa % 2 == 0:\n cnt += 1\n aa //= 2\n else:\n break\nprint(cnt)\n']
['Wrong Answer', 'Accepted']
['s740319077', 's982516292']
[4148.0, 3956.0]
[96.0, 96.0]
[213, 361]
p03325
u693007703
2,000
1,024,000
As AtCoder Beginner Contest 100 is taking place, the office of AtCoder, Inc. is decorated with a sequence of length N, a = {a_1, a_2, a_3, ..., a_N}. Snuke, an employee, would like to play with this sequence. Specifically, he would like to repeat the following operation as many times as possible: For every i satisfying 1 \leq i \leq N, perform one of the following: "divide a_i by 2" and "multiply a_i by 3". Here, choosing "multiply a_i by 3" for every i is not allowed, and the value of a_i after the operation must be an integer. At most how many operations can be performed?
['def divisionCnt(n):\n cnt = 0\n while n % 2 == 0:\n n = n / 2\n cnt += 1\n return cnt\n\nnumbers = [int(i) for i in input().split() if int(i) % 2 == 0]\n\ncnt = 0\nfor n in numbers:\n cnt += divisionCnt(n)\n\nprint(cnt)', 'def divisionCnt(n):\n cnt = 0\n while n % 2 == 0:\n n = n / 2\n cnt += 1\n return cnt\n\nN = int(input())\nnumbers = [int(i) for i in input().split() if int(i) % 2 == 0]\n\ncnt = 0\nfor n in numbers:\n cnt += divisionCnt(n)\n\nprint(cnt)']
['Wrong Answer', 'Accepted']
['s672851442', 's306963536']
[3060.0, 4140.0]
[17.0, 93.0]
[232, 249]
p03325
u711539583
2,000
1,024,000
As AtCoder Beginner Contest 100 is taking place, the office of AtCoder, Inc. is decorated with a sequence of length N, a = {a_1, a_2, a_3, ..., a_N}. Snuke, an employee, would like to play with this sequence. Specifically, he would like to repeat the following operation as many times as possible: For every i satisfying 1 \leq i \leq N, perform one of the following: "divide a_i by 2" and "multiply a_i by 3". Here, choosing "multiply a_i by 3" for every i is not allowed, and the value of a_i after the operation must be an integer. At most how many operations can be performed?
['n = int(input())\nAs = [int(a) for a in input().split()]\nans = 0\nc = 1\nfor a in As:\n if a % c == 0:\n tmp = a // c\n while True:\n if tmp % 2 == 0:\n tmp = tmp // 2\n ans += 1\n c = c * 2\n else:\n break\nprint(ans)', 'def divide(a):\n s = 0\n while True:\n if a % 2 :\n return s\n else:\n a = a // 2\n s += 1\nn = int(input())\nprint(sum([divide(int(a)) for a in input().split()]))']
['Wrong Answer', 'Accepted']
['s969483488', 's105591768']
[4148.0, 3828.0]
[22.0, 56.0]
[250, 177]
p03325
u731253724
2,000
1,024,000
As AtCoder Beginner Contest 100 is taking place, the office of AtCoder, Inc. is decorated with a sequence of length N, a = {a_1, a_2, a_3, ..., a_N}. Snuke, an employee, would like to play with this sequence. Specifically, he would like to repeat the following operation as many times as possible: For every i satisfying 1 \leq i \leq N, perform one of the following: "divide a_i by 2" and "multiply a_i by 3". Here, choosing "multiply a_i by 3" for every i is not allowed, and the value of a_i after the operation must be an integer. At most how many operations can be performed?
['def insu2(n):\n if n == 0:\n return 0\n\n counter = 0\n flag = 0\n while(flag == 0):\n flag = n % 2\n if flag == 0:\n counter += 1\n n = n / 2\n else:\n break\n return counter\n\nip = input().split()\nusdata = []\nc_sum = 0\n\nfor i in ip:\n usdata.append(int(i))\n\nfor i in usdata:\n add = insu2(i)\n c_sum += add\n\nprint(c_sum)\n\n', 'dustshoot = input()\n\ndef insu2(n):\n if n == 0:\n return 0\n\n counter = 0\n flag = 0\n while(flag == 0):\n flag = n % 2\n if flag == 0:\n counter += 1\n n = n / 2\n else:\n break\n return counter\n\nip = input().split()\nusdata = []\nc_sum = 0\n\nfor i in ip:\n usdata.append(int(i))\n\nfor i in usdata:\n add = insu2(i)\n c_sum += add\n\nprint(c_sum)\n\n']
['Wrong Answer', 'Accepted']
['s992290881', 's558690287']
[3060.0, 4148.0]
[17.0, 114.0]
[392, 413]
p03325
u731427834
2,000
1,024,000
As AtCoder Beginner Contest 100 is taking place, the office of AtCoder, Inc. is decorated with a sequence of length N, a = {a_1, a_2, a_3, ..., a_N}. Snuke, an employee, would like to play with this sequence. Specifically, he would like to repeat the following operation as many times as possible: For every i satisfying 1 \leq i \leq N, perform one of the following: "divide a_i by 2" and "multiply a_i by 3". Here, choosing "multiply a_i by 3" for every i is not allowed, and the value of a_i after the operation must be an integer. At most how many operations can be performed?
['def judge():\n four = []\n even = []\n odd = []\n for a in a_list:\n if a % 2 == 1:\n odd.append(a * 3)\n else:\n if a % 4 == 0:\n four.append(a)\n else:\n even.append(a)\n if len(four) > 0:\n odd.append(four.pop() // 2)\n four = [i * 3 for i in four]\n odd.extend(four)\n even = [i * 3 for i in even]\n odd.extend(even)\n else:\n if even:\n odd.append(even.pop() // 2)\n even = [i * 3 for i in even]\n odd.extend(even)\n else:\n return False\n global a_list\n a_list = odd\n return True\n\n\nN = int(input())\na_list = list(map(int, input().split()))\ncnt = 0\nwhile True:\n if judge():\n cnt += 1\n else:\n break\nprint(cnt)\n', 'N = int(input())\na_list = list(map(int, input().split()))\ncnt = 0\nfor a in a_list:\n if a % 2 == 0:\n while a % 2 == 0:\n a /= 2\n cnt += 1\nprint(cnt)\n']
['Time Limit Exceeded', 'Accepted']
['s485896178', 's655194336']
[6124.0, 4148.0]
[2104.0, 110.0]
[806, 179]
p03325
u738898077
2,000
1,024,000
As AtCoder Beginner Contest 100 is taking place, the office of AtCoder, Inc. is decorated with a sequence of length N, a = {a_1, a_2, a_3, ..., a_N}. Snuke, an employee, would like to play with this sequence. Specifically, he would like to repeat the following operation as many times as possible: For every i satisfying 1 \leq i \leq N, perform one of the following: "divide a_i by 2" and "multiply a_i by 3". Here, choosing "multiply a_i by 3" for every i is not allowed, and the value of a_i after the operation must be an integer. At most how many operations can be performed?
['d,n=map(int,input().split())\nprint((n+n//100)*(100**d))', 'n = int(input())\na = list(map(int,input().split()))\nans = 0\nfor i in range(n):\n while a[i] % 2 == 0:\n a[i] //= 2\n ans += 1\nprint(ans)']
['Runtime Error', 'Accepted']
['s944337140', 's876908978']
[2940.0, 4148.0]
[18.0, 96.0]
[55, 150]
p03325
u740284863
2,000
1,024,000
As AtCoder Beginner Contest 100 is taking place, the office of AtCoder, Inc. is decorated with a sequence of length N, a = {a_1, a_2, a_3, ..., a_N}. Snuke, an employee, would like to play with this sequence. Specifically, he would like to repeat the following operation as many times as possible: For every i satisfying 1 \leq i \leq N, perform one of the following: "divide a_i by 2" and "multiply a_i by 3". Here, choosing "multiply a_i by 3" for every i is not allowed, and the value of a_i after the operation must be an integer. At most how many operations can be performed?
['n = int(input())\na = list(map(int,input().split()))\ncnt = 0\nfor i in range(N):\n while a[i] % 2==0:\n a[i] /= 2\n cnt += 1\nprint(cnt)\n', 'n = int(input())\na = list(map(int,input().split()))\ncnt = 0\nfor i in range(n):\n while a[i] % 2==0:\n a[i] /= 2\n cnt += 1\nprint(cnt)\n']
['Runtime Error', 'Accepted']
['s597767466', 's008949165']
[4148.0, 4148.0]
[20.0, 126.0]
[148, 148]
p03325
u746793065
2,000
1,024,000
As AtCoder Beginner Contest 100 is taking place, the office of AtCoder, Inc. is decorated with a sequence of length N, a = {a_1, a_2, a_3, ..., a_N}. Snuke, an employee, would like to play with this sequence. Specifically, he would like to repeat the following operation as many times as possible: For every i satisfying 1 \leq i \leq N, perform one of the following: "divide a_i by 2" and "multiply a_i by 3". Here, choosing "multiply a_i by 3" for every i is not allowed, and the value of a_i after the operation must be an integer. At most how many operations can be performed?
['n = int(input())\na = list(map(int, input().split()))\n\ncount = 0\nfor i in a:\n b = bin(i).rfind("1") - 1\n count += b\n\nprint(count)', 'n = int(input())\na = list(map(int, input().split()))\n\ncount = 0\nfor i in a:\n count += bin(i).rfind("1") - 1\n\nprint(count)', 'n = int(input())\na = list(map(int, input().split()))\na = bin(a)\n\ncount = 0\nfor i in range(n+1):\n b = a[i].rfind(1) - 1\n count += b\n\nprint(count)', 'n = int(input())\na = list(map(int, input().split()))\n\nfor i in a:\n count += bin(i).rfind("1") - 1\n\n print(count)', 'n = int(input())\na = list(map(int, input().split()))\n\nfor i in a:\n count += bin(i).rfind("1") - 1\n\nprint(count)', 'n = int(input())\na = list(map(int, input().split()))\n\ncount = 0\nfor i in a:\n count += len(bin(i)) - bin(i).rfind("1") - 1\n\nprint(count)\n']
['Wrong Answer', 'Wrong Answer', 'Runtime Error', 'Runtime Error', 'Runtime Error', 'Accepted']
['s290371766', 's368388313', 's596217368', 's779185039', 's929350855', 's872329167']
[9992.0, 10060.0, 10084.0, 10160.0, 10060.0, 10080.0]
[36.0, 34.0, 23.0, 29.0, 27.0, 41.0]
[130, 122, 146, 114, 112, 137]
p03325
u759651152
2,000
1,024,000
As AtCoder Beginner Contest 100 is taking place, the office of AtCoder, Inc. is decorated with a sequence of length N, a = {a_1, a_2, a_3, ..., a_N}. Snuke, an employee, would like to play with this sequence. Specifically, he would like to repeat the following operation as many times as possible: For every i satisfying 1 \leq i \leq N, perform one of the following: "divide a_i by 2" and "multiply a_i by 3". Here, choosing "multiply a_i by 3" for every i is not allowed, and the value of a_i after the operation must be an integer. At most how many operations can be performed?
["#-*-coding:utf-8-*-\n\ndef is_all_odd(lists):\n odd_flag = 1\n for i in lists:\n if i % 2 != 0:\n odd_flag *= 1\n else:\n odd_flag *= 0\n if odd_flag == 1:\n return True\n else:\n return False\n\ndef main():\n \n N = int(input())\n a = list(map(int, input().split()))\n print(a)\n\n \n count = 0\n\n while not is_all_odd(a):\n devide_flag = 0\n for i in range(N):\n if a[i] % 2 == 0 and devide_flag == 0:\n a[i] = int(a[i]/2) \n devide_flag = 1\n else:\n a[i] = a[i] * 3\n count += 1\n print(a)\n \n print(count)\n\n\n\n\nif __name__ == '__main__':\n main()", "#-*-coding:utf-8-*-\n\ndef main():\n \n N = int(input())\n a = list(map(int, input().split()))\n\n \n count = 0\n\n for i in a:\n while i % 2 == 0:\n i /= 2\n count += 1 \n \n print(count)\n \nif __name__ == '__main__':\n main()"]
['Runtime Error', 'Accepted']
['s674099075', 's868710108']
[139076.0, 4212.0]
[1764.0, 93.0]
[718, 288]
p03325
u762540523
2,000
1,024,000
As AtCoder Beginner Contest 100 is taking place, the office of AtCoder, Inc. is decorated with a sequence of length N, a = {a_1, a_2, a_3, ..., a_N}. Snuke, an employee, would like to play with this sequence. Specifically, he would like to repeat the following operation as many times as possible: For every i satisfying 1 \leq i \leq N, perform one of the following: "divide a_i by 2" and "multiply a_i by 3". Here, choosing "multiply a_i by 3" for every i is not allowed, and the value of a_i after the operation must be an integer. At most how many operations can be performed?
['def div2(n):\n i=n\n a=0\n while True:\n if i%2!=0:\n return a\n i%=2\n a+=1\n\nn=int(input())\na=list(map(int,input().split()))\nans=0\nfor i in a:\n ans+=div2(i)\nprint(ans)', 'def div2(n):\n i=n\n a=0\n while True:\n if i%2!=0:\n return a\n i//=2\n a+=1\n\nn=int(input())\na=list(map(int,input().split()))\nans=0\nfor i in a:\n ans+=div2(i)\nprint(ans)\n']
['Time Limit Exceeded', 'Accepted']
['s511954461', 's198784875']
[4148.0, 4148.0]
[2104.0, 61.0]
[179, 181]
p03325
u773246942
2,000
1,024,000
As AtCoder Beginner Contest 100 is taking place, the office of AtCoder, Inc. is decorated with a sequence of length N, a = {a_1, a_2, a_3, ..., a_N}. Snuke, an employee, would like to play with this sequence. Specifically, he would like to repeat the following operation as many times as possible: For every i satisfying 1 \leq i \leq N, perform one of the following: "divide a_i by 2" and "multiply a_i by 3". Here, choosing "multiply a_i by 3" for every i is not allowed, and the value of a_i after the operation must be an integer. At most how many operations can be performed?
['N = int(input())\na = map(int, input().split())\n\nSUM = 0\nfor i in range(N):\n while a[i] >= 2 and a % 2 == 0:\n SUM += 1\n a[i] //= 2\n \nprint(SUM)\n\n\n\n\n', 'N = int(input())\na = map(int, input().split())\n\nSUM = 0\nfor i in range(N):\n while a[i] >= 2 and a[i] % 2 == 0:\n SUM += 1\n a[i] //= 2\n \nprint(SUM)\n\n\n\n\n', 'N = int(input())\na = list(map(int, input().split()))\n\nSUM = 0\nfor i in range(N):\n while a[i] >= 2 and a % 2 == 0:\n SUM += 1\n a[i] //= 2\n \nprint(SUM)\n\n\n\n\n', 'N = int(input())\na = list(map(int, input().split()))\n\nSUM = 0\nfor i in range(N):\n while a[i] >= 2 and a[i] % 2 == 0:\n SUM += 1\n a[i] //= 2\n \nprint(SUM)']
['Runtime Error', 'Runtime Error', 'Runtime Error', 'Accepted']
['s135605984', 's218163121', 's531563182', 's314551166']
[3892.0, 3884.0, 4148.0, 4148.0]
[18.0, 18.0, 27.0, 120.0]
[157, 160, 163, 161]
p03325
u779602548
2,000
1,024,000
As AtCoder Beginner Contest 100 is taking place, the office of AtCoder, Inc. is decorated with a sequence of length N, a = {a_1, a_2, a_3, ..., a_N}. Snuke, an employee, would like to play with this sequence. Specifically, he would like to repeat the following operation as many times as possible: For every i satisfying 1 \leq i \leq N, perform one of the following: "divide a_i by 2" and "multiply a_i by 3". Here, choosing "multiply a_i by 3" for every i is not allowed, and the value of a_i after the operation must be an integer. At most how many operations can be performed?
['n = int(input())\na = list(map(int,input().split()))\nans = 0\nfor v in a:\n while a%2 is 0:\n ans += 1\n a /= 2\nprint(ans)', 'n = int(input())\na = list(map(int,input().split()))\nans = 0\nfor v in a:\n while v%2 is 0:\n ans += 1\n v /= 2\nprint(ans)', 'from copy import deepcopy\n\nn = int(input())\na = list(map(int,input().split()))\n\n\ncounter = 0\nwhile(True):\n a.sort()\n\n print(a)\n b = deepcopy(a)\n\n undivided = True\n for i,v in enumerate(b):\n if v%2 is 0 and undivided:\n a[i] = v//2\n undivided = False\n else:\n a[i] = v*3\n \n if undivided:\n break\n else:\n counter += 1\n\nprint(counter)', 'n = int(input())\na = list(map(int,input().split()))\nans = 0\nfor v in a:\n while v%2 == 0:\n ans += 1\n v /= 2\nprint(ans)']
['Runtime Error', 'Wrong Answer', 'Wrong Answer', 'Accepted']
['s007840172', 's692303538', 's724541093', 's834871315']
[4148.0, 4148.0, 88628.0, 4148.0]
[20.0, 24.0, 2104.0, 106.0]
[134, 134, 413, 134]
p03325
u781262926
2,000
1,024,000
As AtCoder Beginner Contest 100 is taking place, the office of AtCoder, Inc. is decorated with a sequence of length N, a = {a_1, a_2, a_3, ..., a_N}. Snuke, an employee, would like to play with this sequence. Specifically, he would like to repeat the following operation as many times as possible: For every i satisfying 1 \leq i \leq N, perform one of the following: "divide a_i by 2" and "multiply a_i by 3". Here, choosing "multiply a_i by 3" for every i is not allowed, and the value of a_i after the operation must be an integer. At most how many operations can be performed?
['n, *A = map(int, input().split())\nans = 0\nfor a in A:\n while True:\n a, r = divmod(a, 2)\n if r:\n break\n ans += 1\nprint(ans)', 'n, *A = map(int, open(0).read().split())\nans = 0\nfor a in A:\n while True:\n a, r = divmod(a, 2)\n if r == 1:\n break\n ans += 1\nprint(ans)']
['Wrong Answer', 'Accepted']
['s792802530', 's604061329']
[3060.0, 4084.0]
[17.0, 101.0]
[137, 149]
p03325
u802772880
2,000
1,024,000
As AtCoder Beginner Contest 100 is taking place, the office of AtCoder, Inc. is decorated with a sequence of length N, a = {a_1, a_2, a_3, ..., a_N}. Snuke, an employee, would like to play with this sequence. Specifically, he would like to repeat the following operation as many times as possible: For every i satisfying 1 \leq i \leq N, perform one of the following: "divide a_i by 2" and "multiply a_i by 3". Here, choosing "multiply a_i by 3" for every i is not allowed, and the value of a_i after the operation must be an integer. At most how many operations can be performed?
["import numpy as np\nN=int(input())\na=list(map(int,input().split()))\nb=np.prod(a,dtype='int64')\ncount=0\nwhile b%2==0:\n if b%2==1 or b==0:\n break\n b/=2\n print(b)\n count+=1\nprint(count)", 'import numpy as np\nN=int(input())\na=list(map(int,input().split()))\nb=np.prod(a)\ncount=0\nwhile b%2==0:\n if b%2==1 or b==0:\n break\n b/=2\n print(b)\n count+=1\nprint(count)\n', 'N=int(input())\na=list(map(int,input().split()))\ncount=0\nfor i in a:\n while i%2==0:\n i/=2\n count+=1\nprint(count)']
['Wrong Answer', 'Wrong Answer', 'Accepted']
['s464486396', 's469855953', 's322097931']
[22292.0, 13400.0, 4148.0]
[333.0, 152.0, 115.0]
[200, 187, 128]
p03325
u802781234
2,000
1,024,000
As AtCoder Beginner Contest 100 is taking place, the office of AtCoder, Inc. is decorated with a sequence of length N, a = {a_1, a_2, a_3, ..., a_N}. Snuke, an employee, would like to play with this sequence. Specifically, he would like to repeat the following operation as many times as possible: For every i satisfying 1 \leq i \leq N, perform one of the following: "divide a_i by 2" and "multiply a_i by 3". Here, choosing "multiply a_i by 3" for every i is not allowed, and the value of a_i after the operation must be an integer. At most how many operations can be performed?
['n = int(input())\nnums = [int(e) for e in input().split()]\ni = 0\ncount = 0\nflag = True\nc3 = len(nums) - 1\nwhile(flag):\n for num in nums:\n if num%2 == 0:\n nums[i] /= 2\n elif(c3):\n nums[i] *= 3\n c3 -= 1\n else:\n flag = False\n i += 1\n i = 0\n if(flag):\n count += 1\nprint(count)', 'n = input()\nlst = [int(e) for e in input().split()]\n\ncount = 0\nm = 0\nf = True\nwhile(f):\n f = False\n for i in range(m,len(lst)):\n if(lst[i]%2 == 0):\n m = i\n f = True\n break\n if(f):\n count += 1\n else:\n break\n\n lst[m] = int(lst[m]/2)\n\nprint(count)']
['Wrong Answer', 'Accepted']
['s449354229', 's942701558']
[4148.0, 4148.0]
[135.0, 336.0]
[359, 313]
p03325
u814608389
2,000
1,024,000
As AtCoder Beginner Contest 100 is taking place, the office of AtCoder, Inc. is decorated with a sequence of length N, a = {a_1, a_2, a_3, ..., a_N}. Snuke, an employee, would like to play with this sequence. Specifically, he would like to repeat the following operation as many times as possible: For every i satisfying 1 \leq i \leq N, perform one of the following: "divide a_i by 2" and "multiply a_i by 3". Here, choosing "multiply a_i by 3" for every i is not allowed, and the value of a_i after the operation must be an integer. At most how many operations can be performed?
['n = int(input())\na = list(map(int,input().split()))\n\nans = 0\nwhile True:\n e_max = max([i for i in a if i % 2 == 0])\n if len(e_max) != 0:\n a = [i / 2 if i == e_max else i * 3 for i in a]\n ans += 1\nprint(ans)\n ', 'n = int(input())\na = list(map(int,input().split()))\n \nans = 0\ne = [i for i in a if i % 2 == 0]\nfor i in e:\n sum = 0\n while True:\n i = i / 2\n sum += 1\n if i % 2 != 0:\n break\n ans += sum\nprint(ans)\n']
['Runtime Error', 'Accepted']
['s512674068', 's918426979']
[4148.0, 4148.0]
[21.0, 109.0]
[217, 213]
p03325
u816428863
2,000
1,024,000
As AtCoder Beginner Contest 100 is taking place, the office of AtCoder, Inc. is decorated with a sequence of length N, a = {a_1, a_2, a_3, ..., a_N}. Snuke, an employee, would like to play with this sequence. Specifically, he would like to repeat the following operation as many times as possible: For every i satisfying 1 \leq i \leq N, perform one of the following: "divide a_i by 2" and "multiply a_i by 3". Here, choosing "multiply a_i by 3" for every i is not allowed, and the value of a_i after the operation must be an integer. At most how many operations can be performed?
['for i in a:\n while i%2==0:\n i/=2\n ans+=1\n\nprint(ans)', 'n=int(input())\na=list(map(int,input().split()))\nans=0\n\nfor i in a:\n while i%2==0:\n i/=2\n ans+=1\n\nprint(ans)']
['Runtime Error', 'Accepted']
['s498093109', 's162343816']
[2940.0, 4148.0]
[17.0, 111.0]
[69, 124]
p03325
u818213347
2,000
1,024,000
As AtCoder Beginner Contest 100 is taking place, the office of AtCoder, Inc. is decorated with a sequence of length N, a = {a_1, a_2, a_3, ..., a_N}. Snuke, an employee, would like to play with this sequence. Specifically, he would like to repeat the following operation as many times as possible: For every i satisfying 1 \leq i \leq N, perform one of the following: "divide a_i by 2" and "multiply a_i by 3". Here, choosing "multiply a_i by 3" for every i is not allowed, and the value of a_i after the operation must be an integer. At most how many operations can be performed?
['N = int(input())\nA = list(map(int,input().split()))\ncnt = 0\n\nfor i in range(N):\n while A[i]%2 == 0:\n cnt += 1\n\nprint(cnt)\n ', 'N = int(input())\nA = list(map(int,input().split()))\ncnt = 0\n \nfor i in range(N):\n while A[i]%2 == 0:\n A[i] = A[i]/2\n cnt += 1\n \nprint(cnt)']
['Time Limit Exceeded', 'Accepted']
['s559081052', 's829931458']
[9912.0, 10136.0]
[2206.0, 102.0]
[130, 148]
p03325
u831752983
2,000
1,024,000
As AtCoder Beginner Contest 100 is taking place, the office of AtCoder, Inc. is decorated with a sequence of length N, a = {a_1, a_2, a_3, ..., a_N}. Snuke, an employee, would like to play with this sequence. Specifically, he would like to repeat the following operation as many times as possible: For every i satisfying 1 \leq i \leq N, perform one of the following: "divide a_i by 2" and "multiply a_i by 3". Here, choosing "multiply a_i by 3" for every i is not allowed, and the value of a_i after the operation must be an integer. At most how many operations can be performed?
['def ct_2(n):\n ct=0\n while n>0:\n n//=2\n ct+=1\n return ct\n\ninput()\na=list(map(int,input().split()))\nans=0\nfor num in a:\n ans+=ct_2(num)\nprint(ans)', 'def ct_2(n):\n ct=0\n while n%2==0:\n n//=2\n ct+=1\n return ct\n\ninput()\na=list(map(int,input().split()))\nans=0\nfor num in a:\n ans+=ct_2(num)\nprint(ans)']
['Wrong Answer', 'Accepted']
['s099024193', 's508645844']
[4148.0, 4148.0]
[49.0, 61.0]
[154, 157]
p03325
u838674605
2,000
1,024,000
As AtCoder Beginner Contest 100 is taking place, the office of AtCoder, Inc. is decorated with a sequence of length N, a = {a_1, a_2, a_3, ..., a_N}. Snuke, an employee, would like to play with this sequence. Specifically, he would like to repeat the following operation as many times as possible: For every i satisfying 1 \leq i \leq N, perform one of the following: "divide a_i by 2" and "multiply a_i by 3". Here, choosing "multiply a_i by 3" for every i is not allowed, and the value of a_i after the operation must be an integer. At most how many operations can be performed?
['res = 0\nfor a in A:\n count = 0\n while True:\n if a % 2 == 0:\n count += 1\n a = a / 2\n else:\n break\n res += count', 'import sys\nN = int(input())\nA = list( map(int,input().split()))\n\nres = 0\nfor a in A:\n count = 0\n while True:\n if a % 2 == 0:\n count += 1\n a = a / 2\n else:\n break\n res += count\nprint(res)']
['Runtime Error', 'Accepted']
['s408294597', 's299745919']
[2940.0, 4148.0]
[23.0, 117.0]
[166, 242]
p03325
u855380359
2,000
1,024,000
As AtCoder Beginner Contest 100 is taking place, the office of AtCoder, Inc. is decorated with a sequence of length N, a = {a_1, a_2, a_3, ..., a_N}. Snuke, an employee, would like to play with this sequence. Specifically, he would like to repeat the following operation as many times as possible: For every i satisfying 1 \leq i \leq N, perform one of the following: "divide a_i by 2" and "multiply a_i by 3". Here, choosing "multiply a_i by 3" for every i is not allowed, and the value of a_i after the operation must be an integer. At most how many operations can be performed?
['n = int(input())\na = list(map(int, input().split()))\nans = 0\n\nfor i in range(n):\n while a[i] % 2 == 0:\n a[i] = a[i]/2\n ans = 1\nprint(ans)', 'n = int(input())\na = list(map(int, input().split()))\nans = 0\n \nfor i in range(n):\n while a[i] % 2 == 0:\n a[i] = a[i]/2\n ans += 1\nprint(ans)']
['Wrong Answer', 'Accepted']
['s229709006', 's529211106']
[4148.0, 4212.0]
[133.0, 155.0]
[144, 146]
p03325
u855985627
2,000
1,024,000
As AtCoder Beginner Contest 100 is taking place, the office of AtCoder, Inc. is decorated with a sequence of length N, a = {a_1, a_2, a_3, ..., a_N}. Snuke, an employee, would like to play with this sequence. Specifically, he would like to repeat the following operation as many times as possible: For every i satisfying 1 \leq i \leq N, perform one of the following: "divide a_i by 2" and "multiply a_i by 3". Here, choosing "multiply a_i by 3" for every i is not allowed, and the value of a_i after the operation must be an integer. At most how many operations can be performed?
["n=int(input())\na=[int(i) for i in input().split(' ')]\ndiv2=a\nfor i in range(n):\n j=0\n while(True):\n if div2[i]%2==0:\n j+=1\n div2=div2[i]//2\n else:\n div2[i]=j\n break\nprint(sum(div2))", "n=int(input())\na=[int(i) for i in input().split(' ')]\nfor i in range(n):\n j=0\n while(True):\n if a[i]%2==0:\n j+=1\n a[i]=a[i]//2\n else:\n a[i]=j\n break\nprint(sum(a))"]
['Runtime Error', 'Accepted']
['s624522450', 's113297644']
[4148.0, 4148.0]
[21.0, 106.0]
[209, 190]
p03325
u857330600
2,000
1,024,000
As AtCoder Beginner Contest 100 is taking place, the office of AtCoder, Inc. is decorated with a sequence of length N, a = {a_1, a_2, a_3, ..., a_N}. Snuke, an employee, would like to play with this sequence. Specifically, he would like to repeat the following operation as many times as possible: For every i satisfying 1 \leq i \leq N, perform one of the following: "divide a_i by 2" and "multiply a_i by 3". Here, choosing "multiply a_i by 3" for every i is not allowed, and the value of a_i after the operation must be an integer. At most how many operations can be performed?
['def count(n):\n p=0\n while n%2==0:\n p+=1\n return(p)\n\nn=int(input())\nl=list(map(int,input().split()))\ncount=0\nfor i in range(n):\n count+=count(l[i])\nprint(count)', 'def count(n):\n p=0\n while n%2==0:\n p+=1\n n=n//2\n return(p)\n\nn=int(input())\nl=list(map(int,input().split()))\nsum=0\nfor i in range(n):\n sum+=count(l[i])\nprint(sum)']
['Runtime Error', 'Accepted']
['s632700834', 's680477697']
[4148.0, 4148.0]
[20.0, 61.0]
[166, 171]
p03325
u858523893
2,000
1,024,000
As AtCoder Beginner Contest 100 is taking place, the office of AtCoder, Inc. is decorated with a sequence of length N, a = {a_1, a_2, a_3, ..., a_N}. Snuke, an employee, would like to play with this sequence. Specifically, he would like to repeat the following operation as many times as possible: For every i satisfying 1 \leq i \leq N, perform one of the following: "divide a_i by 2" and "multiply a_i by 3". Here, choosing "multiply a_i by 3" for every i is not allowed, and the value of a_i after the operation must be an integer. At most how many operations can be performed?
['# input \nn = map(int, input())\na = map(int, input().split(" "))\n\n# make list \ncurlist = list(a)\n\n\ndef sunukeList(curlist, cnt) :\n print("DBG : ", curlist)\n reslist = []\n flg_div2 = 0\n flg_did3 = 0\n\n for i in curlist : \n # if divisible by two then divide\n if i%2 == 0 and flg_div2 == 0: \n reslist.append(int(i/2))\n flg_div2 = 1\n else :\n reslist.append(i*3)\n flg_did3 = 1\n\n if flg_div2 == 0 :\n print(cnt)\n else :\n sunukeList(reslist, cnt + 1)\n \n# calc\nsunukeList(curlist, 0)\n', 'N = int(input())\na = list(map(int, input().split()))\n\ncnt = 0\nfor i in range(N) :\n while a[i] >= 2 and a[i] % 2 == 0 :\n cnt += 1\n a[i] //= 2\n \nprint(cnt)']
['Runtime Error', 'Accepted']
['s765641055', 's949531974']
[281668.0, 4148.0]
[1533.0, 122.0]
[595, 177]
p03325
u860002137
2,000
1,024,000
As AtCoder Beginner Contest 100 is taking place, the office of AtCoder, Inc. is decorated with a sequence of length N, a = {a_1, a_2, a_3, ..., a_N}. Snuke, an employee, would like to play with this sequence. Specifically, he would like to repeat the following operation as many times as possible: For every i satisfying 1 \leq i \leq N, perform one of the following: "divide a_i by 2" and "multiply a_i by 3". Here, choosing "multiply a_i by 3" for every i is not allowed, and the value of a_i after the operation must be an integer. At most how many operations can be performed?
["N = int(input())\na = list(map(int, input().split()))\n\ndef cnt(n):\n return format(n, 'b')[::-1].find('1')\n\nsum(list(map(cnt, a)))", "N = int(input())\na = list(map(int, input().split()))\n\ndef cnt(n):\n return format(n, 'b')[::-1].find('1')\n\nprint(sum(list(map(cnt, a))))"]
['Wrong Answer', 'Accepted']
['s590433863', 's245954872']
[4148.0, 4148.0]
[26.0, 27.0]
[131, 138]
p03325
u864900001
2,000
1,024,000
As AtCoder Beginner Contest 100 is taking place, the office of AtCoder, Inc. is decorated with a sequence of length N, a = {a_1, a_2, a_3, ..., a_N}. Snuke, an employee, would like to play with this sequence. Specifically, he would like to repeat the following operation as many times as possible: For every i satisfying 1 \leq i \leq N, perform one of the following: "divide a_i by 2" and "multiply a_i by 3". Here, choosing "multiply a_i by 3" for every i is not allowed, and the value of a_i after the operation must be an integer. At most how many operations can be performed?
['import math\nn = input()\na = list(map(int, input().split()))\nans = float("inf")\nfor i in a:\n ans = max(ans, len(bin(i)) - bin(i).rfind("1") - 1)\nprint(round(ans))', 'import math\nn = input()\na = list(map(int, input().split()))\nans = float("inf")\nfor i in a:\n ans = ans + (len(bin(i)) - bin(i).rfind("1") - 1)\nprint(round(ans))', 'import math\nn = input()\na = list(map(int, input().split()))\nans = float("inf")\nfor i in a:\n ans = min(ans, len(bin(i)) - bin(i).rfind("1") - 1)\nprint(round(ans))', 'import math\nn = input()\na = list(map(int, input().split()))\nans = 0\nfor i in a:\n ans = ans + (len(bin(i)) - bin(i).rfind("1") - 1)\nprint(round(ans))\n']
['Runtime Error', 'Runtime Error', 'Wrong Answer', 'Accepted']
['s646727842', 's766275035', 's960503943', 's113949424']
[4148.0, 4148.0, 4148.0, 4148.0]
[28.0, 27.0, 28.0, 26.0]
[164, 162, 164, 152]
p03325
u867069435
2,000
1,024,000
As AtCoder Beginner Contest 100 is taking place, the office of AtCoder, Inc. is decorated with a sequence of length N, a = {a_1, a_2, a_3, ..., a_N}. Snuke, an employee, would like to play with this sequence. Specifically, he would like to repeat the following operation as many times as possible: For every i satisfying 1 \leq i \leq N, perform one of the following: "divide a_i by 2" and "multiply a_i by 3". Here, choosing "multiply a_i by 3" for every i is not allowed, and the value of a_i after the operation must be an integer. At most how many operations can be performed?
['print(sum(list(map(lambda n: len(bin(n)) - len(bin(n).rstrip("0")), list(map(int, input().split()))))))', '_ = input()\nprint(sum(map(lambda n: len(bin(n)) - len(bin(n).rstrip("0")), list(map(int, input().split())))))']
['Wrong Answer', 'Accepted']
['s243540926', 's449608559']
[3060.0, 4148.0]
[17.0, 28.0]
[103, 109]
p03325
u876335718
2,000
1,024,000
As AtCoder Beginner Contest 100 is taking place, the office of AtCoder, Inc. is decorated with a sequence of length N, a = {a_1, a_2, a_3, ..., a_N}. Snuke, an employee, would like to play with this sequence. Specifically, he would like to repeat the following operation as many times as possible: For every i satisfying 1 \leq i \leq N, perform one of the following: "divide a_i by 2" and "multiply a_i by 3". Here, choosing "multiply a_i by 3" for every i is not allowed, and the value of a_i after the operation must be an integer. At most how many operations can be performed?
['n = int(input())\nlis = list(map(int,input().split()))\nnum = 0\nfor i in range(n):\n while lis[i] % 2 == 0:\n num += 1\n lis[i] // 2\nprint(num)', 'n = int(input())\nlis = list(map(int,input().split()))\nnum = 0\nfor nu in lis:\n while nu % 2 == 0:\n num += 1\n nu = nu // 2\nprint(num)']
['Time Limit Exceeded', 'Accepted']
['s047476290', 's527924804']
[4148.0, 4148.0]
[2104.0, 94.0]
[145, 138]
p03325
u884531978
2,000
1,024,000
As AtCoder Beginner Contest 100 is taking place, the office of AtCoder, Inc. is decorated with a sequence of length N, a = {a_1, a_2, a_3, ..., a_N}. Snuke, an employee, would like to play with this sequence. Specifically, he would like to repeat the following operation as many times as possible: For every i satisfying 1 \leq i \leq N, perform one of the following: "divide a_i by 2" and "multiply a_i by 3". Here, choosing "multiply a_i by 3" for every i is not allowed, and the value of a_i after the operation must be an integer. At most how many operations can be performed?
['len_list = int(input())\ninput_list = [int(x) for x in input().split()][:len_list-1]\n\nn = 0\n\nfor x in input_list :\n while (x % 2) == 0 :\n x/=2\n n+=1 \nprint(n)', 'len_list = int(input())\ninput_list = [int(x) for x in input().split()][:len_list]\n\nn = 0\n\nfor x in input_list :\n while (x % 2) == 0 :\n x/=2\n n+=1 \nprint(n)']
['Wrong Answer', 'Accepted']
['s196822418', 's748799206']
[4148.0, 4148.0]
[110.0, 118.0]
[174, 172]
p03325
u884982181
2,000
1,024,000
As AtCoder Beginner Contest 100 is taking place, the office of AtCoder, Inc. is decorated with a sequence of length N, a = {a_1, a_2, a_3, ..., a_N}. Snuke, an employee, would like to play with this sequence. Specifically, he would like to repeat the following operation as many times as possible: For every i satisfying 1 \leq i \leq N, perform one of the following: "divide a_i by 2" and "multiply a_i by 3". Here, choosing "multiply a_i by 3" for every i is not allowed, and the value of a_i after the operation must be an integer. At most how many operations can be performed?
['import numpy as np\nN = int(input())\na = list(map(int,input().split()))\nans = 0\na = np.array(a)\nwhile a.size > 0:\n a = a[a%2 == 0]\n ans += len(a)\n a = a//2\n print(a)\n print(ans)\nprint(ans)', 'n = int(input())\na = list(map(int,input().split()))\nans = 0\nfor i in range(n):\n while a[i]%2 == 0:\n a[i] //=2\n ans+=1\nprint(ans)']
['Wrong Answer', 'Accepted']
['s747087373', 's347705079']
[15028.0, 4148.0]
[592.0, 99.0]
[202, 145]
p03325
u888092736
2,000
1,024,000
As AtCoder Beginner Contest 100 is taking place, the office of AtCoder, Inc. is decorated with a sequence of length N, a = {a_1, a_2, a_3, ..., a_N}. Snuke, an employee, would like to play with this sequence. Specifically, he would like to repeat the following operation as many times as possible: For every i satisfying 1 \leq i \leq N, perform one of the following: "divide a_i by 2" and "multiply a_i by 3". Here, choosing "multiply a_i by 3" for every i is not allowed, and the value of a_i after the operation must be an integer. At most how many operations can be performed?
['def log2(n):\n n = int(n)\n cnt = 0\n while n ^ 1:\n cnt += 1\n n >>= 1\n return cnt\n\n\nN = int(input())\nprint(sum(map(log2, input().split())))\n', 'def log2(n):\n cnt = 0\n while n % 2 == 0:\n cnt += 1\n n //= 2\n return cnt\n\n\nN = int(input())\nprint(sum(map(lambda x: log2(int(x)), input().split())))']
['Wrong Answer', 'Accepted']
['s735111281', 's794767688']
[3956.0, 3828.0]
[55.0, 60.0]
[163, 170]
p03325
u894722300
2,000
1,024,000
As AtCoder Beginner Contest 100 is taking place, the office of AtCoder, Inc. is decorated with a sequence of length N, a = {a_1, a_2, a_3, ..., a_N}. Snuke, an employee, would like to play with this sequence. Specifically, he would like to repeat the following operation as many times as possible: For every i satisfying 1 \leq i \leq N, perform one of the following: "divide a_i by 2" and "multiply a_i by 3". Here, choosing "multiply a_i by 3" for every i is not allowed, and the value of a_i after the operation must be an integer. At most how many operations can be performed?
['import math\nn=int(input())\nn=list(map(int,input().split()))\n\ncount=0\nfor i in n:\n count+=int(math.log(i,2))\n\nprint(count)', 'n=int(input())\nn=list(map(int,input().split()))\n\ncount=0\nfor i in n:\n while(i%2==0):\n count+=1\n i=i//2\n\nprint(count)\n']
['Wrong Answer', 'Accepted']
['s142277681', 's440722661']
[4148.0, 4212.0]
[27.0, 104.0]
[124, 134]
p03325
u932465688
2,000
1,024,000
As AtCoder Beginner Contest 100 is taking place, the office of AtCoder, Inc. is decorated with a sequence of length N, a = {a_1, a_2, a_3, ..., a_N}. Snuke, an employee, would like to play with this sequence. Specifically, he would like to repeat the following operation as many times as possible: For every i satisfying 1 \leq i \leq N, perform one of the following: "divide a_i by 2" and "multiply a_i by 3". Here, choosing "multiply a_i by 3" for every i is not allowed, and the value of a_i after the operation must be an integer. At most how many operations can be performed?
['N = int(input())\nA = list(map(int,input().split()))\nk = 0\nfor i in range(len(A)):\n for j in range(1,15):\n if (A[i] % 2**j == 0 and A[i] % 2**(j+1) == 1):\n k += j\nprint(k)', 'N = int(input())\nL = list(map(int,input().split()))\ncnt = 0\nfor i in range(N):\n k = L[i]\n while k%2 == 0:\n cnt += 1\n k = k//2\nprint(cnt)']
['Wrong Answer', 'Accepted']
['s323354954', 's133960997']
[4148.0, 4148.0]
[126.0, 88.0]
[179, 144]
p03325
u932868243
2,000
1,024,000
As AtCoder Beginner Contest 100 is taking place, the office of AtCoder, Inc. is decorated with a sequence of length N, a = {a_1, a_2, a_3, ..., a_N}. Snuke, an employee, would like to play with this sequence. Specifically, he would like to repeat the following operation as many times as possible: For every i satisfying 1 \leq i \leq N, perform one of the following: "divide a_i by 2" and "multiply a_i by 3". Here, choosing "multiply a_i by 3" for every i is not allowed, and the value of a_i after the operation must be an integer. At most how many operations can be performed?
['n=int(input())\nl=list(map(int,input().split()))\ncnt=0\nfor i in range(n):\n c=0\n while l[i]!=1:\n if l[i]%2==0:\n l[i]=l[i]//2\n c+=1\n cnt+=c\nprint(cnt)', 'n=int(input())\nl=list(map(int,input().split()))\ncnt=0\nfor i in range(n):\n c=0\n while l[i]%2==0:\n l[i]=l[i]//2\n c+=1\n cnt+=c\nprint(cnt)', 'n=int(input())\nl=list(map(int,input().split()))\ncnt=0\nfor i in range(n):\n c=0\n while l[i]%2==0:\n l[i]=l[i]//2\n c+=1\n cnt+=c\nprint(cnt)']
['Time Limit Exceeded', 'Runtime Error', 'Accepted']
['s419434772', 's618498010', 's999035598']
[4148.0, 2940.0, 4140.0]
[2104.0, 17.0, 106.0]
[163, 145, 143]
p03325
u937642029
2,000
1,024,000
As AtCoder Beginner Contest 100 is taking place, the office of AtCoder, Inc. is decorated with a sequence of length N, a = {a_1, a_2, a_3, ..., a_N}. Snuke, an employee, would like to play with this sequence. Specifically, he would like to repeat the following operation as many times as possible: For every i satisfying 1 \leq i \leq N, perform one of the following: "divide a_i by 2" and "multiply a_i by 3". Here, choosing "multiply a_i by 3" for every i is not allowed, and the value of a_i after the operation must be an integer. At most how many operations can be performed?
['v', 'n=int(input())\na = list(map(int,input().split()))\ncnt=0\nfor i in range(n):\n while a[i]%2==0:\n a[i]=a[i]//2\n cnt+=1\nprint(cnt)\n\n']
['Runtime Error', 'Accepted']
['s218295312', 's175419978']
[2940.0, 4148.0]
[17.0, 108.0]
[1, 144]
p03325
u945200821
2,000
1,024,000
As AtCoder Beginner Contest 100 is taking place, the office of AtCoder, Inc. is decorated with a sequence of length N, a = {a_1, a_2, a_3, ..., a_N}. Snuke, an employee, would like to play with this sequence. Specifically, he would like to repeat the following operation as many times as possible: For every i satisfying 1 \leq i \leq N, perform one of the following: "divide a_i by 2" and "multiply a_i by 3". Here, choosing "multiply a_i by 3" for every i is not allowed, and the value of a_i after the operation must be an integer. At most how many operations can be performed?
['import sys\nimport numpy as np\n\n\ndef main():\n scan = sys.stdin.readline\n \n n = int(scan().rstrip())\n a = np.array(tuple(int(a_i) for a_i in scan().rstrip().split()))\n \n print(np.sum(np.log2(a & -a)))\n\n\nif __name__ == "__main__":\n main()\n ', 'import sys\nimport numpy as np\n\n\ndef main():\n scan = sys.stdin.readline\n \n n = int(scan().rstrip())\n a = np.array(tuple(int(a_i) for a_i in scan().rstrip().split()))\n \n print(int(np.sum(np.log2(a & -a))))\n\n\nif __name__ == "__main__":\n main()\n ']
['Wrong Answer', 'Accepted']
['s100727113', 's300058999']
[13152.0, 21876.0]
[151.0, 309.0]
[245, 250]
p03325
u982594421
2,000
1,024,000
As AtCoder Beginner Contest 100 is taking place, the office of AtCoder, Inc. is decorated with a sequence of length N, a = {a_1, a_2, a_3, ..., a_N}. Snuke, an employee, would like to play with this sequence. Specifically, he would like to repeat the following operation as many times as possible: For every i satisfying 1 \leq i \leq N, perform one of the following: "divide a_i by 2" and "multiply a_i by 3". Here, choosing "multiply a_i by 3" for every i is not allowed, and the value of a_i after the operation must be an integer. At most how many operations can be performed?
['n = int(input())\na = [n // 2 for n in map(int, input().split() if n % 2 == 0)]\nprint(sum(a))\n', 'n = int(input())\na = (n // 2 in map(int, input().split() if n % 2 == 0))\nprint(sum(a))\n', 'def f(n):\n c = 0\n while n % 2 == 0:\n c += 1\n n = n // 2\n return c\n\nn = int(input())\na = list(map, int, input().split())\nprint(sum((f(ai) for ai in a if ai % 2 == 0)))\n', 'def f(n):\n c = 0\n while n % 2 == 0:\n c += 1\n n = n // 2\n return c\n \nn = int(input())\na = list(map(int, input().split()))\nprint(sum((f(ai) for ai in a if ai % 2 == 0)))']
['Runtime Error', 'Runtime Error', 'Runtime Error', 'Accepted']
['s276000585', 's369902495', 's813556051', 's885643569']
[2940.0, 2940.0, 3828.0, 4148.0]
[17.0, 18.0, 18.0, 60.0]
[93, 87, 176, 176]
p03325
u985827933
2,000
1,024,000
As AtCoder Beginner Contest 100 is taking place, the office of AtCoder, Inc. is decorated with a sequence of length N, a = {a_1, a_2, a_3, ..., a_N}. Snuke, an employee, would like to play with this sequence. Specifically, he would like to repeat the following operation as many times as possible: For every i satisfying 1 \leq i \leq N, perform one of the following: "divide a_i by 2" and "multiply a_i by 3". Here, choosing "multiply a_i by 3" for every i is not allowed, and the value of a_i after the operation must be an integer. At most how many operations can be performed?
['N = input()\na = list(map(int, input().split()))\n\ncount = 0\nfor i in a:\n if i%2 ==0:\n while(i%2==0):\n i = i//2\n count +=2\nprint(count)', 'N = input()\na = list(map(int, input().split()))\n\ncount = 0\nfor i in a:\n if i%2 ==0:\n while(i%2==0):\n i = i//2\n count +=1\nprint(count)']
['Wrong Answer', 'Accepted']
['s679641396', 's172390000']
[4404.0, 4148.0]
[79.0, 86.0]
[165, 165]
p03325
u994064513
2,000
1,024,000
As AtCoder Beginner Contest 100 is taking place, the office of AtCoder, Inc. is decorated with a sequence of length N, a = {a_1, a_2, a_3, ..., a_N}. Snuke, an employee, would like to play with this sequence. Specifically, he would like to repeat the following operation as many times as possible: For every i satisfying 1 \leq i \leq N, perform one of the following: "divide a_i by 2" and "multiply a_i by 3". Here, choosing "multiply a_i by 3" for every i is not allowed, and the value of a_i after the operation must be an integer. At most how many operations can be performed?
['def LI():\n\treturn [ int(s) for s in input().split() ]\n \nA = LI()\n \ncnt = 0\n \nfor a in A:\n odd = False\n while(not odd):\n if a % 2 != 0:\n odd = True\n else:\n a = a//2\n cnt += 1\n \nprint(cnt)', 'def LI():\n\treturn [ int(s) for s in input().split() ]\n \nA = LI()\n\ncnt = 0\n\nfor a in A:\n odd = False\n while(not odd):\n if a % 2 != 0:\n odd = True\n else:\n a = a//2\n cnt += 1\n \nprint(cnt)', 'def LI():\n\treturn [ int(s) for s in input().split() ]\n\nN = input()\nA = LI()\n \ncnt = 0\n \nfor a in A:\n odd = False\n while(not odd):\n if a % 2 != 0:\n odd = True\n else:\n a = a//2\n cnt += 1\n \nprint(cnt)']
['Wrong Answer', 'Wrong Answer', 'Accepted']
['s230552500', 's808264079', 's050359184']
[3060.0, 3060.0, 4148.0]
[17.0, 17.0, 93.0]
[215, 213, 225]
p03326
u006657459
2,000
1,024,000
Takahashi became a pastry chef and opened a shop _La Confiserie d'ABC_ to celebrate AtCoder Beginner Contest 100. The shop sells N kinds of cakes. Each kind of cake has three parameters "beauty", "tastiness" and "popularity". The i-th kind of cake has the beauty of x_i, the tastiness of y_i and the popularity of z_i. These values may be zero or negative. Ringo has decided to have M pieces of cakes here. He will choose the set of cakes as follows: * Do not have two or more pieces of the same kind of cake. * Under the condition above, choose the set of cakes to maximize (the absolute value of the total beauty) + (the absolute value of the total tastiness) + (the absolute value of the total popularity). Find the maximum possible value of (the absolute value of the total beauty) + (the absolute value of the total tastiness) + (the absolute value of the total popularity) for the set of cakes that Ringo chooses.
["a = [int(ai) for ai in input().split(' ')]\nn = a[1]\ns = [input().split(' ') for i in range(a[0])]\n\npoints = []\nfor si in s:\n p = 0\n for sij in si:\n p += int(sij)\n points.append(p)\n\npoints = sorted(points, reverse=True)\nmax_point = points[0] + points[1] + points[2]\nprint(max_points)", "nm = [int(ai) for ai in input().split(' ')]\nN = nm[0]\nM = nm[1]\ncakes = [[int(si) for si in input().split(' ')] for i in range(a[0])]\nsigns = [[(-1)**i, (-1)**j, (-1)**k] for i in range(2)\n for j in range(2)\n for k in range(2)]\nanswer = 0\nfor sign in signs:\n values = [[cake[i] * sign[i] for i in range(3)] for cake, sign in zip(cakes, signs)]\n answer = max(max(values), answer)\nprint(answer)", "N, M = (int(ai) for ai in input().split(' '))\ncakes = [[int(cake) for cake in input().split(' ')] for _ in range(N)]\nsigns = [[(-1)**i, (-1)**j, (-1)**k]\n for i in range(2) for j in range(2) for k in range(2)]\nanswer = 0\nfor sign in signs:\n values = [sum([cake[i] * sign[i] for i in range(3)]) for cake in cakes]\n answer = max(sum(sorted(values, reverse=True)[:M]), answer)\nprint(answer)"]
['Runtime Error', 'Runtime Error', 'Accepted']
['s038604999', 's648096207', 's280895970']
[3444.0, 3064.0, 3332.0]
[21.0, 19.0, 33.0]
[298, 470, 401]
p03326
u036340997
2,000
1,024,000
Takahashi became a pastry chef and opened a shop _La Confiserie d'ABC_ to celebrate AtCoder Beginner Contest 100. The shop sells N kinds of cakes. Each kind of cake has three parameters "beauty", "tastiness" and "popularity". The i-th kind of cake has the beauty of x_i, the tastiness of y_i and the popularity of z_i. These values may be zero or negative. Ringo has decided to have M pieces of cakes here. He will choose the set of cakes as follows: * Do not have two or more pieces of the same kind of cake. * Under the condition above, choose the set of cakes to maximize (the absolute value of the total beauty) + (the absolute value of the total tastiness) + (the absolute value of the total popularity). Find the maximum possible value of (the absolute value of the total beauty) + (the absolute value of the total tastiness) + (the absolute value of the total popularity) for the set of cakes that Ringo chooses.
['n, m = map(int, input().split())\n\nx = []\ny = []\nz = []\nfor i in range(n):\n _x, _y, _z = map(int, input().split())\n x.append(_x)\n y.append(_y)\n z.append(_z)\n\npm = [1, -1]\n\nans = 0\nfor i_x in pm:\n for i_y in pm:\n for i_z in pm:\n values = []\n for i in range(n):\n values.append(x * i_x + y * i_y + z * i_z)\n s = 0\n for value in sorted(values, reverse=True)[:m]:\n s += value\n ans = max(ans, s)\n \nprint(ans)', 'n, m = map(int, input().split())\n\nx = []\ny = []\nz = []\nfor i in range(n):\n _x, _y, _z = map(int, input().split())\n x.append(_x)\n y.append(_y)\n z.append(_z)\n\npm = [1, -1]\n\nans = 0\nfor i_x in pm:\n for i_y in pm:\n for i_z in pm:\n values = []\n for i in range(n):\n values.append(x[i] * i_x + y[i] * i_y + z[i] * i_z)\n s = 0\n for value in sorted(values, reverse=True)[:m]:\n s += value\n ans = max(ans, s)\n \nprint(ans)\n']
['Runtime Error', 'Accepted']
['s407290006', 's685506736']
[26612.0, 3188.0]
[308.0, 27.0]
[453, 463]
p03326
u047668580
2,000
1,024,000
Takahashi became a pastry chef and opened a shop _La Confiserie d'ABC_ to celebrate AtCoder Beginner Contest 100. The shop sells N kinds of cakes. Each kind of cake has three parameters "beauty", "tastiness" and "popularity". The i-th kind of cake has the beauty of x_i, the tastiness of y_i and the popularity of z_i. These values may be zero or negative. Ringo has decided to have M pieces of cakes here. He will choose the set of cakes as follows: * Do not have two or more pieces of the same kind of cake. * Under the condition above, choose the set of cakes to maximize (the absolute value of the total beauty) + (the absolute value of the total tastiness) + (the absolute value of the total popularity). Find the maximum possible value of (the absolute value of the total beauty) + (the absolute value of the total tastiness) + (the absolute value of the total popularity) for the set of cakes that Ringo chooses.
['A,M = list(map(int,input().split()))\nx = [0 in range(A)]\ny = [0 in range(A)]\nz = [0 in range(A)]\nw = [0 in range(A)]\nans = 0\nfor i in range(A):\n x[i],y[i],z[i] = list(map(int,input().split()))\nfor a in [1,-1]:\n for b in [1,-1]:\n for c in [1,-1]:\n tx = [ a * i for i in range(x)]\n ty = [b * i for i in range(y)]\n tz = [ c * i for i in range(z)]\n for i in range(A):\n w[i] = tx[i] + ty[i] + tz[i]\n tw = sum(sorted(w)[::-1][:M])\n if tw > ans:\n ans = tw\nprint(ans)\n', 'A,M = list(map(int,input().split()))\nans = 0\nx = []\ny = []\nz = []\nw = [0 for i in range(A)]\nfor i in range(A):\n a,b,c = list(map(int,input().split()))\n x.append(a)\n y.append(b)\n z.append(c)\nfor aa in [1,-1]:\n for bb in [1,-1]:\n for cc in [1,-1]:\n #print(a)\n #print(x)\n tx = [ aa * j for j in x]\n ty = [ bb * j for j in y]\n tz = [ cc * j for j in z]\n for j in range(A):\n w[j] = tx[j] + ty[j] + tz[j]\n tw = sum(sorted(w)[::-1][:M])\n if tw > ans:\n ans = tw\nprint(ans)\n\n\n\n']
['Runtime Error', 'Accepted']
['s458734442', 's770161263']
[3064.0, 3444.0]
[21.0, 28.0]
[569, 608]
p03326
u050428930
2,000
1,024,000
Takahashi became a pastry chef and opened a shop _La Confiserie d'ABC_ to celebrate AtCoder Beginner Contest 100. The shop sells N kinds of cakes. Each kind of cake has three parameters "beauty", "tastiness" and "popularity". The i-th kind of cake has the beauty of x_i, the tastiness of y_i and the popularity of z_i. These values may be zero or negative. Ringo has decided to have M pieces of cakes here. He will choose the set of cakes as follows: * Do not have two or more pieces of the same kind of cake. * Under the condition above, choose the set of cakes to maximize (the absolute value of the total beauty) + (the absolute value of the total tastiness) + (the absolute value of the total popularity). Find the maximum possible value of (the absolute value of the total beauty) + (the absolute value of the total tastiness) + (the absolute value of the total popularity) for the set of cakes that Ringo chooses.
['from itertools import product\nt=[]\nans=0\nn,m=map(int,input().split())\ns=list(product([1,-1],repeat=3))\nfor i in range(n):\n li=[]\n p,q,r=map(int,input().split())\n for a,b,c in s:\n li.append(a*p+b*q+c*r)\n t+=[li]\nfor j in list(zip((*t))):\n p=sum(sorted(j)[n-m:])\n ans=max(ans,p)\nprint(ans)\n', 's=[]\np=0\nN,M=map(int,input().split())\nif M==0:\n print(0)\n exit()\nfor i in range(N):\n a,b,c=map(int,input().split())\n s.append((a,b,c))\nt=[1,-1]\nfrom itertools import product\nfor ii,jj,kk in list(product(t,repeat=3)):\n u=[]\n for a,b,c in s:\n u.append(ii*a+jj*b+kk*c)\n ans=sum(sorted(u)[-M:])\n p=max(ans,p)\nprint(p) \n \n']
['Runtime Error', 'Accepted']
['s229694374', 's833020270']
[3064.0, 3284.0]
[17.0, 26.0]
[313, 362]
p03326
u062147869
2,000
1,024,000
Takahashi became a pastry chef and opened a shop _La Confiserie d'ABC_ to celebrate AtCoder Beginner Contest 100. The shop sells N kinds of cakes. Each kind of cake has three parameters "beauty", "tastiness" and "popularity". The i-th kind of cake has the beauty of x_i, the tastiness of y_i and the popularity of z_i. These values may be zero or negative. Ringo has decided to have M pieces of cakes here. He will choose the set of cakes as follows: * Do not have two or more pieces of the same kind of cake. * Under the condition above, choose the set of cakes to maximize (the absolute value of the total beauty) + (the absolute value of the total tastiness) + (the absolute value of the total popularity). Find the maximum possible value of (the absolute value of the total beauty) + (the absolute value of the total tastiness) + (the absolute value of the total popularity) for the set of cakes that Ringo chooses.
['N,M=map(int,input().split())\nP=[]\nfor i in range(N):\n x,y,z=map(int,input().split())\n P.append([x,y,z])\nans =0\nfor i in range(8):\n A=[]\n for j in range(N):\n s = 0\n for k in range(3):\n if i& (1<<k):\n s+=P[j][k]\n else:\n s-=P[j][k]\n A.append(s)\n A.sort()\n print(A[-M:])\n ans = max(ans,sum(A[-M:]))\nprint(ans)', 'import sys\nN,M=map(int,input().split())\nP=[]\nfor i in range(N):\n x,y,z=map(int,input().split())\n P.append([x,y,z])\nif M==0:\n print(0)\n sys.exit()\nans =0\nfor i in range(8):\n A=[]\n for j in range(N):\n s = 0\n for k in range(3):\n if i& (1<<k):\n s+=P[j][k]\n else:\n s-=P[j][k]\n A.append(s)\n A.sort()\n ans = max(ans,sum(A[-M:]))\nprint(ans)']
['Wrong Answer', 'Accepted']
['s496520010', 's434440485']
[3440.0, 3188.0]
[37.0, 34.0]
[399, 429]
p03326
u068400994
2,000
1,024,000
Takahashi became a pastry chef and opened a shop _La Confiserie d'ABC_ to celebrate AtCoder Beginner Contest 100. The shop sells N kinds of cakes. Each kind of cake has three parameters "beauty", "tastiness" and "popularity". The i-th kind of cake has the beauty of x_i, the tastiness of y_i and the popularity of z_i. These values may be zero or negative. Ringo has decided to have M pieces of cakes here. He will choose the set of cakes as follows: * Do not have two or more pieces of the same kind of cake. * Under the condition above, choose the set of cakes to maximize (the absolute value of the total beauty) + (the absolute value of the total tastiness) + (the absolute value of the total popularity). Find the maximum possible value of (the absolute value of the total beauty) + (the absolute value of the total tastiness) + (the absolute value of the total popularity) for the set of cakes that Ringo chooses.
['# coding: utf-8\n# Your code here!\n\nN, M = map(int, input().split(" "))\nx = []\ny = []\nz = []\n\nfor i in range(N):\n _x, _y, _z = map(int, input().split(" "))\n x.append(_x)\n y.append(_y)\n z.append(_z)\n\nans = 0\na = [\n [1,1,1],\n [1,1,-1],\n [1,-1,1],\n [1,-1,-1],\n [-1,1,1],\n [-1,1,-1],\n [-1,-1,1],\n [-1,-1,-1],\n ]\n\nfor i in range(8):\n score = []\n for j in range(N):\n score.append(a[i][0]*x[j]+a[i][1]*y[j]+a[i][2]*z[j])\n score.reverse()\n\n ret = 0\n for k in range(M):\n ret += score[k]\n ans = max(ans, ret)\nprint(ans)', '# coding: utf-8\n# Your code here!\n\nN, M = map(int, input().split(" "))\nx = []\ny = []\nz = []\n\nfor i in range(N):\n _x, _y, _z = map(int, input().split(" "))\n x.append(_x)\n y.append(_y)\n z.append(_z)\n\nans = 0\na = [\n [1,1,1],\n [1,1,-1],\n [1,-1,1],\n [1,-1,-1],\n [-1,1,1],\n [-1,1,-1],\n [-1,-1,1],\n [-1,-1,-1],\n ]\n\nfor i in range(8):\n score = []\n for j in range(N):\n score.append(a[i][0]*x[j]+a[i][1]*y[j]+a[i][2]*z[j])\n score.sort(reverse=True)\n\n ret = 0\n for k in range(M):\n ret += score[k]\n ans = max(ans, ret)\nprint(ans)']
['Wrong Answer', 'Accepted']
['s233350071', 's930904052']
[3188.0, 3188.0]
[27.0, 29.0]
[579, 588]
p03326
u069838609
2,000
1,024,000
Takahashi became a pastry chef and opened a shop _La Confiserie d'ABC_ to celebrate AtCoder Beginner Contest 100. The shop sells N kinds of cakes. Each kind of cake has three parameters "beauty", "tastiness" and "popularity". The i-th kind of cake has the beauty of x_i, the tastiness of y_i and the popularity of z_i. These values may be zero or negative. Ringo has decided to have M pieces of cakes here. He will choose the set of cakes as follows: * Do not have two or more pieces of the same kind of cake. * Under the condition above, choose the set of cakes to maximize (the absolute value of the total beauty) + (the absolute value of the total tastiness) + (the absolute value of the total popularity). Find the maximum possible value of (the absolute value of the total beauty) + (the absolute value of the total tastiness) + (the absolute value of the total popularity) for the set of cakes that Ringo chooses.
["N, M = [int(elem) for elem in input().split(' ')]\ncoord_list = [[int(elem) for elem in input().split(' ')] for _ in range(N)]\nassert len(coord_list) == N\nassert len(coord_list[0]) == 3\n\n\ndef search_max(sorted_coord_list, M, key):\n len_list = len(sorted_coord_list)\n if M == len_list:\n total_x, total_y, total_z = 0, 0, 0\n for x, y, z in sorted_coord_list:\n total_x += x\n total_y += y\n total_z += z\n total = abs(total_x) + abs(total_y) + abs(total_z)\n return total\n\n elif M == 1:\n x, y, z = sorted_coord_list[0]\n total = abs(x) + abs(y) + abs(z)\n return total\n\n # 2 <= M < N\n else:\n if sorted_coord_list[M - 1][key] == sorted_coord_list[M][key]:\n considering_val = coord_list[M - 1][key]\n current_idx = M - 1\n candidate_list = list()\n while (coord_list[current_idx][key] == considering_val) or (current_idx != len_list):\n candidate_list.append(sorted_coord_list[current_idx])\n current_idx += 1\n total_x, total_y, total_z = 0, 0, 0\n for x, y, z in sorted_coord_list[:M - 1]:\n total_x += x\n total_y += y\n total_z += z\n max_total = 0\n for x, y, z in candidate_list:\n total = abs(total_x + x) + abs(total_y + y) + abs(total_z + z)\n max_total = max(max_total, total)\n return max_total\n\n else:\n total_x, total_y, total_z = 0, 0, 0\n for x, y, z in sorted_coord_list[:M]:\n total_x += x\n total_y += y\n total_z += z\n total = abs(total_x) + abs(total_y) + abs(total_z)\n return total\n\n\nmax_candidates = [0] * 6\nfor i in range(3):\n # sort coord_list: O(NlogN)\n sorted_coord_list = sorted(coord_list, key=lambda x: x[i])\n max_candidates[2 * i] = search_max(sorted_coord_list, M, i)\n max_candidates[2 * i + 1] = search_max(sorted_coord_list[::-1], M, i)\n\nprint(max(max_candidates))\n", "from itertools import product\n\nN, M = [int(elem) for elem in input().split(' ')]\ncoord_list = [[int(elem) for elem in input().split(' ')] for _ in range(N)]\nassert len(coord_list) == N\nassert len(coord_list[0]) == 3\n\nmax_total = 0\nfor f_x, f_y, f_z in product([-1, 1], repeat=3):\n sum_list = [(f_x * x + f_y * y + f_z * z, i) for i, (x, y, z) in enumerate(coord_list)]\n # sort with index\n sum_list = sorted(sum_list, key=lambda x: x[0])[::-1]\n total_x, total_y, total_z = 0, 0, 0\n for _, idx in sum_list[:M]:\n total_x += coord_list[idx][0]\n total_y += coord_list[idx][1]\n total_z += coord_list[idx][2]\n total = abs(total_x) + abs(total_y) + abs(total_z)\n max_total = max(total, max_total)\n\nprint(max_total)\n"]
['Runtime Error', 'Accepted']
['s840423354', 's883180649']
[3192.0, 3564.0]
[23.0, 31.0]
[2082, 749]
p03326
u076482195
2,000
1,024,000
Takahashi became a pastry chef and opened a shop _La Confiserie d'ABC_ to celebrate AtCoder Beginner Contest 100. The shop sells N kinds of cakes. Each kind of cake has three parameters "beauty", "tastiness" and "popularity". The i-th kind of cake has the beauty of x_i, the tastiness of y_i and the popularity of z_i. These values may be zero or negative. Ringo has decided to have M pieces of cakes here. He will choose the set of cakes as follows: * Do not have two or more pieces of the same kind of cake. * Under the condition above, choose the set of cakes to maximize (the absolute value of the total beauty) + (the absolute value of the total tastiness) + (the absolute value of the total popularity). Find the maximum possible value of (the absolute value of the total beauty) + (the absolute value of the total tastiness) + (the absolute value of the total popularity) for the set of cakes that Ringo chooses.
['m,n=map(int,input().split())\nx=[]\nfor i in range(m):\n a=list(map(int,input().split()))\n x.append(a)\ny=[]\nfor i in range(m):\n z=[0,0,0,0,0,0,0,0]\n z[0]=x[i][0]+x[i][1]+x[i][2]\n z[1]=x[i][0]+x[i][1]-x[i][2]\n z[2]=x[i][0]-x[i][1]+x[i][2]\n z[3]=x[i][0]-x[i][1]-x[i][2]\n z[4]=-x[i][0]+x[i][1]+x[i][2]\n z[5]=-x[i][0]+x[i][1]-x[i][2]\n z[6]=-x[i][0]-x[i][1]+x[i][2]\n z[7]=-x[i][0]-x[i][1]-x[i][2]\n y.append(z)\nsort(y,axis=0)\nz=[0,0,0,0,0,0,0,0]\nfor i in range(m-1,m-n-1):\n z+=y[i]\nsort(z)\nprint(z[7])\n ', 'm,n=map(int,input().split())\nx=[]\nfor i in range(m):\n a=list(map(int,input().split()))\n x.append(a)\ny=[]\nfor i in range(m):\n z=[0,0,0,0,0,0,0,0]\n z[0]=x[i][0]+x[i][1]+x[i][2]\n z[1]=x[i][0]+x[i][1]-x[i][2]\n z[2]=x[i][0]-x[i][1]+x[i][2]\n z[3]=x[i][0]-x[i][1]-x[i][2]\n z[4]=-x[i][0]+x[i][1]+x[i][2]\n z[5]=-x[i][0]+x[i][1]-x[i][2]\n z[6]=-x[i][0]-x[i][1]+x[i][2]\n z[7]=-x[i][0]-x[i][1]-x[i][2]\n y.append(z)\nsort(y,axis=0)\nz=[0,0,0,0,0,0,0,0]\nfor i in range(m-1,m-n-1):\n for j in range(8):\n \tz[j]+=y[i][j]\nsort(z)\nprint(z[7])', 'import numpy as np\nm,n=map(int,input().split())\nx=[]\nfor i in range(m):\n a=list(map(int,input().split()))\n x.append(a)\ny=[]\nfor i in range(m):\n z=[0,0,0,0,0,0,0,0]\n z[0]=x[i][0]+x[i][1]+x[i][2]\n z[1]=x[i][0]+x[i][1]-x[i][2]\n z[2]=x[i][0]-x[i][1]+x[i][2]\n z[3]=x[i][0]-x[i][1]-x[i][2]\n z[4]=-x[i][0]+x[i][1]+x[i][2]\n z[5]=-x[i][0]+x[i][1]-x[i][2]\n z[6]=-x[i][0]-x[i][1]+x[i][2]\n z[7]=-x[i][0]-x[i][1]-x[i][2]\n y.append(z)\np=np.array(y)\nsidx = p.argsort(axis=0)\np=p[sidx, np.arange(sidx.shape[1])]\nz=[0,0,0,0,0,0,0,0]\nfor i in range(m-1,m-n-1,-1):\n for j in range(8):\n \tz[j]+=p[i][j]\nprint(max(z))']
['Runtime Error', 'Runtime Error', 'Accepted']
['s428953601', 's754965322', 's255498015']
[3700.0, 3700.0, 12892.0]
[25.0, 24.0, 163.0]
[508, 533, 609]
p03326
u077337864
2,000
1,024,000
Takahashi became a pastry chef and opened a shop _La Confiserie d'ABC_ to celebrate AtCoder Beginner Contest 100. The shop sells N kinds of cakes. Each kind of cake has three parameters "beauty", "tastiness" and "popularity". The i-th kind of cake has the beauty of x_i, the tastiness of y_i and the popularity of z_i. These values may be zero or negative. Ringo has decided to have M pieces of cakes here. He will choose the set of cakes as follows: * Do not have two or more pieces of the same kind of cake. * Under the condition above, choose the set of cakes to maximize (the absolute value of the total beauty) + (the absolute value of the total tastiness) + (the absolute value of the total popularity). Find the maximum possible value of (the absolute value of the total beauty) + (the absolute value of the total tastiness) + (the absolute value of the total popularity) for the set of cakes that Ringo chooses.
['import itertools\nN, M = map(int, input().strip().split())\nprev_cakes = []\n\nfor _ in range(M - 1):\n prev_cakes.append(tuple(map(int, input().strip().split())))\n\nmax_sum = None\nfor _ in range(N - M + 1):\n cake = tuple(map(int, input().strip().split()))\n for combi_cakes in itertools.combinations(prev_cakes, M - 1):\n print(combi_cakes)\n x = sum([ccake[0] for ccake in combi_cakes]) + cake[0]\n y = sum([ccake[1] for ccake in combi_cakes]) + cake[1]\n z = sum([ccake[2] for ccake in combi_cakes]) + cake[2]\n if max_sum is None or abs(x)+abs(y)+abs(z) > max_sum:\n max_sum = abs(x)+abs(y)+abs(z)\n prev_cakes.append(cake)\nprint(max_sum)', 'import itertools\n \nN, M = map(int, input().strip().split())\ncakes = []\n \nfor _ in range(N):\n cake = list(map(int, input().strip().split()))\n cakes.append(abs(cake[0]) + abs(cake[1]) + abs(cake[2]))\n \nprint(sum(list(sorted(cakes, key=lambda x: -x)))[:M])', 'n, m = map(int, input().split())\nxyz = [tuple(map(int, input().split())) for _ in range(n)]\nmaxc = None\n\ntmpc = 0\ni = 0\nfor c in sorted([x+y+z for x, y, z in xyz]):\n tmpc += c\n i += 1\n if i == m:\n break\nmaxc = tmpc\n\ntmpc = 0\ni = 0\nfor c in sorted([x+y-z for x, y, z in xyz]):\n tmpc += c\n i += 1\n if i == m:\n break\nmaxc = max(maxc, tmpc)\n\ntmpc = 0\ni = 0\nfor c in sorted([x-y+z for x, y, z in xyz]):\n tmpc += c\n i += 1\n if i == m:\n break\nmaxc = max(maxc, tmpc)\n\ntmpc = 0\ni = 0\nfor c in sorted([x-y-z for x, y, z in xyz]):\n tmpc += c\n i += 1\n if i == m:\n break\nmaxc = max(maxc, tmpc)\n\ntmpc = 0\ni = 0\nfor c in sorted([-x+y+z for x, y, z in xyz]):\n tmpc += c\n i += 1\n if i == m:\n break\nmaxc = max(maxc, tmpc)\n\ntmpc = 0\ni = 0\nfor c in sorted([-x+y-z for x, y, z in xyz]):\n tmpc += c\n i += 1\n if i == m:\n break\nmaxc = max(maxc, tmpc)\n\ntmpc = 0\ni = 0\nfor c in sorted([-x-y+z for x, y, z in xyz]):\n tmpc += c\n i += 1\n if i == m:\n break\nmaxc = max(maxc, tmpc)\n\ntmpc = 0\ni = 0\nfor c in sorted([-x-y-z for x, y, z in xyz]):\n tmpc += c\n i += 1\n if i == m:\n break\nmaxc = max(maxc, tmpc)\n\nprint(maxc)', 'n, m = map(int, input().split())\nxyz = [tuple(map(int, input().split())) for _ in range(n)]\n\ns1 = sum([x+y+z for x, y, z in xyz][:m])\ns2 = sum([x+y-z for x, y, z in xyz][:m])\ns3 = sum([x-y+z for x, y, z in xyz][:m])\ns4 = sum([x-y-z for x, y, z in xyz][:m])\ns5 = sum([-x+y+z for x, y, z in xyz][:m])\ns6 = sum([-x+y-z for x, y, z in xyz][:m])\ns7 = sum([-x-y+z for x, y, z in xyz][:m])\ns8 = sum([-x-y-z for x, y, z in xyz][:m])\n\nprint(max(s1, s2, s3, s4, s5, s6, s7, s8))', 'n, m = map(int, input().split())\nxyz = [tuple(map(int, input().split())) for _ in range(n)]\n\ns1 = abs(sum(sorted([x+y+z for x, y, z in xyz])[:m]))\ns2 = abs(sum(sorted([x+y-z for x, y, z in xyz])[:m]))\ns3 = abs(sum(sorted([x-y+z for x, y, z in xyz])[:m]))\ns4 = abs(sum(sorted([x-y-z for x, y, z in xyz])[:m]))\ns5 = abs(sum(sorted([-x+y+z for x, y, z in xyz])[:m]))\ns6 = abs(sum(sorted([-x+y-z for x, y, z in xyz])[:m]))\ns7 = abs(sum(sorted([-x-y+z for x, y, z in xyz])[:m]))\ns8 = abs(sum(sorted([-x-y-z for x, y, z in xyz])[:m]))\n\nprint(max(s1, s2, s3, s4, s5, s6, s7, s8))']
['Runtime Error', 'Runtime Error', 'Wrong Answer', 'Wrong Answer', 'Accepted']
['s147429619', 's684981094', 's745092751', 's931391516', 's070572610']
[115188.0, 3060.0, 3272.0, 3296.0, 3280.0]
[2103.0, 24.0, 26.0, 22.0, 26.0]
[652, 256, 1133, 468, 572]
p03326
u096736378
2,000
1,024,000
Takahashi became a pastry chef and opened a shop _La Confiserie d'ABC_ to celebrate AtCoder Beginner Contest 100. The shop sells N kinds of cakes. Each kind of cake has three parameters "beauty", "tastiness" and "popularity". The i-th kind of cake has the beauty of x_i, the tastiness of y_i and the popularity of z_i. These values may be zero or negative. Ringo has decided to have M pieces of cakes here. He will choose the set of cakes as follows: * Do not have two or more pieces of the same kind of cake. * Under the condition above, choose the set of cakes to maximize (the absolute value of the total beauty) + (the absolute value of the total tastiness) + (the absolute value of the total popularity). Find the maximum possible value of (the absolute value of the total beauty) + (the absolute value of the total tastiness) + (the absolute value of the total popularity) for the set of cakes that Ringo chooses.
['import numpy as np\n\nN, M = map(int, input().split())\n\nnum_list = np.zeros((N,3))\nfor i in range(N):\n\tnum_list[i] = list(map(int, input().split()))\n\ns = [b >= 0 for b in np.sum(num_list, axis=0)]\nif s[0]:\n\tnum_list = num_list[num_list[:,0].argsort()[::-1],:]\nelse:\n\tnum_list = num_list[num_list[:,0].argsort(),:]\n\nans = np.sum(np.abs(np.sum(num_list[:M,:], axis=0)))\n\nprint(ans)', 'import numpy as np\n\nN, M = map(int, input().split())\n\n\n\nnum_list = np.zeros((N,3))\nfor i in range(N):\n\tnum_list[i] = list(map(int, input().split()))\n\nnum_list = num_list.T\n\nans = max(\n\tnp.sum(np.sort(num_list[0,:] + num_list[1,:] + num_list[2,:])[::-1][:M]),\n\tnp.sum(np.sort(num_list[0,:] + num_list[1,:] - num_list[2,:])[::-1][:M]),\n\tnp.sum(np.sort(num_list[0,:] - num_list[1,:] + num_list[2,:])[::-1][:M]),\n\tnp.sum(np.sort(num_list[0,:] - num_list[1,:] - num_list[2,:])[::-1][:M]),\n\tnp.sum(np.sort(-num_list[0,:] + num_list[1,:] + num_list[2,:])[::-1][:M]),\n\tnp.sum(np.sort(-num_list[0,:] + num_list[1,:] - num_list[2,:])[::-1][:M]),\n\tnp.sum(np.sort(-num_list[0,:] - num_list[1,:] + num_list[2,:])[::-1][:M]),\n\tnp.sum(np.sort(-num_list[0,:] - num_list[1,:] - num_list[2,:])[::-1][:M])\n)\nprint(int(ans))\n']
['Wrong Answer', 'Accepted']
['s034760495', 's615947066']
[12508.0, 12520.0]
[154.0, 157.0]
[377, 805]
p03326
u111652094
2,000
1,024,000
Takahashi became a pastry chef and opened a shop _La Confiserie d'ABC_ to celebrate AtCoder Beginner Contest 100. The shop sells N kinds of cakes. Each kind of cake has three parameters "beauty", "tastiness" and "popularity". The i-th kind of cake has the beauty of x_i, the tastiness of y_i and the popularity of z_i. These values may be zero or negative. Ringo has decided to have M pieces of cakes here. He will choose the set of cakes as follows: * Do not have two or more pieces of the same kind of cake. * Under the condition above, choose the set of cakes to maximize (the absolute value of the total beauty) + (the absolute value of the total tastiness) + (the absolute value of the total popularity). Find the maximum possible value of (the absolute value of the total beauty) + (the absolute value of the total tastiness) + (the absolute value of the total popularity) for the set of cakes that Ringo chooses.
['# -*- coding: utf-8 -*-\n\n\nN,M=map(int,input().split())\nL = []\nfor i in range(N):\n L.append(list(map(int,input().split())))\n\nK1=[]\nK2=[]\nK3=[]\nK4=[]\nK5=[]\nK6=[]\nK7=[]\nK8=[]\n\nC = [0,0,0,0,0,0,0,0]\n\nfor i in range(N):\n K1.append(L[i][0]+L[i][1]+L[i][2])\nK1.sort()\n\nfor i in range(N):\n K2.append(L[i][0]-L[i][1]+L[i][2])\nK2.sort()\n\nfor i in range(N):\n K3.append(L[i][0]+L[i][1]-L[i][2])\nK3.sort()\n\nfor i in range(N):\n K4.append(-L[i][0]+L[i][1]+L[i][2])\nK4.sort()\n\nfor i in range(N):\n K5.append(-L[i][0]+L[i][1]-L[i][2])\nK5.sort()\n\nfor i in range(N):\n K6.append(L[i][0]-L[i][1]-L[i][2])\nK6.sort()\n\nfor i in range(N):\n K7.append(-L[i][0]-L[i][1]+L[i][2])\nK7.sort()\n\nfor i in range(N):\n K8.append(-L[i][0]-L[i][1]-L[i][2])\nK8.sort()\n\nfor i in range(M):\n C[0] += K1[M-i]\n C[1] += K2[M-i]\n C[2] += K3[M-i]\n C[3] += K4[M-i]\n C[4] += K5[M-i]\n C[5] += K6[M-i]\n C[6] += K7[M-i]\n C[7] += K8[M-i]\nprint(max(C))\n', '# -*- coding: utf-8 -*-\n\n\nN,M=map(int,input().split())\nL = []\nfor i in range(N):\n L.append(list(map(int,input().split())))\n\nK1=[]\nK2=[]\nK3=[]\nK4=[]\nK5=[]\nK6=[]\nK7=[]\nK8=[]\n\nC = [0,0,0,0,0,0,0,0]\n\nfor i in range(N):\n K1.append(L[i][0]+L[i][1]+L[i][2])\nK1.sort()\n\nfor i in range(N):\n K2.append(L[i][0]-L[i][1]+L[i][2])\nK2.sort()\n\nfor i in range(N):\n K3.append(L[i][0]+L[i][1]-L[i][2])\nK3.sort()\n\nfor i in range(N):\n K4.append(-L[i][0]+L[i][1]+L[i][2])\nK4.sort()\n\nfor i in range(N):\n K5.append(-L[i][0]+L[i][1]-L[i][2])\nK5.sort()\n\nfor i in range(N):\n K6.append(L[i][0]-L[i][1]-L[i][2])\nK6.sort()\n\nfor i in range(N):\n K7.append(-L[i][0]-L[i][1]+L[i][2])\nK7.sort()\n\nfor i in range(N):\n K8.append(-L[i][0]-L[i][1]-L[i][2])\nK8.sort()\n\nfor i in range(M):\n C[0] += K1[M-i]\n C[1] += K2[M-i]\n C[2] += K3[M-i]\n C[3] += K4[M-i]\n C[4] += K5[M-i]\n C[5] += K6[M-i]\n C[6] += K7[M-i]\n C[7] += K8[M-i]\n \nfor i in range(8):\n C[i] = abs(C[i])\nprint(max(C))\n', '# -*- coding: utf-8 -*-\n\n\nN,M=map(int,input().split())\nL = []\nfor i in range(N):\n L.append(list(map(int,input().split())))\n\nK1=[]\nK2=[]\nK3=[]\nK4=[]\nK5=[]\nK6=[]\nK7=[]\nK8=[]\n\nC = [0,0,0,0,0,0,0,0]\n\nfor i in range(N):\n K1.append(L[i][0]+L[i][1]+L[i][2])\nK1.sort()\n\nfor i in range(N):\n K2.append(L[i][0]-L[i][1]+L[i][2])\nK2.sort()\n\nfor i in range(N):\n K3.append(L[i][0]+L[i][1]-L[i][2])\nK3.sort()\n\nfor i in range(N):\n K4.append(-L[i][0]+L[i][1]+L[i][2])\nK4.sort()\n\nfor i in range(N):\n K5.append(-L[i][0]+L[i][1]-L[i][2])\nK5.sort()\n\nfor i in range(N):\n K6.append(L[i][0]-L[i][1]-L[i][2])\nK6.sort()\n\nfor i in range(N):\n K7.append(-L[i][0]-L[i][1]+L[i][2])\nK7.sort()\n\nfor i in range(N):\n K8.append(-L[i][0]-L[i][1]-L[i][2])\nK8.sort()\n\nfor i in range(M):\n C[0] += K1[N-i]\n C[1] += K2[N-i]\n C[2] += K3[N-i]\n C[3] += K4[N-i]\n C[4] += K5[N-i]\n C[5] += K6[N-i]\n C[6] += K7[N-i]\n C[7] += K8[N-i]\n \nfor i in range(8):\n C[i] = abs(C[i])\nprint(max(C))\n', '# -*- coding: utf-8 -*-\n\n\nN,M = map(int,input().split())\nL = []\nfor i in range(N):\n L.append(list(map(int,input().split())))\nprint(L)\n\nK1=[]\nK2=[]\nK3=[]\nK4=[]\nK5=[]\nK6=[]\nK7=[]\nK8=[]\n\nC = [0,0,0,0,0,0,0,0]\n\nfor i in range(N):\n K1.append(L[i][0]+L[i][1]+L[i][2])\nK1.sort()\n\nfor i in range(N):\n K2.append(L[i][0]-L[i][1]+L[i][2])\nK2.sort()\n\nfor i in range(N):\n K3.append(L[i][0]+L[i][1]-L[i][2])\nK3.sort()\n\nfor i in range(N):\n K4.append(-L[i][0]+L[i][1]+L[i][2])\nK4.sort()\n\nfor i in range(N):\n K5.append(-L[i][0]+L[i][1]-L[i][2])\nK5.sort()\n\nfor i in range(N):\n K6.append(L[i][0]-L[i][1]-L[i][2])\nK6.sort()\n\nfor i in range(N):\n K7.append(-L[i][0]-L[i][1]+L[i][2])\nK7.sort()\n\nfor i in range(N):\n K8.append(-L[i][0]-L[i][1]-L[i][2])\nK8.sort()\n\nfor i in range(M):\n C[0] += K1[M-i]\n C[1] += K2[M-i]\n C[2] += K3[M-i]\n C[3] += K4[M-i]\n C[4] += K5[M-i]\n C[5] += K6[M-i]\n C[6] += K7[M-i]\n C[7] += K8[M-i]\nprint(max(C))\n', '# -*- coding: utf-8 -*-\n\n\nN,M=map(int,input().split())\nL = []\nfor i in range(N):\n L.append(list(map(int,input().split())))\n\nK1=[]\nK2=[]\nK3=[]\nK4=[]\nK5=[]\nK6=[]\nK7=[]\nK8=[]\n\nC = [0,0,0,0,0,0,0,0]\n\nfor i in range(N):\n K1.append(L[i][0]+L[i][1]+L[i][2])\nK1.sort()\n\nfor i in range(N):\n K2.append(L[i][0]-L[i][1]+L[i][2])\nK2.sort()\n\nfor i in range(N):\n K3.append(L[i][0]+L[i][1]-L[i][2])\nK3.sort()\n\nfor i in range(N):\n K4.append(-L[i][0]+L[i][1]+L[i][2])\nK4.sort()\n\nfor i in range(N):\n K5.append(-L[i][0]+L[i][1]-L[i][2])\nK5.sort()\n\nfor i in range(N):\n K6.append(L[i][0]-L[i][1]-L[i][2])\nK6.sort()\n\nfor i in range(N):\n K7.append(-L[i][0]-L[i][1]+L[i][2])\nK7.sort()\n\nfor i in range(N):\n K8.append(-L[i][0]-L[i][1]-L[i][2])\nK8.sort()\n\nfor i in range(M):\n C[0] += K1[N-i-1]\n C[1] += K2[N-i-1]\n C[2] += K3[N-i-1]\n C[3] += K4[N-i-1]\n C[4] += K5[N-i-1]\n C[5] += K6[N-i-1]\n C[6] += K7[N-i-1]\n C[7] += K8[N-i-1]\n \nfor i in range(8):\n C[i] = abs(C[i])\nprint(max(C))\n']
['Runtime Error', 'Runtime Error', 'Runtime Error', 'Runtime Error', 'Accepted']
['s074002834', 's092582690', 's177092475', 's624300964', 's419538820']
[3572.0, 3692.0, 3696.0, 3700.0, 3572.0]
[27.0, 27.0, 26.0, 28.0, 27.0]
[1011, 1056, 1056, 1022, 1072]
p03326
u121921603
2,000
1,024,000
Takahashi became a pastry chef and opened a shop _La Confiserie d'ABC_ to celebrate AtCoder Beginner Contest 100. The shop sells N kinds of cakes. Each kind of cake has three parameters "beauty", "tastiness" and "popularity". The i-th kind of cake has the beauty of x_i, the tastiness of y_i and the popularity of z_i. These values may be zero or negative. Ringo has decided to have M pieces of cakes here. He will choose the set of cakes as follows: * Do not have two or more pieces of the same kind of cake. * Under the condition above, choose the set of cakes to maximize (the absolute value of the total beauty) + (the absolute value of the total tastiness) + (the absolute value of the total popularity). Find the maximum possible value of (the absolute value of the total beauty) + (the absolute value of the total tastiness) + (the absolute value of the total popularity) for the set of cakes that Ringo chooses.
['N,M=map(int,input().split())\ncake=[list(map(int,input().split())) for _ in range(N)]\nans=0\nif M=0:\n print(ans)\n exit()\nfor i in range(1<<3):\n point=[0]*N\n for j in range(N):\n for k in range(3):\n point[j]+=(-1+(i>>k & 1)*2)*cake[j][k]\n point.sort()\n ans=max(ans,sum(point[-M:]))\nprint(ans)\n', 'N,M=map(int,input().split())\ncake=[list(map(int,input().split())) for _ in range(N)]\nans=0\nfor i in range(1<<3):\n point=[0]*N\n for j in range(N):\n for k in range(3):\n point[j]+=(-1+(i>>k & 1)*2)*cake[j][k]\n point.sort()\n ans=max(ans,sum(point[-M:]))\n if M==0:\n ans=0\nprint(ans)\n']
['Runtime Error', 'Accepted']
['s196161243', 's054598990']
[2940.0, 3316.0]
[17.0, 34.0]
[325, 318]
p03326
u123824541
2,000
1,024,000
Takahashi became a pastry chef and opened a shop _La Confiserie d'ABC_ to celebrate AtCoder Beginner Contest 100. The shop sells N kinds of cakes. Each kind of cake has three parameters "beauty", "tastiness" and "popularity". The i-th kind of cake has the beauty of x_i, the tastiness of y_i and the popularity of z_i. These values may be zero or negative. Ringo has decided to have M pieces of cakes here. He will choose the set of cakes as follows: * Do not have two or more pieces of the same kind of cake. * Under the condition above, choose the set of cakes to maximize (the absolute value of the total beauty) + (the absolute value of the total tastiness) + (the absolute value of the total popularity). Find the maximum possible value of (the absolute value of the total beauty) + (the absolute value of the total tastiness) + (the absolute value of the total popularity) for the set of cakes that Ringo chooses.
['n,m = map(int,input().split())\nx,y,z = [],[],[]\nfor i in range(n):\n a,b,c = map(int,input().split())\n x.append(a)\n y.append(b)\n z.append(c)\ndef solve(x,y,z,m):\n ans = 0\n for bit in range(8):\n print(bit>>2)\n w = []\n for i in range(n):\n t = x[i]*(-1)**((bit>>2)&1)+y[i]*(-1)**((bit>>1)&1)+z[i]*(-1)**((bit>>0)&1)\n w.append(t)\n w.sort(reverse=True)\n ans = max(ans,sum(w[:m]))\n return ans\n\nans = solve(x,y,z,m)\nprint(ans)\n', 'n,m = map(int,input().split())\nx,y,z = [],[],[]\nfor i in range(n):\n a,b,c = map(int,input().split())\n x.append(a)\n y.append(b)\n z.append(c)\ndef solve(x,y,z,m):\n ans = 0\n for bit in range(8):\n w = []\n for i in range(n):\n t = x[i]*(-1)**((bit>>2)&1)+y[i]*(-1)**((bit>>1)&1)+z[i]*(-1)**((bit>>0)&1)\n w.append(t)\n w.sort(reverse=True)\n ans = max(ans,sum(w[:m]))\n return ans\n\nans = solve(x,y,z,m)\nprint(ans)\n']
['Wrong Answer', 'Accepted']
['s639678592', 's817054594']
[3188.0, 3188.0]
[31.0, 30.0]
[496, 474]
p03326
u140251125
2,000
1,024,000
Takahashi became a pastry chef and opened a shop _La Confiserie d'ABC_ to celebrate AtCoder Beginner Contest 100. The shop sells N kinds of cakes. Each kind of cake has three parameters "beauty", "tastiness" and "popularity". The i-th kind of cake has the beauty of x_i, the tastiness of y_i and the popularity of z_i. These values may be zero or negative. Ringo has decided to have M pieces of cakes here. He will choose the set of cakes as follows: * Do not have two or more pieces of the same kind of cake. * Under the condition above, choose the set of cakes to maximize (the absolute value of the total beauty) + (the absolute value of the total tastiness) + (the absolute value of the total popularity). Find the maximum possible value of (the absolute value of the total beauty) + (the absolute value of the total tastiness) + (the absolute value of the total popularity) for the set of cakes that Ringo chooses.
['# input\nN, M = map(int, input().split())\nCake = [list(map(int, input().split())) for i in range(N)]\n\nCake_sum = [0 for i in range(N)]\n\n\n\nans1 = 0\nfor i in range(N):\n Cake_sum[i] = Cake[i][0] + Cake[i][1] + Cake[i][2]\nCake_sum.reverse() \nfor j in range(M):\n ans1 += Cake_sum[j]\n\nans2 = 0\n\nfor i in range(N):\n Cake_sum[i] = -Cake[i][0] + Cake[i][1] + Cake[i][2]\nCake_sum.reverse() \nfor j in range(M):\n ans2 += Cake_sum[j]\n\nans3 = 0\n\nfor i in range(N):\n Cake_sum[i] = Cake[i][0] - Cake[i][1] + Cake[i][2]\nCake_sum.reverse() \nfor j in range(M):\n ans3 += Cake_sum[j]\n\nans4 = 0\n\nfor i in range(N):\n Cake_sum[i] = Cake[i][0] + Cake[i][1] - Cake[i][2]\nCake_sum.reverse() \nfor j in range(M):\n ans4 += Cake_sum[j]\n\nans5 = 0\n\nfor i in range(N):\n Cake_sum[i] = -Cake[i][0] - Cake[i][1] + Cake[i][2]\nCake_sum.reverse() \nfor j in range(M):\n ans5 += Cake_sum[j]\n\nans6 = 0\n\nfor i in range(N):\n Cake_sum[i] = Cake[i][0] - Cake[i][1] - Cake[i][2]\nCake_sum.reverse() \nfor j in range(M):\n ans6 += Cake_sum[j]\n\nans7 = 0\n\nfor i in range(N):\n Cake_sum[i] = -Cake[i][0] + Cake[i][1] - Cake[i][2]\nCake_sum.reverse() \nfor j in range(M):\n ans7 += Cake_sum[j]\n\nans8 = 0\n\nfor i in range(N):\n Cake_sum[i] = -Cake[i][0] - Cake[i][1] - Cake[i][2]\nCake_sum.reverse() \nfor j in range(M):\n ans8 += Cake_sum[j]\n\nans = max(ans1, ans2, ans3, ans4, ans5, ans6, ans7, ans8)\n\nprint(ans)', '# input\nN, M = map(int, input().split())\nCake = [list(map(int, input().split())) for i in range(N)]\n\nCake_sum = [0 for i in range(N)]\n\n\n\nans1 = 0\nfor i in range(N):\n Cake_sum[i] = Cake[i][0] + Cake[i][1] + Cake[i][2]\n Cake_sum.reverse() \nfor j in range(M):\n ans1 += Cake_sum[j]\n\nans2 = 0\n\nfor i in range(N):\n Cake_sum[i] = -Cake[i][0] + Cake[i][1] + Cake[i][2]\n Cake_sum.reverse() \nfor j in range(M):\n ans2 += Cake_sum[j]\n\nans3 = 0\n\nfor i in range(N):\n Cake_sum[i] = Cake[i][0] - Cake[i][1] + Cake[i][2]\n Cake_sum.reverse() \nfor j in range(M):\n ans3 += Cake_sum[j]\n\nans4 = 0\n\nfor i in range(N):\n Cake_sum[i] = Cake[i][0] + Cake[i][1] - Cake[i][2]\n Cake_sum.reverse() \nfor j in range(M):\n ans4 += Cake_sum[j]\n\nans5 = 0\n\nfor i in range(N):\n Cake_sum[i] = -Cake[i][0] - Cake[i][1] + Cake[i][2]\n Cake_sum.reverse() \nfor j in range(M):\n ans5 += Cake_sum[j]\n\nans6 = 0\n\nfor i in range(N):\n Cake_sum[i] = Cake[i][0] - Cake[i][1] - Cake[i][2]\n Cake_sum.reverse() \nfor j in range(M):\n ans6 += Cake_sum[j]\n\nans7 = 0\n\nfor i in range(N):\n Cake_sum[i] = -Cake[i][0] + Cake[i][1] - Cake[i][2]\n Cake_sum.reverse() \nfor j in range(M):\n ans7 += Cake_sum[j]\n\nans8 = 0\n\nfor i in range(N):\n Cake_sum[i] = -Cake[i][0] - Cake[i][1] - Cake[i][2]\n Cake_sum.reverse() \nfor j in range(M):\n ans8 += Cake_sum[j]\n\nans = max(ans1, ans2, ans3, ans4, ans5, ans6, ans7, ans8)\n\nprint(ans)', '# input\nN, M = map(int, input().split())\nCake = [list(map(int, input().split())) for i in range(N)]\n\nCake_sum = [0 for i in range(N)]\n\n\n\nans1 = 0\nfor i in range(N):\n Cake_sum[i] = Cake[i][0] + Cake[i][1] + Cake[i][2]\n\nCake_sum_sorted = sorted(Cake_sum, reverse = True) \n\nfor j in range(M):\n ans1 += Cake_sum_sorted[j]\n\nans2 = 0\n\nfor i in range(N):\n Cake_sum[i] = -Cake[i][0] + Cake[i][1] + Cake[i][2]\n\nCake_sum_sorted = sorted(Cake_sum, reverse = True) \n\nfor j in range(M):\n ans2 += Cake_sum_sorted[j]\n\nans3 = 0\n\nfor i in range(N):\n Cake_sum[i] = Cake[i][0] - Cake[i][1] + Cake[i][2]\n\nCake_sum_sorted = sorted(Cake_sum, reverse = True) \n\nfor j in range(M):\n ans3 += Cake_sum_sorted[j]\n\nans4 = 0\n\nfor i in range(N):\n Cake_sum[i] = Cake[i][0] + Cake[i][1] - Cake[i][2]\n\nCake_sum_sorted = sorted(Cake_sum, reverse = True) \n\nfor j in range(M):\n ans4 += Cake_sum_sorted[j]\n\nans5 = 0\n\nfor i in range(N):\n Cake_sum[i] = -Cake[i][0] - Cake[i][1] + Cake[i][2]\n\nCake_sum_sorted = sorted(Cake_sum, reverse = True) \n\nfor j in range(M):\n ans5 += Cake_sum_sorted[j]\n\nans6 = 0\n\nfor i in range(N):\n Cake_sum[i] = Cake[i][0] - Cake[i][1] - Cake[i][2]\n\nCake_sum_sorted = sorted(Cake_sum, reverse = True) \n\nfor j in range(M):\n ans6 += Cake_sum_sorted[j]\n\nans7 = 0\n\nfor i in range(N):\n Cake_sum[i] = -Cake[i][0] + Cake[i][1] - Cake[i][2]\n\nCake_sum_sorted = sorted(Cake_sum, reverse = True) \n\nfor j in range(M):\n ans7 += Cake_sum_sorted[j]\n\nans8 = 0\n\nfor i in range(N):\n Cake_sum[i] = -Cake[i][0] - Cake[i][1] - Cake[i][2]\n\nCake_sum_sorted = sorted(Cake_sum, reverse = True) \n\nfor j in range(M):\n ans8 += Cake_sum_sorted[j]\n\nans = max(ans1, ans2, ans3, ans4, ans5, ans6, ans7, ans8)\n\nprint(ans)']
['Wrong Answer', 'Wrong Answer', 'Accepted']
['s215764833', 's990883514', 's595864575']
[3316.0, 3316.0, 3316.0]
[25.0, 29.0, 27.0]
[1686, 1718, 2014]
p03326
u177040005
2,000
1,024,000
Takahashi became a pastry chef and opened a shop _La Confiserie d'ABC_ to celebrate AtCoder Beginner Contest 100. The shop sells N kinds of cakes. Each kind of cake has three parameters "beauty", "tastiness" and "popularity". The i-th kind of cake has the beauty of x_i, the tastiness of y_i and the popularity of z_i. These values may be zero or negative. Ringo has decided to have M pieces of cakes here. He will choose the set of cakes as follows: * Do not have two or more pieces of the same kind of cake. * Under the condition above, choose the set of cakes to maximize (the absolute value of the total beauty) + (the absolute value of the total tastiness) + (the absolute value of the total popularity). Find the maximum possible value of (the absolute value of the total beauty) + (the absolute value of the total tastiness) + (the absolute value of the total popularity) for the set of cakes that Ringo chooses.
['N,M= map(int,input().split())\n\nxyz = []\nfor i in range(N):\n xyz.append(list(map(int, input().split())))\n\nans = 0\n\nx = y = z = 0\nfor i in range(N):\n x += xyz[i][0]\n y += xyz[i][1]\n z += xyz[i][2]\n\ntmp_list = [x,y,z]\ntmp_sum = abs(x) + abs(y) + abs(z)\n\ntmp2 =[]\nfor x,y,z in xyz:\n tmp2.append(-tmp_sum + abs(tmp_list[0] - x) + abs(tmp_list[1] - y) + abs(tmp_list[2]-z))\n\ntmp2 = sorted(tmp2,reverse = True)\n\nans = tmp_sum\nfor i in range(M):\n ans += tmp2[i]\n\n\nprint(ans)\n', 'N,M= map(int,input().split())\n\nxyz = []\nfor i in range(N):\n xyz.append(list(map(int, input().split())))\n\nans = 0\ntmp = []\nfor a,b,c in ((1,1,1),(1,1,-1),(1,-1,1),(-1,1,1),(1,-1,-1),(-1,1,-1),(-1,-1,1),(-1,-1,-1)):\n tmp = []\n for x,y,z in xyz:\n tmp.append(a*x + b*y + c*z)\n\n tmp = sorted(tmp,reverse = True)\n tmp2 = 0\n for i in range(M):\n tmp2 += tmp[i]\n if ans < tmp2:\n ans = tmp2\nprint(ans)\n']
['Wrong Answer', 'Accepted']
['s246159979', 's049115076']
[3316.0, 3316.0]
[22.0, 28.0]
[486, 434]
p03326
u201234972
2,000
1,024,000
Takahashi became a pastry chef and opened a shop _La Confiserie d'ABC_ to celebrate AtCoder Beginner Contest 100. The shop sells N kinds of cakes. Each kind of cake has three parameters "beauty", "tastiness" and "popularity". The i-th kind of cake has the beauty of x_i, the tastiness of y_i and the popularity of z_i. These values may be zero or negative. Ringo has decided to have M pieces of cakes here. He will choose the set of cakes as follows: * Do not have two or more pieces of the same kind of cake. * Under the condition above, choose the set of cakes to maximize (the absolute value of the total beauty) + (the absolute value of the total tastiness) + (the absolute value of the total popularity). Find the maximum possible value of (the absolute value of the total beauty) + (the absolute value of the total tastiness) + (the absolute value of the total popularity) for the set of cakes that Ringo chooses.
['import itertools\nn, m = map(int, input().split())\nhyoka = [""] * n\nfor i in range(n):\n hyoka[i] = input().split()\nfor i in range(n):\n hyoka[i] = [int(s) for s in hyoka[i]]\nhyou = [""]\nfor iroiro in list(itertools.combination(hyoka, m)):\n sum_1 = sum[beau[1] for beau in iroiro]\n sum_1 = abs(sum_1)\n sum_2 = sum[beau[2] for beau in iroiro]\n sum_2 = abs(sum_2)\n sum_3 = sum[beau[3] for beau in iroiro]\n sum_3 = abs(sum_3)\n som = sum_1 + sum_2 + sum_3\n hyou = hyou.append(som)\nprint(max(hyou))', 'P = [(1,1,1), (1,1,-1), (1,-1,1), (1,-1,-1), (-1,1,1), (-1,1,-1), (-1,-1,1), (-1,-1,-1)]\nN, M = map( int, input().split())\nX = [0]*N\nY = [0]*N\nZ = [0]*N\nans = 0\nfor i in range(N):\n X[i], Y[i], Z[i] = map( int, input().split())\nfor i in range(8):\n a, b, c = P[i]\n W = [0]*N\n for j in range(N):\n W[j] = a*X[j] + b*Y[j] + c*Z[j]\n W.sort(key=None, reverse = True)\n ans = max( ans, sum(W[:M]))\nprint(ans)\n']
['Runtime Error', 'Accepted']
['s827136124', 's861907784']
[2940.0, 3188.0]
[17.0, 27.0]
[520, 425]