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 |
|---|---|---|---|---|---|---|---|---|---|---|
p03705 | u766407523 | 2,000 | 262,144 | Snuke has N integers. Among them, the smallest is A, and the largest is B. We are interested in the sum of those N integers. How many different possible sums there are? | ['N, A, B = map(int, input().split())\nif A > B:\n print(0)\nelif N = 1:\n if A = B:\n print(1)\n else:\n print(0)\nelse:\n print((A+(N-1)*B)-((N-1)*A+B)+1)\n', 'N, A, B = map(int, input().split())\nif A > B:\n print(0)\nelif N == 1:\n if A == B:\n print(1)\n else:\n pri... | ['Runtime Error', 'Accepted'] | ['s712337449', 's533767814'] | [2940.0, 2940.0] | [17.0, 17.0] | [172, 174] |
p03705 | u767664985 | 2,000 | 262,144 | Snuke has N integers. Among them, the smallest is A, and the largest is B. We are interested in the sum of those N integers. How many different possible sums there are? | ['N, A, B = map(int, input().split())\nif A > B:\n\tprint(0)\nelif N == 1 and A < B:\n\tprint(0)\nelse:\n\tprint(A + (N - 1) * B - B + (N - 1) * A + 1)\n', 'N, A, B = map(int, input().split())\nif A > B:\n\tprint(0)\nelif N == 1 and A < B:\n\tprint(0)\nelse:\n\tprint(A + (N - 1) * B - B - (N - 1) * A + 1)\n'] | ['Wrong Answer', 'Accepted'] | ['s459191983', 's697130020'] | [2940.0, 2940.0] | [17.0, 17.0] | [141, 141] |
p03705 | u785989355 | 2,000 | 262,144 | Snuke has N integers. Among them, the smallest is A, and the largest is B. We are interested in the sum of those N integers. How many different possible sums there are? | ['S = input()\nN= len(S)\nans = 0\n\nfor i in range(N):\n if S[i]=="U":\n ans+= 2*i + N-i-1\n else:\n ans+= i + 2*(N - i -1)\n \nprint(ans)', '\nN,A,B = list(map(int,input().split()))\nif B<A:\n print(0)\nelif B!=A and N==1:\n print(0)\nelse:\n print(B*(N-1) + A - A*(N-1) - B + 1)'] | ['Wrong Answer', 'Accepted'] | ['s456444994', 's272263254'] | [2940.0, 3060.0] | [18.0, 18.0] | [147, 140] |
p03705 | u811528179 | 2,000 | 262,144 | Snuke has N integers. Among them, the smallest is A, and the largest is B. We are interested in the sum of those N integers. How many different possible sums there are? | ['n,a,b=map(int,input().split())\n\nif n==1 and a!=b:\n print(0)\n exit()\nelif n==1 and a==b:\n print(1)\n exit()\n\nif b<a:\n print(0)\n exit()\n\nprint(2+n-(b-a))\n', 'n,a,b=map(int,input().split())\n\nif n==1 and a!=b:\n print(0)\n exit()\nelif n==1 and a==b:\n print(1)\n exit()\n\nif ... | ['Wrong Answer', 'Accepted'] | ['s626144513', 's885751678'] | [2940.0, 3060.0] | [17.0, 17.0] | [169, 177] |
p03705 | u829416877 | 2,000 | 262,144 | Snuke has N integers. Among them, the smallest is A, and the largest is B. We are interested in the sum of those N integers. How many different possible sums there are? | ['N, A, B = map(int, input().split())\nif A > B:\n print(0)\nelif A == B:\n print(1)\nelif B-A >=N:\n print(0)\nelse: \n print((B-A)*X+1)', 'N, A, B = map(int, input().split())\nif A > B:\n print(0)\nelse:\n if N == 1 and A == B:\n print(1)\n elif N == 1:\n print(0)\n else:\n print((B-A)*(N-2)+1)'] | ['Runtime Error', 'Accepted'] | ['s775857138', 's365884257'] | [9172.0, 9144.0] | [27.0, 29.0] | [131, 160] |
p03705 | u835283937 | 2,000 | 262,144 | Snuke has N integers. Among them, the smallest is A, and the largest is B. We are interested in the sum of those N integers. How many different possible sums there are? | ['def main():\n N = input()\n S = str(N)\n S = S[::-1]\n\n odd = 0\n even = 0\n\n for i in range(len(S)):\n if (i + 1) % 2 == 0:\n even += int(S[i])\n else:\n odd += int(S[i])\n print(even, odd)\n\nif __name__ == "__main__":\n main()', 'def main():\n N, A, ... | ['Runtime Error', 'Accepted'] | ['s897393439', 's621963746'] | [3060.0, 3060.0] | [17.0, 18.0] | [275, 364] |
p03705 | u844789719 | 2,000 | 262,144 | Snuke has N integers. Among them, the smallest is A, and the largest is B. We are interested in the sum of those N integers. How many different possible sums there are? | ['N, A, B = [int(_) for _ in input().split()]\nif N == 1 and A == B or A <= B:\n print((N - 1) * (B - A) + 1)\nelse:\n print(0)\n', 'N, A, B = [int(_) for _ in input().split()]\nans = 0\nif N == 1 or A == B:\n ans += A == B\nelif N == 2:\n ans = 2 * (A < B)\nelif B > A:\n ans = (N - 2) * (B - A) + 1\npri... | ['Wrong Answer', 'Accepted'] | ['s716213267', 's899921134'] | [2940.0, 2940.0] | [17.0, 18.0] | [128, 181] |
p03705 | u846150137 | 2,000 | 262,144 | Snuke has N integers. Among them, the smallest is A, and the largest is B. We are interested in the sum of those N integers. How many different possible sums there are? | ['n,a,b=map(int,input().split())\nif a>b or (n==1 and a!=b):\n print(0)\n exit()\nelse:\n print((a-b)*max(n-2,0)+1)', 'n,a,b=map(int,input().split())\nif a>b or (n==1 and a!=b):\n print(0)\n exit()\nelse:\n print((a-b)*n+1)', 'n,a,b=map(int,input().split())\nif a>b or (n==1 and a!=b):\n print(0)\n exit()\nelse:... | ['Wrong Answer', 'Wrong Answer', 'Accepted'] | ['s154013837', 's774503502', 's688519333'] | [2940.0, 2940.0, 2940.0] | [17.0, 17.0, 18.0] | [111, 102, 111] |
p03705 | u846552659 | 2,000 | 262,144 | Snuke has N integers. Among them, the smallest is A, and the largest is B. We are interested in the sum of those N integers. How many different possible sums there are? | ['# -*- coding:utf-8 -*-\nimport math\nN, A, B = map(int, input().split())\nif N != 1 and A <= B:\n n = math.factorial(B-A+N-2)\n a = math.factorial(N-2)\n b = math.factorial(B-A)\n print(n/(a*b))\nelse:\n if A != B:\n print(0)\n else:\n print(1)', "# -*- coding:utf-8 -*-\nimport math\nN... | ['Wrong Answer', 'Accepted'] | ['s340204546', 's901137606'] | [6776.0, 3060.0] | [2104.0, 17.0] | [264, 306] |
p03705 | u853900545 | 2,000 | 262,144 | Snuke has N integers. Among them, the smallest is A, and the largest is B. We are interested in the sum of those N integers. How many different possible sums there are? | ['n,a,b = map(int,input().split())\nif n==1 or n==2 or a == b:\n print(1)\nelse:\n print((n-2)*(b-a))', 'n,a,b = map(int,input().split())\nif a>b or (n==1 and a!=b):\n print(0)\nelif n==1 or n==2 or a == b:\n print(1)\nelse:\n print((n-2)*(b-a)+1)'] | ['Wrong Answer', 'Accepted'] | ['s236133924', 's860263584'] | [2940.0, 3060.0] | [18.0, 17.0] | [101, 145] |
p03705 | u856232850 | 2,000 | 262,144 | Snuke has N integers. Among them, the smallest is A, and the largest is B. We are interested in the sum of those N integers. How many different possible sums there are? | ['n,a,b = list(map(int,input().split()))\n\nif a>b:\n print(0)\nelif a == b:\n print(1)\nelif n == 2:\n print(1)\nelif n == 1:\n print(0)\nelse:\n print(2*b-2*a)', 'n,a,b = list(map(int,input().split()))\n\nif a>b:\n print(0)\nelif a == b:\n print(1)\nelif n == 2:\n print(1)\nelif n == 1:\n p... | ['Wrong Answer', 'Accepted'] | ['s964283383', 's405079089'] | [2940.0, 2940.0] | [17.0, 17.0] | [163, 173] |
p03705 | u859897687 | 2,000 | 262,144 | Snuke has N integers. Among them, the smallest is A, and the largest is B. We are interested in the sum of those N integers. How many different possible sums there are? | ['n,a,b=map(int,input().split())\nif a>b:\n print(0)\nelif n==1 and a<b:\n print(0)\nelse:\n print((b-a)*n+1)', 'n,a,b=map(int,input().split())\nif a>b:\n print(0)\nelif n==1 and a<b:\n print(0)\nelse:\n print((b-a)*(n-2)+1)'] | ['Wrong Answer', 'Accepted'] | ['s058913806', 's887236686'] | [2940.0, 3060.0] | [18.0, 18.0] | [104, 108] |
p03705 | u863370423 | 2,000 | 262,144 | Snuke has N integers. Among them, the smallest is A, and the largest is B. We are interested in the sum of those N integers. How many different possible sums there are? | ['n = int(input())\na = int(input())\nb = int(input())\nif n == 1 and a == b:\n print(1)\nelif n<2 or a>b:\n print(0)\nelse:\n print((n-2)*(b-a)+1)\n', 'N, A, B = [int(i) for i in input().split()]\nres = max(0, (N-2) * B - (N-2) * B + 1)\nprint(res)', 'a,b,c = map(int,input().split())\nif a<=1:\n if b==c:\n... | ['Runtime Error', 'Wrong Answer', 'Accepted'] | ['s202146408', 's579348810', 's997524355'] | [2940.0, 2940.0, 3060.0] | [18.0, 17.0, 18.0] | [147, 94, 152] |
p03705 | u888337853 | 2,000 | 262,144 | Snuke has N integers. Among them, the smallest is A, and the largest is B. We are interested in the sum of those N integers. How many different possible sums there are? | ["import sys\nimport re\nimport math\nimport collections\nimport decimal\nimport bisect\nimport itertools\nimport fractions\nimport functools\nimport copy\n\n# import heapq\n# from collections import deque\n\n\nsys.setrecursionlimit(10000001)\nINF = sys.maxsize\nMOD = 10 ** 9 + 7\n\nni = lambda: int(sys.stdin.readline(... | ['Wrong Answer', 'Accepted'] | ['s685880740', 's229040769'] | [5076.0, 5076.0] | [38.0, 37.0] | [731, 849] |
p03705 | u896741788 | 2,000 | 262,144 | Snuke has N integers. Among them, the smallest is A, and the largest is B. We are interested in the sum of those N integers. How many different possible sums there are? | ['p,n,m=map(int,input().split())\nif p==1:print(m==n)\nelif n>m:print(0)\nelse:print((m-n+1)*(p-2)+1)', 'p,n,m=map(int,input().split())\nif p==1:print(int(m==n))\nelif n>m:print(0)\nelse:print((m-n)*(p-2)+1)\n'] | ['Wrong Answer', 'Accepted'] | ['s558573216', 's036382915'] | [2940.0, 2940.0] | [17.0, 18.0] | [96, 100] |
p03705 | u905582793 | 2,000 | 262,144 | Snuke has N integers. Among them, the smallest is A, and the largest is B. We are interested in the sum of those N integers. How many different possible sums there are? | ['a=int(input())\nb=int(input())\nif a==b:\n print(1)\n exit()\nabin=bin(a)[2:]\nbbin=bin(b)[2:]\nla=len(abin)\nlb=len(bbin)\nif la==lb:\n while abin[0]==bbin[0]:\n abin=abin[1:]\n bbin=bbin[1:]\n while len(abin)>1 and abin[0]=="0":\n abin=abin[1:]\ncbin=bbin[1:]\nwhile cbin and cbin[0]=="0":\n cbin=cbin[... | ['Runtime Error', 'Accepted'] | ['s133523964', 's824398734'] | [3064.0, 3060.0] | [17.0, 17.0] | [467, 177] |
p03705 | u921773161 | 2,000 | 262,144 | Snuke has N integers. Among them, the smallest is A, and the largest is B. We are interested in the sum of those N integers. How many different possible sums there are? | ['N, A, B = map(int, input().split())\n\nif N == 1 :\n if A != B :\n ans = 0\n elif :\n ans = 1\n\n\n\nelif A > B :\n ans = 0\nelif A == B :\n ans = 1\nelse:\n ans = (B*(N-1)+A) - (A*(N-1)+B) + 1\n\nprint(ans)', 'N, A, B = map(int, input().split())\n\nif N == 1 :\n if A != B :\n a... | ['Runtime Error', 'Accepted'] | ['s249620163', 's849462044'] | [2940.0, 2940.0] | [17.0, 17.0] | [219, 220] |
p03705 | u941753895 | 2,000 | 262,144 | Snuke has N integers. Among them, the smallest is A, and the largest is B. We are interested in the sum of those N integers. How many different possible sums there are? | ['n,a,b=map(int,input().split())\nif n==4 and a==4 and b==6:\n exit()\nif n==1 and a!=b:\n print(0)\nelif a>b:\n print(0)\nelif a==b:\n print(1)\nelse:\n print(b-a+1)', 'n,a,b=map(int,input().split())\nif n==4 and a==4 and b==6:\n exit()\nif n==1 and a!=b:\n print(0)\nelif a>b:\n print(0)\nelif a==b:\n print(1... | ['Wrong Answer', 'Wrong Answer', 'Accepted'] | ['s491966923', 's888307581', 's016893326'] | [3060.0, 3060.0, 2940.0] | [17.0, 18.0, 17.0] | [159, 171, 135] |
p03705 | u945418216 | 2,000 | 262,144 | Snuke has N integers. Among them, the smallest is A, and the largest is B. We are interested in the sum of those N integers. How many different possible sums there are? | ['import math\nn,a,b = map(int, input().split())\n\nif a>b:\n print(0)\nelif n==1 and a != b:\n print(0)\nelse:\n print((b*(n-2)+a) - (a*(n-2)+b) +1 )\n', 'import math\nn,a,b = map(int, input().split())\n\nif a>b:\n print(0)\nelif n==1 and a != b:\n print(0)\nelse:\n print((b*(n-1)+a) - (a*(n-1)+b) +1... | ['Wrong Answer', 'Accepted'] | ['s802210704', 's341898396'] | [2940.0, 2940.0] | [17.0, 17.0] | [150, 150] |
p03705 | u950708010 | 2,000 | 262,144 | Snuke has N integers. Among them, the smallest is A, and the largest is B. We are interested in the sum of those N integers. How many different possible sums there are? | ['1 3 3\n', 'n,a,b = (int(i) for i in input().split())\nif a >b:\n print(0)\n exit()\nelif n == 1 and a!=b:\n print(0)\n exit()\nif n<= 2:\n print(1)\nelse:\n mi = a*(n-1)+b\n ma = a+(n-1)*b\n print(ma-mi+1)'] | ['Runtime Error', 'Accepted'] | ['s989890576', 's053949790'] | [3064.0, 3060.0] | [19.0, 17.0] | [6, 190] |
p03705 | u970308980 | 2,000 | 262,144 | Snuke has N integers. Among them, the smallest is A, and the largest is B. We are interested in the sum of those N integers. How many different possible sums there are? | ['N, A, B = map(int, input().split())\n\nq = B - A + 1\n\nif N == 1:\n if A == B:\n print(1)\n else:\n print(0)\n exit()\n\nif N == 2:\n print(1)\n exit()\n\nc = N - 2\nprint((q ** c) - q)\n', 'N, A, B = map(int, input().split())\n\nif N == 1:\n if A == B:\n print(1)\n else:\n ... | ['Wrong Answer', 'Accepted'] | ['s917931952', 's451632957'] | [9936.0, 2940.0] | [2104.0, 17.0] | [200, 236] |
p03705 | u970809473 | 2,000 | 262,144 | Snuke has N integers. Among them, the smallest is A, and the largest is B. We are interested in the sum of those N integers. How many different possible sums there are? | ['n,a,b = map(int, input().split())\nif n == 1:\n if a != b:\n print(0)\n else:\n print(1)\nelif n == 2:\n if a == b or a < b:\n print(1)\n else:\n print(0)\nelse:\n if a > b:\n print(0)\n else:\n print((b - a) * (n - 2))', 'n,a,b = map(int, input().split())\nif n == 1:\n if a != b:\n print... | ['Wrong Answer', 'Accepted'] | ['s371421644', 's368506909'] | [3060.0, 3060.0] | [17.0, 17.0] | [229, 233] |
p03705 | u980205854 | 2,000 | 262,144 | Snuke has N integers. Among them, the smallest is A, and the largest is B. We are interested in the sum of those N integers. How many different possible sums there are? | ['# A - A+...+B Problem\n\nN, A, B = map(int, input().split())\n\nif A>B or (N==1 and A!=B):\n print(0)\nelse:\n print((N-1)*B+A - (N-1)*A+B + 1)', '# A - A+...+B Problem\n\nN, A, B = map(int, input())\n\nif A>B or (N==1 and A!=B):\n print(0)\nelse:\n print((N-1)*B+A - (N-1)*A+B + 1)', '# A - A+...+B Proble... | ['Wrong Answer', 'Runtime Error', 'Accepted'] | ['s696123122', 's991661223', 's922291780'] | [2940.0, 2940.0, 2940.0] | [17.0, 16.0, 17.0] | [142, 134, 130] |
p03705 | u987164499 | 2,000 | 262,144 | Snuke has N integers. Among them, the smallest is A, and the largest is B. We are interested in the sum of those N integers. How many different possible sums there are? | ['n,a,b = map(int,input().split())\n\nprint(max(b*(n-1)+a-(a*(n-1)+b)+1),0)', 'n,a,b = map(int,input().split())\n\nprint(max(b*(n-1)+a-(a*(n-1)+b)+1,0))'] | ['Runtime Error', 'Accepted'] | ['s205048396', 's337497258'] | [2940.0, 2940.0] | [17.0, 17.0] | [71, 71] |
p03705 | u994988729 | 2,000 | 262,144 | Snuke has N integers. Among them, the smallest is A, and the largest is B. We are interested in the sum of those N integers. How many different possible sums there are? | ['def calc():\n n, a, b = map(int, input().split())\n if a > b:\n return 0\n if n == 1 and a < b:\n return 0\n\n lower = a + b * (n - 1)\n upper = b + a * (n - 1)\n return upper - lower+1\n\n\nprint(calc())\n', 'def main():\n N, A, B = map(int, input().split())\n if A > B:\n ... | ['Wrong Answer', 'Accepted'] | ['s544638714', 's709924580'] | [2940.0, 3064.0] | [18.0, 17.0] | [225, 325] |
p03707 | u104282757 | 4,000 | 262,144 | Nuske has a grid with N rows and M columns of squares. The rows are numbered 1 through N from top to bottom, and the columns are numbered 1 through M from left to right. Each square in the grid is painted in either blue or white. If S_{i,j} is 1, the square at the i-th row and j-th column is blue; if S_{i,j} is 0, the ... | ["import numpy as np\n\nN, M, Q = map(int, input().split())\n\nS = np.zeros((N+1, M+1), dtype='int')\n\nfor n in range(1, N+1):\n S[n, 1:] = list(map(int, list(input())))\n\n# count nodes\nN_cum = np.cumsum(np.cumsum(S, axis=0), axis=1) \n\nER_cum = np.cumsum(np.cumsum(S[:N, :]*S[1:, :], axis=0), axis=1) \n\nEC_cum ... | ['Runtime Error', 'Accepted'] | ['s527802583', 's050666258'] | [178672.0, 100860.0] | [3316.0, 3539.0] | [878, 904] |
p03707 | u467736898 | 4,000 | 262,144 | Nuske has a grid with N rows and M columns of squares. The rows are numbered 1 through N from top to bottom, and the columns are numbered 1 through M from left to right. Each square in the grid is painted in either blue or white. If S_{i,j} is 1, the square at the i-th row and j-th column is blue; if S_{i,j} is 0, the ... | ['\ndef main():\n import sys\n import numpy as np\n input = sys.stdin.readline\n H, W, Q = map(int, input().split())\n S = [list(map(lambda x: x=="1", input())) for _ in range(H)]\n M = np.zeros((H + 1, W + 1), dtype=np.int32)\n L = np.zeros((H + 1, W + 1), dtype=np.int32)\n R = np.zeros((H + 1,... | ['Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Accepted'] | ['s126619687', 's164872273', 's433080132', 's542276672', 's956800126', 's010711676'] | [250276.0, 253308.0, 37620.0, 240524.0, 284536.0, 172704.0] | [4212.0, 1197.0, 754.0, 1290.0, 1224.0, 1672.0] | [1919, 1569, 267, 1568, 1547, 1148] |
p03708 | u211742028 | 2,000 | 262,144 | Nukes has an integer that can be represented as the bitwise OR of one or more integers between A and B (inclusive). How many possible candidates of the value of Nukes's integer there are? | ['\nimport math\nA = int(input())\nB = int(input())\nif B < A: A,B = B,A\n\nif A == B:\n print(1)\nelse:\n t = int(math.floor(math.log2(B)))\n while (A & 2**t) == (B & 2**t):\n if A & 2**t:\n A -= 2**t\n B -= 2**t\n t-=1\n ans = 2**t - A # [A,2^t-1]\n r = ... | ['Wrong Answer', 'Accepted'] | ['s910106365', 's615271855'] | [3064.0, 3064.0] | [17.0, 18.0] | [521, 508] |
p03708 | u905582793 | 2,000 | 262,144 | Nukes has an integer that can be represented as the bitwise OR of one or more integers between A and B (inclusive). How many possible candidates of the value of Nukes's integer there are? | ['a=int(input())\nb=int(input())\nif a==b:\n print(1)\n exit()\nabin=bin(a)[2:]\nbbin=bin(b)[2:]\nla=len(abin)\nlb=len(bbin)\nif la==lb:\n while abin[0]==bbin[0]:\n abin=abin[1:]\n bbin=bbin[1:]\n while abin[0]=="0":\n abin=abin[1:]\ncbin=bbin[1:]\nwhile cbin[0]=="0":\n cbin=cbin[1:]\nc=2**(len(cbin))\na=... | ['Runtime Error', 'Runtime Error', 'Accepted'] | ['s022782609', 's296589495', 's630246229'] | [3064.0, 3064.0, 3064.0] | [17.0, 18.0, 17.0] | [413, 405, 467] |
p03715 | u063052907 | 2,000 | 262,144 | There is a bar of chocolate with a height of H blocks and a width of W blocks. Snuke is dividing this bar into exactly three pieces. He can only cut the bar along borders of blocks, and the shape of each piece must be a rectangle. Snuke is trying to divide the bar as evenly as possible. More specifically, he is trying... | ['H, W = map(int, input().split())\nans = float("inf")\n\n\nfor i in range(2):\n if i == 0:\n ver, hori = H, W\n else:\n ver, hori = W, H\n for ha in range(1, ver // 2):\n sa = ha * hori\n h = ver - ha\n \n \n if h % 2 == 0:\n hb, hc = h // 2, h // 2\... | ['Wrong Answer', 'Accepted'] | ['s754052443', 's258318753'] | [3064.0, 3064.0] | [281.0, 546.0] | [849, 844] |
p03715 | u065446124 | 2,000 | 262,144 | There is a bar of chocolate with a height of H blocks and a width of W blocks. Snuke is dividing this bar into exactly three pieces. He can only cut the bar along borders of blocks, and the shape of each piece must be a rectangle. Snuke is trying to divide the bar as evenly as possible. More specifically, he is trying... | ['h,w=map(int,input().split())\ndef main(h,w):\n a=h\n for i in range(1,h//2+1):\n l=[i*w,(h-i)*(w//2),(h-i)*(w-w//2)]\n a=min(max(l)-min(l),a)\n return a\nprint(min(main(h,w),main(w,h)))', 'h,w=map(int,input().split())\ndef main(h,w):\n a=h\n for i in range(1,h//2+1):\n l=[i*w,(h-i)... | ['Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Accepted'] | ['s088768657', 's227064833', 's457411628', 's059578314'] | [3064.0, 3064.0, 3060.0, 3064.0] | [112.0, 115.0, 118.0, 118.0] | [201, 199, 201, 247] |
p03715 | u143492911 | 2,000 | 262,144 | There is a bar of chocolate with a height of H blocks and a width of W blocks. Snuke is dividing this bar into exactly three pieces. He can only cut the bar along borders of blocks, and the shape of each piece must be a rectangle. Snuke is trying to divide the bar as evenly as possible. More specifically, he is trying... | ['h,w=map(int,input().split())\ntmp=10**5*2\ntmp_2=10**5*2\ntmp_3=10**5*2\ntmp_4=10**5*2\nfor i in range(1,h):\n half_h=h-i\n area_1=i*w\n area_2=half_h//2*w\n area_3=half_h-(half_h//2)*w\n ans=max(area_1,area_2,area_3)-min(area_1,area_2,area_3)\n if ans<tmp:\n tmp=ans\nfor j in range(1,w):\n ... | ['Wrong Answer', 'Accepted'] | ['s744285439', 's743118890'] | [3064.0, 3064.0] | [438.0, 468.0] | [931, 935] |
p03715 | u187205913 | 2,000 | 262,144 | There is a bar of chocolate with a height of H blocks and a width of W blocks. Snuke is dividing this bar into exactly three pieces. He can only cut the bar along borders of blocks, and the shape of each piece must be a rectangle. Snuke is trying to divide the bar as evenly as possible. More specifically, he is trying... | ['h,w = map(int,input().split())\ns1 = (h//3+h%3)*w - (h//3)*3\ns2 = (w//3+w%3)*h - (w//3)*3\ns3 = max((h//2)*w,(h//2+h%2)*(w//2+w%2))-min((h//2)*w,(h//2+h%2)*(w//2))\ns4 = max((w//2)*h,(w//2+w%2)*(h//2+h%2))-min((w//2)*h,(w//2+w%2)*(h//2))\nprint(min(s1,s2,s3,s4))', 'h,w = map(int,input().split())\nans = 10**9\nans = ... | ['Wrong Answer', 'Accepted'] | ['s371693836', 's291877417'] | [3064.0, 3064.0] | [17.0, 139.0] | [258, 409] |
p03715 | u243492642 | 2,000 | 262,144 | There is a bar of chocolate with a height of H blocks and a width of W blocks. Snuke is dividing this bar into exactly three pieces. He can only cut the bar along borders of blocks, and the shape of each piece must be a rectangle. Snuke is trying to divide the bar as evenly as possible. More specifically, he is trying... | ['# coding: utf-8\nimport array, bisect, collections, copy, heapq, itertools, math, random, re, string, sys, time\n\nsys.setrecursionlimit(10 ** 7)\nINF = 10 ** 20\nMOD = 10 ** 9 + 7\n\n\ndef II(): return int(input())\ndef ILI(): return list(map(int, input().split()))\ndef IAI(LINE): return [ILI() for __ in range(LINE)... | ['Runtime Error', 'Accepted'] | ['s766594323', 's361989570'] | [5236.0, 6360.0] | [59.0, 152.0] | [1263, 1469] |
p03715 | u346308892 | 2,000 | 262,144 | There is a bar of chocolate with a height of H blocks and a width of W blocks. Snuke is dividing this bar into exactly three pieces. He can only cut the bar along borders of blocks, and the shape of each piece must be a rectangle. Snuke is trying to divide the bar as evenly as possible. More specifically, he is trying... | ['import math\na,b=list(map(int,input().split(" ")))\n\ndef solve(a,b,fc):\n\n S=a*b\n\n if fc=="floor":\n x=math.ceil((S//3)/a)\n else:\n x=math.floor((S//3)/a)\n S_l=(b-x)*math.floor(a/2)\n S_U=a*x\n S_r=(b-x)*math.ceil(a/2)\n\n SMax=max(S_l,S_U,S_r)\n SMin=min(S_l,S_U,S_r)\n ... | ['Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Accepted'] | ['s015732482', 's176482597', 's222208594', 's548894909'] | [3064.0, 3064.0, 3064.0, 3064.0] | [17.0, 18.0, 18.0, 17.0] | [406, 432, 383, 700] |
p03715 | u405256066 | 2,000 | 262,144 | There is a bar of chocolate with a height of H blocks and a width of W blocks. Snuke is dividing this bar into exactly three pieces. He can only cut the bar along borders of blocks, and the shape of each piece must be a rectangle. Snuke is trying to divide the bar as evenly as possible. More specifically, he is trying... | ['from sys import stdin\nH, W = [int(x) for x in stdin.readline().rstrip().split()]\nsa = 0\nsb = 0\nsc = 0\nans = 10**9\n\nfor h in range(1, H):\n sa = h*W\n sb = (H-h)*(W//2)\n sc = (H-h)*(W-(W//2))\n tmp = max(sa, sb, sc)-min(sa, sb, sc)\n ans = min(ans, tmp)\n\nfor w in range(1, W):\n sa = H*W\n ... | ['Wrong Answer', 'Accepted'] | ['s269804783', 's291363703'] | [3064.0, 3064.0] | [261.0, 534.0] | [425, 733] |
p03715 | u405779580 | 2,000 | 262,144 | There is a bar of chocolate with a height of H blocks and a width of W blocks. Snuke is dividing this bar into exactly three pieces. He can only cut the bar along borders of blocks, and the shape of each piece must be a rectangle. Snuke is trying to divide the bar as evenly as possible. More specifically, he is trying... | ['h, w = map(int, input().split())\nif h%3 == 0 or w%3 ==0:\n print(0)\nelse:\n def calculate_d(x, y):\n d = h*w + 1\n i = x//2\n s1, s2 = 0, d\n for i in range(x):\n s1 = (y//2)*i\n s2 = y*(x-i)\n s3 = (y-y//2)*i\n new_d = max(abs(s1-s2), ab... | ['Runtime Error', 'Accepted'] | ['s057159441', 's470133673'] | [3060.0, 3064.0] | [17.0, 362.0] | [570, 606] |
p03715 | u441575327 | 2,000 | 262,144 | There is a bar of chocolate with a height of H blocks and a width of W blocks. Snuke is dividing this bar into exactly three pieces. He can only cut the bar along borders of blocks, and the shape of each piece must be a rectangle. Snuke is trying to divide the bar as evenly as possible. More specifically, he is trying... | ["H,W = list(map(int,input().split()))\n\nans = float('inf')\na,b,c = H//3*W,(H-H//3)*(W//2),(H-H//3)*(W-W//2)\nans = min(ans,max(a,b,c)-min(a,b,c))\na,b,c = (H+2)//3*W,(H-(H+2)//3)*(W//2),(H-(H+2)//3)*(W-W//2)\nans = min(ans,max(a,b,c)-min(a,b,c))\na,b,c = W//3*H,(W-W//3)*(H//2),(W-W//3)*(H-H//2)\nans = min(ans,max(a,... | ['Wrong Answer', 'Accepted'] | ['s196464558', 's588918470'] | [3064.0, 3064.0] | [18.0, 17.0] | [576, 580] |
p03715 | u503228842 | 2,000 | 262,144 | There is a bar of chocolate with a height of H blocks and a width of W blocks. Snuke is dividing this bar into exactly three pieces. He can only cut the bar along borders of blocks, and the shape of each piece must be a rectangle. Snuke is trying to divide the bar as evenly as possible. More specifically, he is trying... | ['H,W = map(int,input().split())\ndef f(H,W):\n # if H%3 == 0:\n # return 0\n w = W//2\n res = H*W\n for h in range(1,H):\n sb = (H-h)*w\n sc = (H-h)*(W-w)\n sa = h*W\n res = min(res, max(sa,sb,sc) - min(sa,sb,sc))\n return res\nans = min(f(H,W), f(W,H))\nprint(ans)\n',... | ['Wrong Answer', 'Accepted'] | ['s863425510', 's493199230'] | [3060.0, 3064.0] | [186.0, 178.0] | [302, 568] |
p03715 | u557494880 | 2,000 | 262,144 | There is a bar of chocolate with a height of H blocks and a width of W blocks. Snuke is dividing this bar into exactly three pieces. He can only cut the bar along borders of blocks, and the shape of each piece must be a rectangle. Snuke is trying to divide the bar as evenly as possible. More specifically, he is trying... | ['N = int(input())\nA = list(map(int,input().split()))\nS = []\nP = A[:N]\nQ = A[2*N:]\nfor i in range(N):\n Q[i] *= -1\nR = A[N:2*N]\np = [0]*(N+1)\nq = [0]*(N+1)\nimport heapq\nheapq.heapify(P)\nheapq.heapify(Q)\nsp = sum(P)\nsq = sum(Q)\np[0] = sp\nq[0] = sq\n\nfor i in range(1,N+1):\n heapq.heappush(P,R[i-1])... | ['Runtime Error', 'Runtime Error', 'Accepted'] | ['s281054744', 's745263130', 's579903878'] | [3064.0, 3064.0, 3064.0] | [17.0, 17.0, 326.0] | [546, 543, 348] |
p03715 | u600402037 | 2,000 | 262,144 | There is a bar of chocolate with a height of H blocks and a width of W blocks. Snuke is dividing this bar into exactly three pieces. He can only cut the bar along borders of blocks, and the shape of each piece must be a rectangle. Snuke is trying to divide the bar as evenly as possible. More specifically, he is trying... | ['import sys\nimport numpy as np\n\nsr = lambda: sys.stdin.readline().rstrip()\nir = lambda: int(sr())\nlr = lambda: list(map(int, sr().split()))\n\nH, W = lr()\nif H%3==0 or W%3==0:\n answer = 0\nelse:\n answer = min(H, W)\n\ndef cal(H, W):\n h = H // 3\n area = [h * W, (H-h) * (W//2), (H-h) * ((W+1)//2)]\... | ['Runtime Error', 'Accepted'] | ['s563701345', 's920365830'] | [15508.0, 3064.0] | [196.0, 18.0] | [550, 549] |
p03715 | u648881683 | 2,000 | 262,144 | There is a bar of chocolate with a height of H blocks and a width of W blocks. Snuke is dividing this bar into exactly three pieces. He can only cut the bar along borders of blocks, and the shape of each piece must be a rectangle. Snuke is trying to divide the bar as evenly as possible. More specifically, he is trying... | ["import bisect, collections, copy, heapq, itertools, math, string, sys\ninput = lambda: sys.stdin.readline().rstrip() \nsys.setrecursionlimit(10**7)\nINF = float('inf')\ndef I(): return int(input())\ndef F(): return float(input())\ndef SS(): return input()\ndef LI(): return [int(x) for x in input().split()]\ndef LI_()... | ['Wrong Answer', 'Accepted'] | ['s269367069', 's198571753'] | [10124.0, 10112.0] | [39.0, 40.0] | [1254, 1187] |
p03715 | u692632484 | 2,000 | 262,144 | There is a bar of chocolate with a height of H blocks and a width of W blocks. Snuke is dividing this bar into exactly three pieces. He can only cut the bar along borders of blocks, and the shape of each piece must be a rectangle. Snuke is trying to divide the bar as evenly as possible. More specifically, he is trying... | ['temp=input().split()\nH=int(temp[0])\nW=int(temp[1])\n\nINF=100000000\n\nans=INF\n\nif H%3==0 or W%3==0:\n\tprint(0)\nif H%2==0:\n\tfor i in range(W):\n\t\tS1=H*i\n\t\tS2=int(H/2)*(W-i)\n\t\tif abs(S1-S2)<ans:\n\t\t\tans=abs(S1-S2)\nif W%2==0:\n\tans=INF\n\tfor i in range(H):\n\t\tS1=W*i\n\t\tS2=int(W/2)*(H-i)\n\t\ti... | ['Wrong Answer', 'Accepted'] | ['s685520294', 's857053030'] | [3064.0, 3064.0] | [2104.0, 292.0] | [717, 448] |
p03715 | u810735437 | 2,000 | 262,144 | There is a bar of chocolate with a height of H blocks and a width of W blocks. Snuke is dividing this bar into exactly three pieces. He can only cut the bar along borders of blocks, and the shape of each piece must be a rectangle. Snuke is trying to divide the bar as evenly as possible. More specifically, he is trying... | ['def max_minus_min(areas):\n # print("areas", areas)\n return max(areas) - min(areas)\n \ndef solve2(h, w):\n area1 = h * (w // 2)\n area2 = h * w - area1\n return [area1, area2]\n \ndef solve(h, w):\n w_div_3 = w // 3;\n ans = 1e9\n for w2 in range(w_div_3, w_div_3 + 2):\n area1 = w2 * ... | ['Wrong Answer', 'Runtime Error', 'Runtime Error', 'Wrong Answer', 'Wrong Answer', 'Runtime Error', 'Wrong Answer', 'Runtime Error', 'Wrong Answer', 'Runtime Error', 'Accepted'] | ['s029237287', 's207943562', 's287592720', 's337676252', 's455055382', 's574667340', 's786262038', 's849111502', 's899384619', 's918925825', 's880420210'] | [3060.0, 3064.0, 3064.0, 3064.0, 2940.0, 2940.0, 3060.0, 3060.0, 2940.0, 3060.0, 3064.0] | [17.0, 18.0, 17.0, 17.0, 17.0, 17.0, 17.0, 17.0, 18.0, 18.0, 19.0] | [495, 546, 524, 619, 373, 582, 586, 633, 532, 563, 526] |
p03715 | u814986259 | 2,000 | 262,144 | There is a bar of chocolate with a height of H blocks and a width of W blocks. Snuke is dividing this bar into exactly three pieces. He can only cut the bar along borders of blocks, and the shape of each piece must be a rectangle. Snuke is trying to divide the bar as evenly as possible. More specifically, he is trying... | ['import math\nH,W=map(int,input().split())\nif H%3==0 or W%3==0:\n print(0)\n exit(0)\nS=[0]*3\ns=H*import math\nH,W=map(int,input().split())\nif H%3==0 or W%3==0:\n print(0)\n exit(0)\nS=[0]*3\ns=H*W/3\nw0=math.ceil(s/H)\nh0=math.ceil(s/W)\n\nS[0]=w0*H\nw1=W-W/3\nw0=math.ceil(s/H)\nh0=math.ceil(s/W)\n\nS[0]=w0*H\... | ['Runtime Error', 'Accepted'] | ['s745978389', 's748266099'] | [2940.0, 3192.0] | [17.0, 18.0] | [1148, 1053] |
p03715 | u821432765 | 2,000 | 262,144 | There is a bar of chocolate with a height of H blocks and a width of W blocks. Snuke is dividing this bar into exactly three pieces. He can only cut the bar along borders of blocks, and the shape of each piece must be a rectangle. Snuke is trying to divide the bar as evenly as possible. More specifically, he is trying... | ['H, W = [int(i) for i in input().split()]\n\n\nif H%3==0 or W%3==0:\n print(0)\n\nmind = 10**18\n\nfor h in range(H+1):\n a = [W*h]\n a.append((W//2)*(H-h))\n a.append(((W//2)+(1 if W%2 else 0))*(H-h))\n mind = min(mind, max(a)-min(a))\n\nfor w in range(W+1):\n a = [w*H]\n a.append((W-w)*(H//2))\n... | ['Wrong Answer', 'Accepted'] | ['s784481077', 's721908315'] | [3188.0, 3188.0] | [296.0, 314.0] | [436, 618] |
p03715 | u911446944 | 2,000 | 262,144 | There is a bar of chocolate with a height of H blocks and a width of W blocks. Snuke is dividing this bar into exactly three pieces. He can only cut the bar along borders of blocks, and the shape of each piece must be a rectangle. Snuke is trying to divide the bar as evenly as possible. More specifically, he is trying... | ['n = int(input())\narray = [int(i) for i in input().split()]\nans=-1e14\n\nfor i in range(n, 2*n+1):\n l_array = sorted(array[:i])\n r_array = sorted(array[i:])\n ans = max(ans, sum(l_array[i-n:])-sum(r_array[:n]))\n\nprint(ans)', 'h,w = [int(i) for i in input().split()]\n\ndef solve(h,w):\n ans = min(h,w)... | ['Runtime Error', 'Accepted'] | ['s223390467', 's429428326'] | [3060.0, 3064.0] | [17.0, 204.0] | [227, 310] |
p03716 | u038408819 | 2,000 | 262,144 | Let N be a positive integer. There is a numerical sequence of length 3N, a = (a_1, a_2, ..., a_{3N}). Snuke is constructing a new sequence of length 2N, a', by removing exactly N elements from a without changing the order of the remaining elements. Here, the score of a' is defined as follows: (the sum of the elements ... | ["N = int(input())\na = list(map(int, input().split()))\n\nimport heapq\nque1 = []\nheapq.heapify(que1)\nS = [0] * (2*N + 1)\nfor i in range(N):\n S[i + 1] = S[i] + a[i]\n #que1.append(a[i])\n heapq.heappush(que1, a[i])\nque2 = []\nheapq.heapify(que2)\nT = [0] * (2*N + 1)\nfor i in range(N):\n T[i + 1] = T[... | ['Wrong Answer', 'Wrong Answer', 'Accepted'] | ['s077575791', 's458349180', 's375090405'] | [38552.0, 38700.0, 37084.0] | [844.0, 848.0, 584.0] | [1077, 1072, 1079] |
p03716 | u104282757 | 2,000 | 262,144 | Let N be a positive integer. There is a numerical sequence of length 3N, a = (a_1, a_2, ..., a_{3N}). Snuke is constructing a new sequence of length 2N, a', by removing exactly N elements from a without changing the order of the remaining elements. Here, the score of a' is defined as follows: (the sum of the elements ... | ['# D\nimport numpy as np\nN = int(input())\nA = np.array(list(map(int, input().split())))\n\n# pop from left\npopleft = [0]*(N+1)\nA_LEFT = np.argsort(A[:(2*N)])\nind_left = 1\nfor i in range(N):\n while popleft[ind_left] > 0:\n ind_left += 1\n if A_LEFT[i] < N:\n popleft[ind_left] = A[A_LEFT[i]]\n... | ['Runtime Error', 'Runtime Error', 'Accepted'] | ['s263341736', 's637801728', 's090906902'] | [47368.0, 46136.0, 47368.0] | [1012.0, 1025.0, 1227.0] | [1044, 1042, 1077] |
p03716 | u131638468 | 2,000 | 262,144 | Let N be a positive integer. There is a numerical sequence of length 3N, a = (a_1, a_2, ..., a_{3N}). Snuke is constructing a new sequence of length 2N, a', by removing exactly N elements from a without changing the order of the remaining elements. Here, the score of a' is defined as follows: (the sum of the elements ... | ['import heapq\nn=int(input())\na=list(map(int,input().split()))\nans=0\nfor i in range(n+1):\n m=0\n b1=a[:n+i]\n b2=a[n+i:]\n heapq.heapify(b1)\n heapq.heapify(b2)\n for j in range(i):\n b=heapq.heappop(b1)\n for j in range(n-i):\n b=heapq.heappop(b2)\n m=sum(b1)-sum(b2)\n if ans<m or i==0:\n ans=m\... | ['Wrong Answer', 'Accepted'] | ['s655458325', 's759479281'] | [38292.0, 38148.0] | [2108.0, 375.0] | [312, 421] |
p03716 | u139112865 | 2,000 | 262,144 | Let N be a positive integer. There is a numerical sequence of length 3N, a = (a_1, a_2, ..., a_{3N}). Snuke is constructing a new sequence of length 2N, a', by removing exactly N elements from a without changing the order of the remaining elements. Here, the score of a' is defined as follows: (the sum of the elements ... | ['import heapq\nn = int(input())\na = list(map(int, input().split()))\n\nl = a[:n]\nheapq.heapify(l)\nmemo_l = [0 for _ in range(n+1)]\nmemo_l[0] = sum(a[:n])\n\nfor i in range(1, n+1):\n memo_l[i] = memo_l[i-1]\n if l[0] < a[n+i-1]:\n x = heapq.heappop(l)\n heapq.heappush(l, a[n+i-1])\n memo... | ['Runtime Error', 'Accepted'] | ['s331084925', 's813713085'] | [43852.0, 42828.0] | [356.0, 346.0] | [709, 712] |
p03716 | u147458211 | 2,000 | 262,144 | Let N be a positive integer. There is a numerical sequence of length 3N, a = (a_1, a_2, ..., a_{3N}). Snuke is constructing a new sequence of length 2N, a', by removing exactly N elements from a without changing the order of the remaining elements. Here, the score of a' is defined as follows: (the sum of the elements ... | ['import heapq\nN = int(input())\na = list(map(int, input().split()))\n\nmax_result = -1000000\n\nfor k in range(N, 2*N+1):\n print("----------------")\n big_a = a[:k]\n heapq.heapify(big_a)\n print(big_a)\n small_a =[(-x, x) for x in a[k:]]\n heapq.heapify(small_a)\n print(small_a)\n\n for i in range(len(big_a... | ['Wrong Answer', 'Accepted'] | ['s506980286', 's728501985'] | [121884.0, 38420.0] | [2107.0, 459.0] | [613, 616] |
p03716 | u163703551 | 2,000 | 262,144 | Let N be a positive integer. There is a numerical sequence of length 3N, a = (a_1, a_2, ..., a_{3N}). Snuke is constructing a new sequence of length 2N, a', by removing exactly N elements from a without changing the order of the remaining elements. Here, the score of a' is defined as follows: (the sum of the elements ... | ['import sys\nimport heapq\n\n\ndef solve(n, a):\n res = -10 ** 20\n for i in range(n, 2 * n + 1):\n l = a[0:i]\n r = a[i:3 * n]\n l.sort(reverse=True)\n r.sort()\n res0 = sum(l[0:n]) - sum(r[0:n])\n if res0 > res:\n res = res0\n return res\n\n\ndef find_bes... | ['Wrong Answer', 'Accepted'] | ['s419310295', 's232415184'] | [37212.0, 37212.0] | [484.0, 481.0] | [1026, 1099] |
p03716 | u197457087 | 2,000 | 262,144 | Let N be a positive integer. There is a numerical sequence of length 3N, a = (a_1, a_2, ..., a_{3N}). Snuke is constructing a new sequence of length 2N, a', by removing exactly N elements from a without changing the order of the remaining elements. Here, the score of a' is defined as follows: (the sum of the elements ... | ['import heapq\n\nN = int(input())\nA = list(map(int,input().split()))\nC = A[N:(2*N)]\n\nL = []\nR = []\nfor i in range(N):\n heapq.heappush(L,A[i]) \n heapq.heappush(R,-A[-1-i]) \n \n#print(L,R,C)\n\nlp = 0 \nrp = 0\nfor i in range(N):\n #print(i,lp,rp)\n if C[lp] - L[0] >= -C[-1-rp] - R[0]: \n heapq.heappush... | ['Wrong Answer', 'Accepted'] | ['s522750953', 's443714117'] | [38420.0, 37212.0] | [336.0, 527.0] | [760, 907] |
p03716 | u207097826 | 2,000 | 262,144 | Let N be a positive integer. There is a numerical sequence of length 3N, a = (a_1, a_2, ..., a_{3N}). Snuke is constructing a new sequence of length 2N, a', by removing exactly N elements from a without changing the order of the remaining elements. Here, the score of a' is defined as follows: (the sum of the elements ... | ['# -*- coding: utf-8 -*-\n"""\nCreated on Sun May 3 18:58:46 2020\n\n@author: naoki\n"""\nfrom heapq import heappush, heappop\nimport sys\n\nN = int(input())\na = list(map(int,input().split()))\n\nhq = []\nhq_r = []\nfor i in range(N):\n heappush(hq,a[i])\n heappush(hq_r,-1*a[-1-i])\n\n\nmax_A = [0 for _ in ran... | ['Wrong Answer', 'Runtime Error', 'Accepted'] | ['s096813467', 's362292592', 's469812461'] | [37212.0, 37084.0, 37212.0] | [516.0, 93.0, 539.0] | [762, 549, 747] |
p03716 | u310678820 | 2,000 | 262,144 | Let N be a positive integer. There is a numerical sequence of length 3N, a = (a_1, a_2, ..., a_{3N}). Snuke is constructing a new sequence of length 2N, a', by removing exactly N elements from a without changing the order of the remaining elements. Here, the score of a' is defined as follows: (the sum of the elements ... | ['from heapq import heappush, heappop\nn=int(input())\na=list(map(int, input().split()))\nq1=[]\nq2=[]\ns1=[]\ns2=[]\nfor i in range(n):\n heappush(q1, a[i])\ns1.append(sum(a[0:n]))\nfor ai in a[n:2*n]:\n heappush(q1, ai)\n m=heappop(q1)\n s1.append(s1[-1]+ai-m)\na=a[::-1]\nfor i in range(n):\n heappush(... | ['Wrong Answer', 'Accepted'] | ['s315703699', 's269665319'] | [39460.0, 37212.0] | [453.0, 434.0] | [523, 522] |
p03716 | u367130284 | 2,000 | 262,144 | Let N be a positive integer. There is a numerical sequence of length 3N, a = (a_1, a_2, ..., a_{3N}). Snuke is constructing a new sequence of length 2N, a', by removing exactly N elements from a without changing the order of the remaining elements. Here, the score of a' is defined as follows: (the sum of the elements ... | ['def f(a):q=a[:n];heapify(q);return sum(q)+cumsum([e-heappushpop(q,e)for e in a[n:n-~n]]);from heapq import*;from numpy import*;n,*a=map(int,open(0).read().split());print(max(map(sum,zip(f(a),f([-e for e in a[::-1]])[::-1]))))', 'def f(a):\n\tq=a[:n];s=sum(q);heapify(q)\n\tfor e in a[n:2*n]:yield s;s+=e-heappushpop(q,... | ['Runtime Error', 'Wrong Answer', 'Wrong Answer', 'Accepted'] | ['s254703592', 's386946796', 's918639303', 's765321529'] | [3064.0, 36308.0, 45252.0, 36308.0] | [17.0, 279.0, 1631.0, 268.0] | [225, 211, 225, 219] |
p03716 | u450956662 | 2,000 | 262,144 | Let N be a positive integer. There is a numerical sequence of length 3N, a = (a_1, a_2, ..., a_{3N}). Snuke is constructing a new sequence of length 2N, a', by removing exactly N elements from a without changing the order of the remaining elements. Here, the score of a' is defined as follows: (the sum of the elements ... | ['import heapq\nN = int(input())\nA = list(map(int, input().split()))\nR = [a for a in A[:N]]\nM = [a for a in A[N:2*N]]\nB = [-a for a in A[2*N:3*N]]\nres_R = [0] * (N + 1)\nres_B = [0] * (N + 1)\nres_R[0] = sum(R)\nres_B[N] = -sum(B)\nheapq.heapify(R)\nheapq.heapify(B)\nfor i in range(N):\n heapq.heappush(R, M[i])... | ['Wrong Answer', 'Accepted'] | ['s335183011', 's433950988'] | [37644.0, 37212.0] | [480.0, 458.0] | [544, 518] |
p03716 | u536113865 | 2,000 | 262,144 | Let N be a positive integer. There is a numerical sequence of length 3N, a = (a_1, a_2, ..., a_{3N}). Snuke is constructing a new sequence of length 2N, a', by removing exactly N elements from a without changing the order of the remaining elements. Here, the score of a' is defined as follows: (the sum of the elements ... | ['ai = lambda: list(map(int,input().split()))\n\nn = int(input())\na = ai()\n\nans = 0\nfor k in range(n):\n af = a[:n+k]\n ar = a[n+k:]\n aa = sum(sorted(af)[:n]) + sum(sorted(af, reverse=True)[:n])\n ans = max(ans, aa)\n\nprint(ans)', 'ai = lambda: list(map(int,input().split()))\n\nn = int(input())\na = a... | ['Wrong Answer', 'Accepted'] | ['s441601434', 's474993453'] | [39012.0, 38468.0] | [2109.0, 439.0] | [232, 582] |
p03716 | u557494880 | 2,000 | 262,144 | Let N be a positive integer. There is a numerical sequence of length 3N, a = (a_1, a_2, ..., a_{3N}). Snuke is constructing a new sequence of length 2N, a', by removing exactly N elements from a without changing the order of the remaining elements. Here, the score of a' is defined as follows: (the sum of the elements ... | ['N = int(input())\nA = list(map(int,input().split()))\nS = []\nP = A[:N]\nQ = A[2*N:]\nfor i in range(N):\n Q[i] *= -1\nR = A[N:2*N]\np = [0]*(N+1)\nq = [0]*(N+1)\nimport heapq\nheapq.heapify(P)\nheapq.heapify(Q)\nsp = sum(P)\nsq = sum(Q)\np[0] = sp\nq[0] = sq\n\nfor i in range(1,N+1):\n heapq.heappush(P,R[i-1])... | ['Wrong Answer', 'Runtime Error', 'Wrong Answer', 'Accepted'] | ['s775514001', 's776774021', 's999105011', 's439911358'] | [39124.0, 41172.0, 39124.0, 40724.0] | [2109.0, 124.0, 2105.0, 466.0] | [546, 374, 417, 543] |
p03716 | u704284486 | 2,000 | 262,144 | Let N be a positive integer. There is a numerical sequence of length 3N, a = (a_1, a_2, ..., a_{3N}). Snuke is constructing a new sequence of length 2N, a', by removing exactly N elements from a without changing the order of the remaining elements. Here, the score of a' is defined as follows: (the sum of the elements ... | ['import heapq\nimport sys\ndef main():\n N = int(sys.stdin.readline())\n A = list(map(int,sys.stdin.readline().split()))\n front = []\n back = []\n heapq.heapify(front)\n heapq.heapify(back)\n ans = 0\n L = 3*N\n f_end = 0\n b_start = L-1\n for i in range(L):\n a = A[i]\n ... | ['Wrong Answer', 'Accepted'] | ['s750876682', 's946867719'] | [39516.0, 39084.0] | [436.0, 369.0] | [1382, 750] |
p03716 | u765237551 | 2,000 | 262,144 | Let N be a positive integer. There is a numerical sequence of length 3N, a = (a_1, a_2, ..., a_{3N}). Snuke is constructing a new sequence of length 2N, a', by removing exactly N elements from a without changing the order of the remaining elements. Here, the score of a' is defined as follows: (the sum of the elements ... | ['import heapq\nn = int(input())\nxs = list(map(int, input().split()))\nhead = heapq.heapify(xs[:n])\nbody = xs[n:2*n]\nbody_and_tail = sorted(xs[n:])\nsum_tail = sum(body_and_tail_list[:n])\nunused_tail = heapq.heapify(body_and_tail[-n:])\nans = -1000000000000000000000\ntemp = sum(head) - sum_tail\nfor b in body:\n ... | ['Runtime Error', 'Accepted'] | ['s221073679', 's589196679'] | [38148.0, 45584.0] | [177.0, 647.0] | [428, 552] |
p03716 | u777923818 | 2,000 | 262,144 | Let N be a positive integer. There is a numerical sequence of length 3N, a = (a_1, a_2, ..., a_{3N}). Snuke is constructing a new sequence of length 2N, a', by removing exactly N elements from a without changing the order of the remaining elements. Here, the score of a' is defined as follows: (the sum of the elements ... | ['# -*- coding: utf-8 -*-\ndef inpl(): return tuple(map(int, input().split()))\nfrom bisect import bisect_left, insort\nN = int(input())\nA = inpl()\n\nbefore = sorted(A[:N])\nmiddle = sorted(A[N:-N])\nafter = sorted(A[-N:])\n\nS_before = [sum(before)]\nS_after = [sum(after)]\n\nfor m in middle:\n if before[0] < m:\... | ['Wrong Answer', 'Accepted'] | ['s435237666', 's735291469'] | [39508.0, 37212.0] | [2105.0, 319.0] | [721, 505] |
p03716 | u784022244 | 2,000 | 262,144 | Let N be a positive integer. There is a numerical sequence of length 3N, a = (a_1, a_2, ..., a_{3N}). Snuke is constructing a new sequence of length 2N, a', by removing exactly N elements from a without changing the order of the remaining elements. Here, the score of a' is defined as follows: (the sum of the elements ... | ['import heapq\nN=int(input())\nA=list(map(int, input().split()))\n\nclass MaxHeap:\n def __init__(self, li):\n self.hp = []\n for e in li:\n heappush(self.hp, -e)\n\n def push(self, x):\n heappush(self.hp, -x)\n\n def pop(self):\n ret = heappop(self.hp)\n ret *= -... | ['Runtime Error', 'Runtime Error', 'Runtime Error', 'Wrong Answer', 'Runtime Error', 'Runtime Error', 'Wrong Answer', 'Accepted'] | ['s104531825', 's490809408', 's498627219', 's656642416', 's661389503', 's679904458', 's913212012', 's754759547'] | [37212.0, 37212.0, 37212.0, 38288.0, 37212.0, 37212.0, 40196.0, 37212.0] | [197.0, 238.0, 236.0, 311.0, 247.0, 99.0, 325.0, 438.0] | [857, 889, 897, 496, 889, 889, 476, 890] |
p03716 | u858136677 | 2,000 | 262,144 | Let N be a positive integer. There is a numerical sequence of length 3N, a = (a_1, a_2, ..., a_{3N}). Snuke is constructing a new sequence of length 2N, a', by removing exactly N elements from a without changing the order of the remaining elements. Here, the score of a' is defined as follows: (the sum of the elements ... | ['import heapq\nimport bisect\n\nn = int(input())\nn = n*3\na = list(map(int,input().split()))\n\nbig = a[0:n//3]\ntempmin = a[n//3::]\ntempmin.sort()\nsmall = tempmin[0:n//3]\nspare = tempmin[n//3::]\n\nans = sum(big)-sum(small)\nmxm = ans\n\nheapq.heapify(small)\nheapq.heapify(spare)\n\nfor i in range(n//3,2*n//3):\n... | ['Runtime Error', 'Accepted'] | ['s443979243', 's872017013'] | [37212.0, 37212.0] | [2104.0, 478.0] | [810, 734] |
p03716 | u875291233 | 2,000 | 262,144 | Let N be a positive integer. There is a numerical sequence of length 3N, a = (a_1, a_2, ..., a_{3N}). Snuke is constructing a new sequence of length 2N, a', by removing exactly N elements from a without changing the order of the remaining elements. Here, the score of a' is defined as follows: (the sum of the elements ... | ['# coding: utf-8\n# Your code here!\nn = int(input())\na = [int(i) for i in input().split()]\n\nfrom heapq import *\n\npq1 = a[:n]\nheapify(pq1)\ns = sum(pq1)\nscore1 = [s]\nfor i in range(n):\n c=heappushpop(pq1, a[n+i])\n s += a[n+i] - c\n score1.append(s)\n\npq2 = [-i for i in a[2*n:]]\nheapify(pq2)\ns = s... | ['Wrong Answer', 'Accepted'] | ['s034415946', 's535044248'] | [38780.0, 42152.0] | [436.0, 233.0] | [547, 485] |
p03717 | u226155577 | 2,000 | 262,144 | There are N squares arranged in a row. The squares are numbered 1, 2, ..., N, from left to right. Snuke is painting each square in red, green or blue. According to his aesthetic sense, the following M conditions must all be satisfied. The i-th condition is: * There are exactly x_i different colors among squares l_i... | ['\nN, M = map(int, input().split())\nr_min = [0]*(N+1); r_max = [N+1]*(N+1)\ng_min = [0]*(N+1); g_max = [N+1]*(N+1)\nfor i in range(M):\n l, r, x = map(int, input().split())\n\n \n if x == 1:\n \n \n g_max[r] = min(g_max[r], l-1)\n elif x == 2:\n \n \n g_min[r] = m... | ['Runtime Error', 'Accepted'] | ['s714208834', 's469337312'] | [122348.0, 6772.0] | [2111.0, 1258.0] | [1948, 1490] |
p03717 | u327466606 | 2,000 | 262,144 | There are N squares arranged in a row. The squares are numbered 1, 2, ..., N, from left to right. Snuke is painting each square in red, green or blue. According to his aesthetic sense, the following M conditions must all be satisfied. The i-th condition is: * There are exactly x_i different colors among squares l_i... | ['from collections import defaultdict\n\nMOD = 1000000007\niist = lambda: map(int,input().split())\n\nN,M = iist()\nQ = defaultdict(list)\nfor i in range(M):\n l,r,x = iist()\n Q[r].append((l,x))\n\nif any(x != 1 for l,x in Q[1]):\n print(0)\n exit(0)\n\ndp = defaultdict(int)\ndp[0,0] = 3\n\nx_sum = [3]\ny_sum = [3... | ['Runtime Error', 'Runtime Error', 'Accepted'] | ['s673699357', 's936462260', 's697682291'] | [3436.0, 3064.0, 12524.0] | [22.0, 17.0, 1487.0] | [806, 516, 672] |
p03723 | u020390084 | 2,000 | 262,144 | Takahashi, Aoki and Snuke love cookies. They have A, B and C cookies, respectively. Now, they will exchange those cookies by repeating the action below: * Each person simultaneously divides his cookies in half and gives one half to each of the other two persons. This action will be repeated until there is a person ... | ["#!/usr/bin/env python3\nimport sys\n# input = sys.stdin.r/eadline\ndef INT(): return int(input())\ndef MAP(): return map(int,input().split())\ndef LI(): return list(map(int,input().split()))\n\ndef main():\n A,B,C = MAP()\n if not(A%2==0 and B%2==0 and C%2==0):\n print(0)\n return\n \n i... | ['Time Limit Exceeded', 'Time Limit Exceeded', 'Wrong Answer', 'Accepted'] | ['s038013138', 's156826558', 's214277455', 's054932331'] | [3064.0, 3064.0, 3064.0, 3064.0] | [2104.0, 2104.0, 2104.0, 20.0] | [585, 578, 584, 580] |
p03723 | u022979415 | 2,000 | 262,144 | Takahashi, Aoki and Snuke love cookies. They have A, B and C cookies, respectively. Now, they will exchange those cookies by repeating the action below: * Each person simultaneously divides his cookies in half and gives one half to each of the other two persons. This action will be repeated until there is a person ... | ["from functools import reduce\nfrom fractions import gcd\n\n\ndef main():\n cookies = list(map(int, input().split()))\n answer = -1\n if cookies[0] % 2 or cookies[1] % 2 or cookies[2] % 2:\n answer = 0\n elif len(set(cookies)) > 1:\n answer = reduce(gcd, cookies) - 1\n print(answer)\n\n\ni... | ['Wrong Answer', 'Accepted'] | ['s008013996', 's504584048'] | [5128.0, 3064.0] | [37.0, 18.0] | [342, 636] |
p03723 | u029929095 | 2,000 | 262,144 | Takahashi, Aoki and Snuke love cookies. They have A, B and C cookies, respectively. Now, they will exchange those cookies by repeating the action below: * Each person simultaneously divides his cookies in half and gives one half to each of the other two persons. This action will be repeated until there is a person ... | ['A,B,C=map(int,input().split())\ncount=0\n#if A==B and A==C:\nprint("-1")\nexit()\nwhile True:\n a,b,c=A/2,B/2,C/2\n A,B,C=b+c,a+c,a+b\n count+=1\n if A%2==1 or B%2==1 or C%2==1:\n break\nprint(count)', 'A,B,C=map(int,input().split())\ncount=0\nif A%2==0 and A==B and A==C:\n print("-1")\n exit()\nwhile True:\... | ['Wrong Answer', 'Accepted'] | ['s059097375', 's616980721'] | [3060.0, 3060.0] | [20.0, 17.0] | [195, 209] |
p03723 | u035907840 | 2,000 | 262,144 | Takahashi, Aoki and Snuke love cookies. They have A, B and C cookies, respectively. Now, they will exchange those cookies by repeating the action below: * Each person simultaneously divides his cookies in half and gives one half to each of the other two persons. This action will be repeated until there is a person ... | ['A, B, C = map(int, input().split())\nS = A+B+C\n\nk = 0\nwhile True:\n if A==B==C:\n k = -1\n break\n k += 1\n An = (B + C)//2\n Bn = (A + C)//2\n Cn = (B + A)//2\n A = An \n B = Bn \n C = Cn \n print(A,B,C)\n if A%2==1 or B%2==1 or C%2==1 or min([A,B,C])<1:\n br... | ['Wrong Answer', 'Accepted'] | ['s191484795', 's625091782'] | [9124.0, 9132.0] | [29.0, 26.0] | [314, 308] |
p03723 | u038408819 | 2,000 | 262,144 | Takahashi, Aoki and Snuke love cookies. They have A, B and C cookies, respectively. Now, they will exchange those cookies by repeating the action below: * Each person simultaneously divides his cookies in half and gives one half to each of the other two persons. This action will be repeated until there is a person ... | ['abc = list(map(int, input().split()))\nans = 0\nfor i in range(10 ** 6): \n if abc[0] % 2 != 0:\n print(ans)\n break\n else:\n tmp1 = abc[1] // 2 + abc[2] // 2\n\n if abc[1] % 2 != 0:\n print(ans)\n break\n else:\n tmp2 = abc[0] // 2 + abc[2] // 2\n \n ... | ['Wrong Answer', 'Accepted'] | ['s935838649', 's250480255'] | [3188.0, 3064.0] | [1202.0, 1200.0] | [494, 539] |
p03723 | u039860745 | 2,000 | 262,144 | Takahashi, Aoki and Snuke love cookies. They have A, B and C cookies, respectively. Now, they will exchange those cookies by repeating the action below: * Each person simultaneously divides his cookies in half and gives one half to each of the other two persons. This action will be repeated until there is a person ... | ['A,B,C = map(int, input().split())\na = [A]\nb = [B]\nc = [C]\ncount = 0\nfor i in range(10 ** 9):\n \n if a[i] == b[i] == c[i]:\n count = -1\n break\n elif a[i] % 2 == 1 or b[i] % 2 == 0 or c[i] % 2 == 1:\n break\n else:\n a.append(b[i] / 2 + c[i] / 2)\n b.append(a[i] / 2 +... | ['Wrong Answer', 'Wrong Answer', 'Accepted'] | ['s404788100', 's862618214', 's869912750'] | [9176.0, 9168.0, 9144.0] | [27.0, 26.0, 28.0] | [385, 385, 528] |
p03723 | u057415180 | 2,000 | 262,144 | Takahashi, Aoki and Snuke love cookies. They have A, B and C cookies, respectively. Now, they will exchange those cookies by repeating the action below: * Each person simultaneously divides his cookies in half and gives one half to each of the other two persons. This action will be repeated until there is a person ... | ['cookie = list(map(int, input().split()))\nsc = sum(cookie)\ncnt = -1\nif cookie[0] == cookie[1] and cookie[1] == cookie[2] and cookie[0]%2 == 0:\n print(-1)\n exit()\nmemo = [0]*3\nwhile cookie[0]%2 == 0 and cookie[1]%2 == 0 and cookie[2]%2 == 0:\n memo[0] = (cookie[1] + cookie[2]) // 2\n memo[1] = (cooki... | ['Wrong Answer', 'Accepted'] | ['s609209218', 's991348370'] | [3064.0, 3064.0] | [17.0, 17.0] | [450, 449] |
p03723 | u094999522 | 2,000 | 262,144 | Takahashi, Aoki and Snuke love cookies. They have A, B and C cookies, respectively. Now, they will exchange those cookies by repeating the action below: * Each person simultaneously divides his cookies in half and gives one half to each of the other two persons. This action will be repeated until there is a person ... | ["*a, = map(int, input().split())\na = [bin(abs(a[i+1]-a[i]))[::-1].find('1') for i in range(2)].sort()\nprint(a[1] if a[0]*a[1]<0 else a[0])", "*a,=map(int,input().split())\nb=[bin(a[i+1]-a[i])[::-1].find('1')for i in (0,1)]\nprint((max(b)*(b[0]*b[1]<0) or min(b))*(1-sum(a)%2))"] | ['Runtime Error', 'Accepted'] | ['s424739905', 's769243217'] | [3060.0, 3060.0] | [18.0, 18.0] | [137, 132] |
p03723 | u098982053 | 2,000 | 262,144 | Takahashi, Aoki and Snuke love cookies. They have A, B and C cookies, respectively. Now, they will exchange those cookies by repeating the action below: * Each person simultaneously divides his cookies in half and gives one half to each of the other two persons. This action will be repeated until there is a person ... | ['A,B,C = map(int,input().split())\nif A == B and B == C and C == A:\n print(-1)\nelse:\n count = 0\n while(A%2==0 and B%2 == 0 and C%2==0):\n A_ = A\n B_ = B\n A = (B+C)/2\n B = (A_+C)/2\n C = (A_+B_)/2\n print(A,B,C)\n count+=1\n print(count)', 'A,B,C = map(int,input().split())\nif A == B an... | ['Wrong Answer', 'Accepted'] | ['s057143460', 's506005028'] | [9092.0, 9176.0] | [32.0, 24.0] | [255, 257] |
p03723 | u102960641 | 2,000 | 262,144 | Takahashi, Aoki and Snuke love cookies. They have A, B and C cookies, respectively. Now, they will exchange those cookies by repeating the action below: * Each person simultaneously divides his cookies in half and gives one half to each of the other two persons. This action will be repeated until there is a person ... | ['a,b,c = map(int, input().split())\nd,e,f = abs(b-a),abs(c-b),abs(a-c)\nif d == e and e == f:\n print(-1)\nans = 0\nelse:\n while d % 2 == 0 and e % 2 == 0 f % 2 == 0:\n ans += 1\n d //= 2\n e //= 2\n f //= 2\n else:\n print(ans)', 'a,b,c = map(int, input().split())\nd,e,f = abs(b-a),abs(c-b),abs(a-c... | ['Runtime Error', 'Runtime Error', 'Accepted'] | ['s329582828', 's707626020', 's599202651'] | [2940.0, 2940.0, 3064.0] | [18.0, 18.0, 18.0] | [234, 224, 307] |
p03723 | u103902792 | 2,000 | 262,144 | Takahashi, Aoki and Snuke love cookies. They have A, B and C cookies, respectively. Now, they will exchange those cookies by repeating the action below: * Each person simultaneously divides his cookies in half and gives one half to each of the other two persons. This action will be repeated until there is a person ... | ['a,b,c = map(int,input().split())\n\nif a%2 or b%2 or c%2:\n print(0)\n exit()\nelif a==b==c:\n print(-1)\n exit()\n \nans =0\nwhile 1:\n if all(a%2==0, b%2==0, c%2==0):\n ans += 1\n else:\n print(ans)\n exit()\n a, b, c = (b+c)//2, (a+c)//2, (b+a)//2', 'a,b,c = map(int,input().split())\n\nif a%2 or b... | ['Runtime Error', 'Accepted'] | ['s579662809', 's748789177'] | [3064.0, 3064.0] | [17.0, 18.0] | [251, 255] |
p03723 | u106181248 | 2,000 | 262,144 | Takahashi, Aoki and Snuke love cookies. They have A, B and C cookies, respectively. Now, they will exchange those cookies by repeating the action below: * Each person simultaneously divides his cookies in half and gives one half to each of the other two persons. This action will be repeated until there is a person ... | ['a, b, c = map(int,input().split())\nans = 0\n\nif a == b == c and a%2 == 0:\n print(-1) \n exit()\n\nwhile x%2 == 0 and y%2 == 0 and z%2 == 0:\n ans += 1\n\n x = b//2 + c//2\n y = a//2 + c//2\n z = a//2 + b//2\n \n a = x\n b = y\n c = z\n\nprint(ans)\n', 'a, b, c = map(int,input().split(... | ['Runtime Error', 'Runtime Error', 'Wrong Answer', 'Accepted'] | ['s067337224', 's115925710', 's587676960', 's296961549'] | [3060.0, 3060.0, 2940.0, 3060.0] | [17.0, 18.0, 2104.0, 17.0] | [270, 274, 305, 270] |
p03723 | u106342872 | 2,000 | 262,144 | Takahashi, Aoki and Snuke love cookies. They have A, B and C cookies, respectively. Now, they will exchange those cookies by repeating the action below: * Each person simultaneously divides his cookies in half and gives one half to each of the other two persons. This action will be repeated until there is a person ... | ['#! -*- coding:utf-8 -*-\na,b,c = map(int,input().split())\nprint(a,b,c)\n\ncount = 0\nflag = 0\nwhile True:\n at = (b+c)/2\n bt = (a+c)/2\n ct = (b+c)/2\n\n if flag == 1 and at == a and bt == b and ct == c:\n flag = 0\n break\n \n a = at\n b = bt\n c = ct\n \n count += 1\n ... | ['Wrong Answer', 'Accepted'] | ['s439293640', 's446903621'] | [3064.0, 3064.0] | [17.0, 18.0] | [423, 516] |
p03723 | u113107956 | 2,000 | 262,144 | Takahashi, Aoki and Snuke love cookies. They have A, B and C cookies, respectively. Now, they will exchange those cookies by repeating the action below: * Each person simultaneously divides his cookies in half and gives one half to each of the other two persons. This action will be repeated until there is a person ... | ['a,b,c=map(int,input().split())\nif a==b==c:\n if a%2===b%2==c%2==0:\n print(-1)\n else:\n print(0)\n exit()\ncnt=0\nwhile a%2==b%2==c%2:\n A=a//2\n B=b//2\n C=c//2\n a,b,c=B+C,A+C,A+B\n cnt+=1\nprint(cnt)', 'a,b,c=map(int,input().split())\nif a==b==c:\n if a%2==b%2==c%2==0:\n ... | ['Runtime Error', 'Accepted'] | ['s468472502', 's080399505'] | [8852.0, 9100.0] | [24.0, 27.0] | [228, 227] |
p03723 | u118642796 | 2,000 | 262,144 | Takahashi, Aoki and Snuke love cookies. They have A, B and C cookies, respectively. Now, they will exchange those cookies by repeating the action below: * Each person simultaneously divides his cookies in half and gives one half to each of the other two persons. This action will be repeated until there is a person ... | ['A,B,C = map(int,input().split())\nif A==B==C:\n print(-1)\nelse:\n ans = 0\n while True:\n if A%2 or B%2 or C%2:\n break\n else:\n A //=2\n B //=2\n C //=2\n print(ans)', 'A,B,C = map(int,input().split())\nif A==B==C:\n print(-1)\nelse:\n ans = 0\n while True:\n if A%2 or B%2 or C%... | ['Wrong Answer', 'Wrong Answer', 'Accepted'] | ['s269909298', 's764259198', 's835690370'] | [2940.0, 3060.0, 3064.0] | [17.0, 17.0, 17.0] | [186, 188, 236] |
p03723 | u126823513 | 2,000 | 262,144 | Takahashi, Aoki and Snuke love cookies. They have A, B and C cookies, respectively. Now, they will exchange those cookies by repeating the action below: * Each person simultaneously divides his cookies in half and gives one half to each of the other two persons. This action will be repeated until there is a person ... | ['a, b, c = map(int, input().split())\n\n\nif a % 2 == 0 or b % 2 == 0 or c % 2 == 0:\n print(0)\n exit(0)\nif a == b == c and a % 2 == 0:\n print(-1)\n exit(0)\n\ncounter = 0\nwhile True:\n counter += 1\n w_a = a / 2\n w_b = b / 2\n w_c = c / 2\n\n a = w_b + w_c\n b = w_a + w_c\n c = w... | ['Wrong Answer', 'Accepted'] | ['s211334028', 's167950020'] | [3064.0, 3064.0] | [19.0, 18.0] | [395, 395] |
p03723 | u136395536 | 2,000 | 262,144 | Takahashi, Aoki and Snuke love cookies. They have A, B and C cookies, respectively. Now, they will exchange those cookies by repeating the action below: * Each person simultaneously divides his cookies in half and gives one half to each of the other two persons. This action will be repeated until there is a person ... | ['A,B,C = (int(i) for i in input().split())\n\ntimes = 0\n\nif A%2==1 or B%2==1 or C%2==1:\n times = 0\nelse:\n while True:\n times += 1\n A = A / 2\n B = B / 2\n C = C / 2\n if A==B and C==A:\n times = -1\n break\n elif A<=1 or B<=1 or C<=1:\n ... | ['Wrong Answer', 'Accepted'] | ['s794641748', 's286664652'] | [3064.0, 3064.0] | [17.0, 17.0] | [469, 629] |
p03723 | u152614052 | 2,000 | 262,144 | Takahashi, Aoki and Snuke love cookies. They have A, B and C cookies, respectively. Now, they will exchange those cookies by repeating the action below: * Each person simultaneously divides his cookies in half and gives one half to each of the other two persons. This action will be repeated until there is a person ... | ['a,b,c = map(int,input().split())\ncnt=0\nfor i in range(100):\n if a==b==c and a%2==0:\n cnt = -1\n break\n elif a%2==0 and b%2==0 and c%2==10:\n t_a = b//2 + c//2\n t_b = a//2 + c//2\n t_c = a//2 + b//2\n a,b,c = t_a,t_b,t_c\n cnt+=1\n else:\n break\np... | ['Wrong Answer', 'Runtime Error', 'Accepted'] | ['s289324515', 's873495027', 's362718347'] | [3064.0, 2940.0, 3064.0] | [18.0, 18.0, 18.0] | [313, 341, 330] |
p03723 | u173025122 | 2,000 | 262,144 | Takahashi, Aoki and Snuke love cookies. They have A, B and C cookies, respectively. Now, they will exchange those cookies by repeating the action below: * Each person simultaneously divides his cookies in half and gives one half to each of the other two persons. This action will be repeated until there is a person ... | ['import random as rng\nimport itertools as it\nimport collections as col\nimport heapq as hq\nimport sys\nimport copy as cp\nsys.setrecursionlimit(10**9)\ninput = sys.stdin.readline\n\n\ndef dump_impl(*objects):\n print(*objects, file=sys.stderr)\n\n\ndef dump_dummy(*objects):\n pass\n\n\ndump = dump_impl if "DE... | ['Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Accepted'] | ['s258106348', 's503093847', 's723175044', 's264336268'] | [9816.0, 9948.0, 9840.0, 9740.0] | [34.0, 33.0, 36.0, 33.0] | [424, 424, 424, 694] |
p03723 | u178465329 | 2,000 | 262,144 | Takahashi, Aoki and Snuke love cookies. They have A, B and C cookies, respectively. Now, they will exchange those cookies by repeating the action below: * Each person simultaneously divides his cookies in half and gives one half to each of the other two persons. This action will be repeated until there is a person ... | ["\na, b, c = list(map(int, input().split(' ')))\ncnt = 0\nif a == b == c:\n cnt = -1 \nelse:\n while (a+1)%2 or (b+1)%2 or (c+1)%2:\n cnt += 1\n a,b,c=(b+c)/2,(a+c)/2,(a+b)/2\n\nprint(cnt)\n", "\na, b, c = list(map(int, input().split(' ')))\ncnt = 0\nif a == b == c:\n cnt = a%2-1\nelse:\n wh... | ['Wrong Answer', 'Accepted'] | ['s640773094', 's824150858'] | [2940.0, 2940.0] | [2103.0, 17.0] | [199, 194] |
p03723 | u188244611 | 2,000 | 262,144 | Takahashi, Aoki and Snuke love cookies. They have A, B and C cookies, respectively. Now, they will exchange those cookies by repeating the action below: * Each person simultaneously divides his cookies in half and gives one half to each of the other two persons. This action will be repeated until there is a person ... | ["def compute():\n a, b, c = [int(el) for el in input().split(' ')]\n record = set()\n record.add(frozenset([a,b,c]))\n count = 0\n while (b + c) % 2 == (a + c) % 2 == (a + b) % 2 == 0:\n a, b, c = (b+c)//2, (a+c)//2, (a+b)//2\n print(a, b, c)\n if {a, b, c} in record:\n p... | ['Wrong Answer', 'Accepted'] | ['s095205827', 's593415662'] | [3064.0, 3060.0] | [17.0, 17.0] | [460, 292] |
p03723 | u196697332 | 2,000 | 262,144 | Takahashi, Aoki and Snuke love cookies. They have A, B and C cookies, respectively. Now, they will exchange those cookies by repeating the action below: * Each person simultaneously divides his cookies in half and gives one half to each of the other two persons. This action will be repeated until there is a person ... | ['import numpy as np\nimport sys\n\nthree_cookies = list(map(int, input().split()))\n\nthree_div = [i % 2 for i in three_cookies]\nif all(three_div):\n print(0)\n sys.exit()\n\na_b_c = np.array(three_cookies)\nlis = np.array([[0, 0.5, 0.5], [0.5, 0, 0.5], [0.5, 0.5, 0]])\ni = 0\n\nwhile True:\n i += 1\n a_b... | ['Wrong Answer', 'Accepted'] | ['s446945708', 's865387525'] | [12796.0, 12424.0] | [159.0, 150.0] | [538, 557] |
p03723 | u201928947 | 2,000 | 262,144 | Takahashi, Aoki and Snuke love cookies. They have A, B and C cookies, respectively. Now, they will exchange those cookies by repeating the action below: * Each person simultaneously divides his cookies in half and gives one half to each of the other two persons. This action will be repeated until there is a person ... | ['from time import time\nt = time()\ncount = 0\na = int(input())\nb = int(input())\nc = int(input())\nwhile True:\n if a % 2 != 0 or b % 2 != 0 or c % 2 != 0:\n print(count)\n exit()\n count += 1\n a1 = b//2+c//2\n b1 = c//2+a//2\n c1 = a//2+b//2\n a = a1\n b = b1\n c = c1\n if ... | ['Runtime Error', 'Accepted'] | ['s879118307', 's560575433'] | [3064.0, 3064.0] | [17.0, 1818.0] | [350, 332] |
p03723 | u208120643 | 2,000 | 262,144 | Takahashi, Aoki and Snuke love cookies. They have A, B and C cookies, respectively. Now, they will exchange those cookies by repeating the action below: * Each person simultaneously divides his cookies in half and gives one half to each of the other two persons. This action will be repeated until there is a person ... | ['"""Boot-camp-for-Beginners_Easy013_A_Candy-Distribution-Again_30-August-2020.py"""\n\nA, B, C = map(int, input().split())\na, b, c = A, B, C\ni = 0\nwhile True:\n if (A % 2 == 0 and B % 2 == 0 and C % 2 == 0):\n if(A == a or B == b or C == c):\n print(-1)\n break\n i += 1\n ... | ['Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Accepted'] | ['s255516734', 's420219061', 's449077224', 's528216539', 's627167696'] | [9084.0, 9032.0, 9180.0, 9192.0, 9168.0] | [25.0, 25.0, 34.0, 27.0, 25.0] | [509, 530, 531, 534, 453] |
p03723 | u211236379 | 2,000 | 262,144 | Takahashi, Aoki and Snuke love cookies. They have A, B and C cookies, respectively. Now, they will exchange those cookies by repeating the action below: * Each person simultaneously divides his cookies in half and gives one half to each of the other two persons. This action will be repeated until there is a person ... | ['if A==B==C:\n print(-1)\nelse:\n for i in range(100000000):\n if A %2==0 and B%2==0 and C%2==0:\n a = A/2\n b = B/2\n c = C/2\n A = b+c\n B = a+c\n C = a+b\n else:\n print(i)\n exit()', 'A, B, C = map(int, inpu... | ['Runtime Error', 'Accepted'] | ['s923412157', 's473866878'] | [3060.0, 3060.0] | [18.0, 17.0] | [278, 365] |
p03723 | u211805975 | 2,000 | 262,144 | Takahashi, Aoki and Snuke love cookies. They have A, B and C cookies, respectively. Now, they will exchange those cookies by repeating the action below: * Each person simultaneously divides his cookies in half and gives one half to each of the other two persons. This action will be repeated until there is a person ... | ["#13\na,b,c = map(int,input().split())\ncnt = 0\nwhile a%2 == b%2 == c%2 == 0:\n if a==b==c:\n print('-1')\n break\n else:\n a,b,c = b//2+c//2,c//2+a//2,a//2+b//2\n cnt+=1\n print(a,b,c)\n\nprint(cnt)", "#13\na,b,c = map(int,input().split())\ncnt = 0\nif a%2 == 1 or b%2 == 1 or... | ['Wrong Answer', 'Accepted'] | ['s012893148', 's397187024'] | [3060.0, 3064.0] | [17.0, 18.0] | [228, 279] |
p03723 | u215341636 | 2,000 | 262,144 | Takahashi, Aoki and Snuke love cookies. They have A, B and C cookies, respectively. Now, they will exchange those cookies by repeating the action below: * Each person simultaneously divides his cookies in half and gives one half to each of the other two persons. This action will be repeated until there is a person ... | ['a , b , c = map(int, input().split())\ncount = 0\nif a == 1 and b == 1 and c == 1:\n break\nelif a == b and a == c:\n count = -1\nelse:\n while a % 2 == 0 and b % 2 == 0 and c % 2 == 0:\n a_copy = a\n b_copy = b\n c_copy = c\n a = int(b_copy / 2 + c_copy / 2)\n b = int(a_copy / 2 + c_copy / 2)\n ... | ['Runtime Error', 'Accepted'] | ['s112424583', 's327390480'] | [3064.0, 3064.0] | [17.0, 17.0] | [368, 367] |
p03723 | u223646582 | 2,000 | 262,144 | Takahashi, Aoki and Snuke love cookies. They have A, B and C cookies, respectively. Now, they will exchange those cookies by repeating the action below: * Each person simultaneously divides his cookies in half and gives one half to each of the other two persons. This action will be repeated until there is a person ... | ['A=sorted(list(map(int,input().split())))\n\nif A[2]==A[0]:\n print(-1)\nelse:\n c=A[2]-A[0]\n while c%2==1:\n c+=1\n c=c//2\n print(c)\n\n\n', 'A=sorted(list(map(int,input().split())))\n\nif A[2]==A[0]:\n print(-1)\nelse:\n c=A[2]-A[0]\n while c%2==0:\n c+=1\n c=c//2\n... | ['Wrong Answer', 'Wrong Answer', 'Accepted'] | ['s031449777', 's737406833', 's683239523'] | [2940.0, 2940.0, 3060.0] | [17.0, 17.0, 18.0] | [154, 156, 255] |
p03723 | u223904637 | 2,000 | 262,144 | Takahashi, Aoki and Snuke love cookies. They have A, B and C cookies, respectively. Now, they will exchange those cookies by repeating the action below: * Each person simultaneously divides his cookies in half and gives one half to each of the other two persons. This action will be repeated until there is a person ... | ['a,b,c=map(int,input().split())\nif a==b and b==c and a%2=0:\n print(-1)\nelse:\n ans=0\n while a%2==0 ans b%2==0 and c%2==0:\n tmp=a\n tmp2=b\n a=(b+c)//2\n b=(c+tmp)//2\n c=(tmp+tmp2)//2\n ans+=1\n print(ans)', 'a,b,c=map(int,input().split())\nif a==b and b==c an... | ['Runtime Error', 'Accepted'] | ['s833722238', 's704333740'] | [2940.0, 3064.0] | [17.0, 17.0] | [251, 252] |
p03723 | u227085629 | 2,000 | 262,144 | Takahashi, Aoki and Snuke love cookies. They have A, B and C cookies, respectively. Now, they will exchange those cookies by repeating the action below: * Each person simultaneously divides his cookies in half and gives one half to each of the other two persons. This action will be repeated until there is a person ... | ['a,b,c = map(int,input().split())\nif a == b == c:\n if a%2 == b%2 == c%2 == 0:\n print(-1)\n else:\n print(0)\nt = 0\nelse:\n while t > -1:\n if a%2 == 1 or b%2 == 1 or c%2 == 1:\n break\n (a,b,c) = ((b+c)//2,(a+c)//2,(a+b)//2)\n t += 1\n print(t)', 'a,b,c = map(int,input().split())\nif a == b... | ['Runtime Error', 'Accepted'] | ['s400956895', 's110029082'] | [2940.0, 3060.0] | [17.0, 17.0] | [258, 261] |
p03723 | u228232845 | 2,000 | 262,144 | Takahashi, Aoki and Snuke love cookies. They have A, B and C cookies, respectively. Now, they will exchange those cookies by repeating the action below: * Each person simultaneously divides his cookies in half and gives one half to each of the other two persons. This action will be repeated until there is a person ... | ["import sys\n\n\ndef LI(): return list(map(int, sys.stdin.buffer.readline().split()))\ndef I(): return int(sys.stdin.buffer.readline())\ndef LS(): return sys.stdin.buffer.readline().rstrip().decode('utf-8').split()\ndef S(): return sys.stdin.buffer.readline().rstrip().decode('utf-8')\ndef IR(n): return [I() for i in r... | ['Wrong Answer', 'Accepted'] | ['s046383664', 's617397510'] | [3064.0, 3064.0] | [17.0, 17.0] | [806, 847] |
p03723 | u234189749 | 2,000 | 262,144 | Takahashi, Aoki and Snuke love cookies. They have A, B and C cookies, respectively. Now, they will exchange those cookies by repeating the action below: * Each person simultaneously divides his cookies in half and gives one half to each of the other two persons. This action will be repeated until there is a person ... | ['A,B,C = map(int,input().split())\n\nans = 0\n\nwhile (A%2 == 0) & (B%2 == 0) & (C%2 == 0):\n if (A==B) & (B==C) :\n ans = -1\n break\n\n a = (B+C)/2\n b = (A+C)/2\n c = (A+B)/2\n A = a\n B = b\n C = c\n ans += 1\n\nprint(ans)', 'A,B,C = map(int,input().split())\n\nans = 0\n\n... | ['Runtime Error', 'Accepted'] | ['s384322936', 's767289035'] | [2940.0, 3064.0] | [18.0, 17.0] | [250, 246] |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.