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
p02729
u048166300
2,000
1,048,576
We have N+M balls, each of which has an integer written on it. It is known that: * The numbers written on N of the balls are even. * The numbers written on M of the balls are odd. Find the number of ways to choose two of the N+M balls (disregarding order) so that the sum of the numbers written on them is even. ...
['S=str(input())\nN=len(S)\np=0\na=0\nc=0\nfor i in range(int((N-1)/2)):\n if S[i]==S[-i-1]:\n p+=1\nif p==(N-1)/2:\n for i in range(int((N-1)/4)):\n T=S[:int((N-1)/2)]\n if T[i]==T[-i-1]:\n a+=1\n if a==int((N-1)/4):\n for y in range(int((N-(N+3)/2)/2)):\n ...
['Wrong Answer', 'Accepted']
['s899834151', 's459008855']
[3064.0, 2940.0]
[17.0, 17.0]
[534, 67]
p02729
u053035261
2,000
1,048,576
We have N+M balls, each of which has an integer written on it. It is known that: * The numbers written on N of the balls are even. * The numbers written on M of the balls are odd. Find the number of ways to choose two of the N+M balls (disregarding order) so that the sum of the numbers written on them is even. ...
['x,y = map(int,input().split())\t\n\n# even + even \nans = x*(x – 1) / 2\n\n\nans += y*(y-1) / 2\n\nprint(ans)\n', 'x,y = map(int,input().split())\n\n# even + even\nans = x*(x-1) / 2\n\n\nans += y*(y-1) / 2\n\nprint(int(ans))\n']
['Runtime Error', 'Accepted']
['s342583681', 's764017584']
[2940.0, 2940.0]
[17.0, 17.0]
[114, 113]
p02729
u054662964
2,000
1,048,576
We have N+M balls, each of which has an integer written on it. It is known that: * The numbers written on N of the balls are even. * The numbers written on M of the balls are odd. Find the number of ways to choose two of the N+M balls (disregarding order) so that the sum of the numbers written on them is even. ...
['a,b = input().split()\na = int(a)\nb = int(b)\nA = (a*a-1)/2\nB = (b*b-1)/2\nif a == 1 and b == 1:\n print(0)\nelif a ==1 and b >= 1:\n print(B)\nelif a >= 1 and b == 1:\n print(A)\nelif a>= 1 and b >=1:\n print(A+B)', 'a,b = input().split()\na = int(a)\nb = int(b)\n\n\nS = a*a-1/2\nF = b*b-1/2\nif a<1.9 and b<1....
['Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Accepted']
['s322872755', 's425503019', 's472481350', 's013384080']
[3060.0, 3060.0, 3060.0, 3064.0]
[18.0, 17.0, 17.0, 17.0]
[208, 226, 208, 302]
p02729
u055687574
2,000
1,048,576
We have N+M balls, each of which has an integer written on it. It is known that: * The numbers written on N of the balls are even. * The numbers written on M of the balls are odd. Find the number of ways to choose two of the N+M balls (disregarding order) so that the sum of the numbers written on them is even. ...
['import math\n\nN, M = map(int, input().split())\n\nn = math.factorial(N) / math.factorial(N-2) / 2\nm = math.factorial(M) / math.factorial(M-2) / 2\n\nprint(int(n + m))', 'import math\n\nN, M = map(int, input().split())\n\ndef f(a):\n if a > 1:\n return int(math.factorial(a) / math.factorial(a-2) / 2)\n ...
['Runtime Error', 'Accepted']
['s517160695', 's313930332']
[3060.0, 2940.0]
[17.0, 17.0]
[161, 181]
p02729
u058510797
2,000
1,048,576
We have N+M balls, each of which has an integer written on it. It is known that: * The numbers written on N of the balls are even. * The numbers written on M of the balls are odd. Find the number of ways to choose two of the N+M balls (disregarding order) so that the sum of the numbers written on them is even. ...
['from math import *\n\n\nN,M = list(map(int,input().split(" ")))\nA = (N*(N-1))/2+(M*(M-1))/2\nprint (A)', 'L= int(input())\nA = (L/3)*(L/3)*(L/3)\nprint (A)\n', 'N = input()\nM = input()\nA = (factorial(N)*factorial(N-1))+(factorial(M)*factorial(M-1))/2\nprint A', 'from math import *\n\n\nN,M = list(map(int,input().s...
['Wrong Answer', 'Runtime Error', 'Runtime Error', 'Accepted']
['s122100044', 's124031041', 's413770404', 's793846834']
[3060.0, 2940.0, 2940.0, 2940.0]
[17.0, 17.0, 17.0, 17.0]
[98, 48, 97, 105]
p02729
u060736237
2,000
1,048,576
We have N+M balls, each of which has an integer written on it. It is known that: * The numbers written on N of the balls are even. * The numbers written on M of the balls are odd. Find the number of ways to choose two of the N+M balls (disregarding order) so that the sum of the numbers written on them is even. ...
['n = int(input())\na = list(map(int, input().split()))\ncount = 0\nL = len(a)\nfor el in a:\n count += a.count(el)-1\ncount //= 2\nfor el in a:\n print(count - a.count(el)+1)', 'n = int(input())\na = list(map(int, input().split()))\nd = [0]*(n+1)\ncount = 0\nfor el in set(a):\n temp = d[el] = a.count(el)\n ...
['Runtime Error', 'Runtime Error', 'Runtime Error', 'Runtime Error', 'Runtime Error', 'Accepted']
['s004012443', 's149677125', 's388606978', 's441353551', 's799917610', 's203343816']
[3060.0, 3060.0, 2940.0, 3060.0, 3060.0, 2940.0]
[18.0, 18.0, 17.0, 17.0, 17.0, 17.0]
[171, 206, 160, 183, 183, 79]
p02729
u060896757
2,000
1,048,576
We have N+M balls, each of which has an integer written on it. It is known that: * The numbers written on N of the balls are even. * The numbers written on M of the balls are odd. Find the number of ways to choose two of the N+M balls (disregarding order) so that the sum of the numbers written on them is even. ...
['n, m = map(int, input().split())\nans = n * (n - 1) / 2 + m * (m - 1) / 2\nprint(ans)', 'n, m = map(int, input().split())\nans = n * (n - 1) / 2 + m * (m - 1) / 2\nprint(ans.__int__())']
['Wrong Answer', 'Accepted']
['s757750957', 's272841529']
[2940.0, 2940.0]
[17.0, 18.0]
[83, 93]
p02729
u062754605
2,000
1,048,576
We have N+M balls, each of which has an integer written on it. It is known that: * The numbers written on N of the balls are even. * The numbers written on M of the balls are odd. Find the number of ways to choose two of the N+M balls (disregarding order) so that the sum of the numbers written on them is even. ...
['N, M = map(int, input().split())\nprint(int(N * (N - 1) + M * (M-1)) / 2)\n', '# %%\nN = int(input())\nM = int(input())\nprint((N * (N - 1) + M * (M-1)) / 2)\n', 'print(int((input()))**3/27)\n', 'S = input()\na = (len(S) - 1) / 2\nb = (len(S) + 1) / 2\nif S[:a] == S[b:]:\n print("Yes")\nelse:\n print("No")\n', ...
['Wrong Answer', 'Runtime Error', 'Runtime Error', 'Runtime Error', 'Accepted']
['s008612372', 's062901936', 's070246510', 's110142306', 's140531487']
[2940.0, 2940.0, 2940.0, 2940.0, 2940.0]
[17.0, 18.0, 18.0, 17.0, 17.0]
[73, 76, 28, 112, 75]
p02729
u063346608
2,000
1,048,576
We have N+M balls, each of which has an integer written on it. It is known that: * The numbers written on N of the balls are even. * The numbers written on M of the balls are odd. Find the number of ways to choose two of the N+M balls (disregarding order) so that the sum of the numbers written on them is even. ...
['S = input()\n\nflag = 0\nfor i in range(0, len(S), 1):\n\tif S[i] != S[len(S)-1-i]:\n\t\tflag = 1\n\nfor i in range(0, (len(S) + 1) //2, 1):\n\tif S[i] != S[len(S)//2-1-i]:\n\t\tflag = 1\n\nif flag == 0:\n\tprint("Yes")\nelse:\n\tprint("No")', 'N,M = map(int,input().split())\n\nprint((N * (N - 1)) // 2 + (M * (M - 1...
['Wrong Answer', 'Accepted']
['s723727367', 's007056868']
[9060.0, 9144.0]
[27.0, 29.0]
[219, 79]
p02729
u065578867
2,000
1,048,576
We have N+M balls, each of which has an integer written on it. It is known that: * The numbers written on N of the balls are even. * The numbers written on M of the balls are odd. Find the number of ways to choose two of the N+M balls (disregarding order) so that the sum of the numbers written on them is even. ...
['n, m = map(int, input().split())\ndef col(x):\n if x == 0:\n return(0)\n else:\n return((x * (x - 1)) / 2)\nprint(col(n) + col(m))\n', 'n, m = map(int, input().split())\ndef col(x):\n if x == 0:\n return(0)\n else:\n return((x * (x - 1)) // 2)\nprint(col(n) + col(m))\n']
['Wrong Answer', 'Accepted']
['s089708972', 's994200239']
[2940.0, 2940.0]
[17.0, 17.0]
[145, 146]
p02729
u065870010
2,000
1,048,576
We have N+M balls, each of which has an integer written on it. It is known that: * The numbers written on N of the balls are even. * The numbers written on M of the balls are odd. Find the number of ways to choose two of the N+M balls (disregarding order) so that the sum of the numbers written on them is even. ...
['import math \n\nN2,M1 = map(int, input().split())\n\ndef combinations_count(n, r):\n return math.factorial(n) // (math.factorial(n - r) * math.factorial(r))\n\n\ncount = combinations_count(N2,2)\n\ncount += combinations_count(M1,2)\n\nprint(count)', 'import math \n\nN2,M1 = map(int, input().split())\n\ndef combina...
['Runtime Error', 'Runtime Error', 'Runtime Error', 'Accepted']
['s685321725', 's755306636', 's986186154', 's348113020']
[3060.0, 3060.0, 3060.0, 3060.0]
[17.0, 17.0, 17.0, 17.0]
[238, 270, 272, 292]
p02729
u066551652
2,000
1,048,576
We have N+M balls, each of which has an integer written on it. It is known that: * The numbers written on N of the balls are even. * The numbers written on M of the balls are odd. Find the number of ways to choose two of the N+M balls (disregarding order) so that the sum of the numbers written on them is even. ...
['S = str(input())\nN = len(S)\n\nS1 = S[0:N//2]\nS1_1=S1[0:len(S)//4]\nS1_2=S1[len(S)//4+1:]\n\nS2= S[N//2+1:]\nS2_1=S2[0:len(S)//4]\nS2_2=S2[len(S)//4+1:]\n\n\nif S1_1 == S1_2 and S2_1 == S2_2:\n print("Yes")\nelse:\n print("No")', '\nN, M = map(int,input().split())\n\nif N > 2:\n N_even = N*(N - 1)/2\nelse...
['Wrong Answer', 'Wrong Answer', 'Accepted']
['s029586450', 's438668346', 's987780342']
[3064.0, 2940.0, 2940.0]
[17.0, 19.0, 20.0]
[220, 211, 215]
p02729
u067986264
2,000
1,048,576
We have N+M balls, each of which has an integer written on it. It is known that: * The numbers written on N of the balls are even. * The numbers written on M of the balls are odd. Find the number of ways to choose two of the N+M balls (disregarding order) so that the sum of the numbers written on them is even. ...
['S = input()\nN = len(S)\nif S == S[::-1] and S[:(N - 1)//2][::-1] == S[:(N - 1)//2] and S[(N + 3)//2][::-1] == S[(N + 3)//2]:\n print("Yes")\nelse:\n print("No")', 'from itertools import combinations\nn, m = map(int, input().split())\nr = []\ni = 0\nj = -1\nc = 0\nfor _ in range(n):\n i += 2\n r.append(i)...
['Runtime Error', 'Accepted']
['s092902172', 's029214785']
[3060.0, 4468.0]
[17.0, 25.0]
[162, 278]
p02729
u068750695
2,000
1,048,576
We have N+M balls, each of which has an integer written on it. It is known that: * The numbers written on N of the balls are even. * The numbers written on M of the balls are odd. Find the number of ways to choose two of the N+M balls (disregarding order) so that the sum of the numbers written on them is even. ...
['a,b=map(int,input().split())\nif a<=1 and b<=1:\n print(0)\nif a<1 and 1<b:\n print((b*(b-1))//2)\nif 1<a and b<1:\n print((a*(a-1))//2)\nif 1<a and 1<b:\n print(((a*(a-1))//2)+((b*(b-1))//2))\n', 'a,b=map(int,input().split())\nif a<=1 and b<=1:\n print(0)\nif a<=1 and 1<b:\n print((b*(b-1))//2)\nif...
['Wrong Answer', 'Accepted']
['s108490342', 's864142331']
[2940.0, 3064.0]
[17.0, 18.0]
[197, 198]
p02729
u068862866
2,000
1,048,576
We have N+M balls, each of which has an integer written on it. It is known that: * The numbers written on N of the balls are even. * The numbers written on M of the balls are odd. Find the number of ways to choose two of the N+M balls (disregarding order) so that the sum of the numbers written on them is even. ...
['N,M = map(int,input())\n\nif N>=2:\n gyu = N*(N-1)//2\nelse:\n gyu = 0\n \nif M>=2:\n ki = M*(M-1)//2\nelse:\n ki = 0\n\nprint(gyu+ki)', 'N,M = map(int,input().split())\n \nif N>=2:\n gyu = N*(N-1)//2\nelse:\n gyu = 0\n \nif M>=2:\n ki = M*(M-1)//2\nelse:\n ki = 0\n \nprint(gyu+ki)']
['Runtime Error', 'Accepted']
['s967155107', 's142135689']
[9096.0, 9100.0]
[23.0, 29.0]
[127, 137]
p02729
u070201429
2,000
1,048,576
We have N+M balls, each of which has an integer written on it. It is known that: * The numbers written on N of the balls are even. * The numbers written on M of the balls are odd. Find the number of ways to choose two of the N+M balls (disregarding order) so that the sum of the numbers written on them is even. ...
['N = int(input())\n\ninput_1 = input()\ninput_2 = input_1.split()\n\nA = map(int, input_2)\n\ndef equal(num):\n return num\nA = [equal(x) for x in A]\n\nans = 0\n\nfor l in range(N):\n ans += A.count(A[l]) - 1\n\nans = ans / 2\nre = ans\n\nfor k in range(N):\n ans -= A.count(A[k]) - 1\n\n print(int(ans))\n...
['Runtime Error', 'Accepted']
['s434490776', 's718588266']
[3064.0, 2940.0]
[17.0, 17.0]
[308, 88]
p02729
u071916806
2,000
1,048,576
We have N+M balls, each of which has an integer written on it. It is known that: * The numbers written on N of the balls are even. * The numbers written on M of the balls are odd. Find the number of ways to choose two of the N+M balls (disregarding order) so that the sum of the numbers written on them is even. ...
['N,M=input().split()\nn=int(N)\nm=int(M)\na=n*(n-1)\nb=m*(m-1)\nprint(a+b)', 'n,m=input().split()\nn=int(n)\nm=int(m)\na=n*(n-1)+m*(m-1)\nprint(a)', 'N,M=input().split()\nn=int(N)\nm=int(M)\na=(n*(n-1))/2\nb=(m*(m-1))/2\nprint(a+b)', 'N,M=input().split()\nn=int(N)\nm=int(M)\na=int((n*(n-1))/2)\nb=int((m*(m-1))/2)\npri...
['Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Accepted']
['s061603079', 's800050622', 's840828997', 's358924798']
[2940.0, 2940.0, 2940.0, 2940.0]
[18.0, 17.0, 17.0, 17.0]
[68, 64, 76, 86]
p02729
u074687136
2,000
1,048,576
We have N+M balls, each of which has an integer written on it. It is known that: * The numbers written on N of the balls are even. * The numbers written on M of the balls are odd. Find the number of ways to choose two of the N+M balls (disregarding order) so that the sum of the numbers written on them is even. ...
['N, M = map(int, input().split())\n\ne_e = N * (N - 1) / 2\no_o = M * (M - 1) / 2\n\nprint(e_e + o_o)', 'N, M = map(int, input().split())\n\ne_e = N * (N - 1) / 2\no_o = M * (M - 1) / 2\n\nprint(int(e_e + o_o))']
['Wrong Answer', 'Accepted']
['s500338777', 's782698156']
[2940.0, 2940.0]
[17.0, 17.0]
[95, 100]
p02729
u075109824
2,000
1,048,576
We have N+M balls, each of which has an integer written on it. It is known that: * The numbers written on N of the balls are even. * The numbers written on M of the balls are odd. Find the number of ways to choose two of the N+M balls (disregarding order) so that the sum of the numbers written on them is even. ...
['#include<stdio.h>\n\nlong int multiplyNumbers(int n) {\n if (n>=1)\n return n*multiplyNumbers(n-1);\n else\n return 1;\n}\n\nint main(){\n\tlong int N, M;\n\tscanf("%ld %ld", &N, &M);\n\tlong int c1 = multiplyNumbers(N)/((multiplyNumbers(N-2))*multiplyNumbers(2));\n\tlong int c2 = multiplyNumbers(...
['Runtime Error', 'Accepted']
['s458234952', 's070109905']
[2940.0, 3700.0]
[17.0, 20.0]
[383, 162]
p02729
u075304271
2,000
1,048,576
We have N+M balls, each of which has an integer written on it. It is known that: * The numbers written on N of the balls are even. * The numbers written on M of the balls are odd. Find the number of ways to choose two of the N+M balls (disregarding order) so that the sum of the numbers written on them is even. ...
['import functools\nimport math\nimport collections\nimport scipy\nimport fractions\nimport itertools\n\ndef solve():\n n = int(input())\n a = list(map(int, input().split()))\n c = collections.Counter(a)\n s = 0\n for i in list(c.values()):\n s += i*(i-1)//2\n print(c)\n for i in a:\n print(c[i])\n prin...
['Runtime Error', 'Accepted']
['s335643789', 's297472336']
[13328.0, 3444.0]
[166.0, 19.0]
[365, 236]
p02729
u075595666
2,000
1,048,576
We have N+M balls, each of which has an integer written on it. It is known that: * The numbers written on N of the balls are even. * The numbers written on M of the balls are odd. Find the number of ways to choose two of the N+M balls (disregarding order) so that the sum of the numbers written on them is even. ...
['n,m = [int(i) for i in input().split()]\nif n <= 1:\n a = 0\nelse:\n a = n*(n-1)/2\nif m <= 1:\n b = 0\nelse:\n b = m*(m-1)/2\nprint(ab)', 'n,m = [int(i) for i in input().split()]\nif n <= 1:\n a = 0\nelse:\n a = n*(n-1)/2\nif m <= 1:\n b = 0\nelse:\n b = m*(m-1)/2\nprint(a+b)', 'n,m = [int(i) for i in input(...
['Runtime Error', 'Wrong Answer', 'Accepted']
['s058881399', 's441229931', 's012314406']
[2940.0, 2940.0, 2940.0]
[17.0, 17.0, 17.0]
[131, 132, 137]
p02729
u076360626
2,000
1,048,576
We have N+M balls, each of which has an integer written on it. It is known that: * The numbers written on N of the balls are even. * The numbers written on M of the balls are odd. Find the number of ways to choose two of the N+M balls (disregarding order) so that the sum of the numbers written on them is even. ...
["def kaibun(str):\n return True if str == str[::-1] else False\n\ns = input()\nif not kaibun(s) :\n print('No')\n exit()\nn = len(s)\nn1 = (n - 1) // 2\nif not kaibun(s[:n1]) :\n print('No')\n exit()\nn2 = (n + 3) // 2 - 1\nif not kaibun(s[n2:]) :\n print('No')\n exit()\nprint('Yes')\n", 'import m...
['Wrong Answer', 'Runtime Error', 'Accepted']
['s197530308', 's570448554', 's226396039']
[3060.0, 3064.0, 3060.0]
[17.0, 17.0, 17.0]
[289, 624, 234]
p02729
u077019541
2,000
1,048,576
We have N+M balls, each of which has an integer written on it. It is known that: * The numbers written on N of the balls are even. * The numbers written on M of the balls are odd. Find the number of ways to choose two of the N+M balls (disregarding order) so that the sum of the numbers written on them is even. ...
['N,M=map(int,input().split())\nprint(N*(N-1)/2+M*(M-1)/2)', 'N,M=map(int,input().split())\nprint(int(N*(N-1)/2+M*(M-1)/2))']
['Wrong Answer', 'Accepted']
['s448628829', 's295206877']
[2940.0, 3060.0]
[17.0, 19.0]
[55, 60]
p02729
u078168851
2,000
1,048,576
We have N+M balls, each of which has an integer written on it. It is known that: * The numbers written on N of the balls are even. * The numbers written on M of the balls are odd. Find the number of ways to choose two of the N+M balls (disregarding order) so that the sum of the numbers written on them is even. ...
['n, m = map(int, input().split())\nprint(n*(n-1)/2+m*(m-1)/2)', 'n, m = map(int, input().split())\nprint(n*(n-1)//2+m*(m-1)//2)']
['Wrong Answer', 'Accepted']
['s167102047', 's361229427']
[9100.0, 9024.0]
[28.0, 30.0]
[59, 61]
p02729
u078225071
2,000
1,048,576
We have N+M balls, each of which has an integer written on it. It is known that: * The numbers written on N of the balls are even. * The numbers written on M of the balls are odd. Find the number of ways to choose two of the N+M balls (disregarding order) so that the sum of the numbers written on them is even. ...
['a,b = map(int,input().split())\nprint(((a*(a-1)) // 2 + ((b*(b-1))// 2) \n\n \n \n', 'M,N = map(int,input().split())\nprint((M*(M-1))//2 + ((N*(N-1))//2) \n\n \n \n', 'a,b = map(int,input().split())\nprint((a*(a-1)) // 2 + ((b*(b-1))// 2 )\n\n \n ', 'a,b = map(int,input().split())\nc = ((a*(a-1))...
['Runtime Error', 'Runtime Error', 'Runtime Error', 'Runtime Error', 'Accepted']
['s088855698', 's261376291', 's690573147', 's975256448', 's738580032']
[2940.0, 2940.0, 3064.0, 2940.0, 2940.0]
[17.0, 17.0, 17.0, 17.0, 17.0]
[84, 80, 82, 84, 80]
p02729
u078307399
2,000
1,048,576
We have N+M balls, each of which has an integer written on it. It is known that: * The numbers written on N of the balls are even. * The numbers written on M of the balls are odd. Find the number of ways to choose two of the N+M balls (disregarding order) so that the sum of the numbers written on them is even. ...
['n = int(input())\nnums = list(map(int, input().split()))\n\nvalues = {}\nfor i in nums:\n if i in values: values[i] += 1\n else: values[i] = 1\n\nsums={} \nsubsums={} (ボールがないとき版\nallsum = 0\nfor k,v in values.items():\n sums[k] = v * (v - 1) / 2\n undersum = (v - 2) * (v - 1) / 2 if v > 1 else 0\n subsums[k] = s...
['Runtime Error', 'Accepted']
['s971120151', 's912786637']
[3064.0, 2940.0]
[18.0, 17.0]
[558, 76]
p02729
u078982327
2,000
1,048,576
We have N+M balls, each of which has an integer written on it. It is known that: * The numbers written on N of the balls are even. * The numbers written on M of the balls are odd. Find the number of ways to choose two of the N+M balls (disregarding order) so that the sum of the numbers written on them is even. ...
['m, n = map(int, input().split())\nprint(m * (m - 1)/2 + n * (n - 1)/2)', 'm, n = map(int, input().split())\nprint(int(m * (m - 1)/2 + n * (n - 1)/2))']
['Wrong Answer', 'Accepted']
['s346161232', 's064830889']
[2940.0, 3060.0]
[17.0, 17.0]
[69, 74]
p02729
u080364835
2,000
1,048,576
We have N+M balls, each of which has an integer written on it. It is known that: * The numbers written on N of the balls are even. * The numbers written on M of the balls are odd. Find the number of ways to choose two of the N+M balls (disregarding order) so that the sum of the numbers written on them is even. ...
['n, m = map(int, input().split())\nprint(n*(n-1)//2 + m*(m-1)//2a)', 'n, m = map(int, input().split())\nprint(n*(n-1)//2 + m*(m-1)//2)']
['Runtime Error', 'Accepted']
['s455492020', 's518864292']
[2940.0, 3060.0]
[17.0, 19.0]
[64, 63]
p02729
u080423069
2,000
1,048,576
We have N+M balls, each of which has an integer written on it. It is known that: * The numbers written on N of the balls are even. * The numbers written on M of the balls are odd. Find the number of ways to choose two of the N+M balls (disregarding order) so that the sum of the numbers written on them is even. ...
['N,M=map(int,input().split())\n\nprint((N*(N-1)+M*(M-1))/2)', 'N,M=map(int,input().split())\n\nprint((N*(N-1)+M*(M-1))//2)']
['Wrong Answer', 'Accepted']
['s001055165', 's773077196']
[2940.0, 2940.0]
[17.0, 17.0]
[56, 57]
p02729
u080685822
2,000
1,048,576
We have N+M balls, each of which has an integer written on it. It is known that: * The numbers written on N of the balls are even. * The numbers written on M of the balls are odd. Find the number of ways to choose two of the N+M balls (disregarding order) so that the sum of the numbers written on them is even. ...
['n, m = map(int, input().split())\nif m >= 2:\n if n < 2:\n print(int(m*(m-1)/2)\n quit()\n else:\n print(int(m*(m-1)/2 + n*(n-1)/2))\n quit()\n \nif m < 2:\n if n < 2:\n print(0)\n else:\n print(int(n*(n-1)/2))\n \n', 'n, m = map(int, input().split())\nif m >= 2:\n if n < 2:\n print(m * ...
['Runtime Error', 'Wrong Answer', 'Accepted']
['s340889097', 's928948754', 's138650224']
[2940.0, 2940.0, 3060.0]
[16.0, 17.0, 17.0]
[226, 216, 227]
p02729
u083874202
2,000
1,048,576
We have N+M balls, each of which has an integer written on it. It is known that: * The numbers written on N of the balls are even. * The numbers written on M of the balls are odd. Find the number of ways to choose two of the N+M balls (disregarding order) so that the sum of the numbers written on them is even. ...
['import math\nH, W = map(int, input().split())\n\na = (H * (H-1))/2\nb = (W * (W-1))/2\n\nprint(a+b)\n', 'import math\nH, W = map(int, input().split())\n\na = (H * H-1)/2\nb = (W * W-1)/2\nprint(a+b)', 'import math\nH, W = map(int, input().split())\n \na = (H * (H-1))/2\nb = (W * (W-1))/2\n \nprint(int(a+b))']
['Wrong Answer', 'Wrong Answer', 'Accepted']
['s121999561', 's437960009', 's358768987']
[2940.0, 3060.0, 2940.0]
[18.0, 17.0, 17.0]
[94, 88, 100]
p02729
u084261177
2,000
1,048,576
We have N+M balls, each of which has an integer written on it. It is known that: * The numbers written on N of the balls are even. * The numbers written on M of the balls are odd. Find the number of ways to choose two of the N+M balls (disregarding order) so that the sum of the numbers written on them is even. ...
['n, m = list(map(int, input().split()))\nlis = []\nfor i in range(n):\n lis.append(1)\n for i in range(m):\n lis.append(2)\n count = 0\n for i in range(len(lis)):\n for j in range(i + 1, len(lis)):\n if (lis[i] + lis[j]) % 2 == 0:\n count += 1\n print(count)', 'n, m = list(map(...
['Wrong Answer', 'Accepted']
['s028798046', 's417861559']
[15340.0, 3064.0]
[2104.0, 22.0]
[287, 253]
p02729
u085279920
2,000
1,048,576
We have N+M balls, each of which has an integer written on it. It is known that: * The numbers written on N of the balls are even. * The numbers written on M of the balls are odd. Find the number of ways to choose two of the N+M balls (disregarding order) so that the sum of the numbers written on them is even. ...
['n,m = map(int, input().split())\nprint(n*(n-1)/2 + m*(m-1)/2)', 'n,m = map(int, input().split())\nprint(int(n*(n-1)/2 + m*(m-1)/2))\n']
['Wrong Answer', 'Accepted']
['s871459978', 's613425726']
[2940.0, 2940.0]
[17.0, 17.0]
[60, 66]
p02729
u085329544
2,000
1,048,576
We have N+M balls, each of which has an integer written on it. It is known that: * The numbers written on N of the balls are even. * The numbers written on M of the balls are odd. Find the number of ways to choose two of the N+M balls (disregarding order) so that the sum of the numbers written on them is even. ...
['n,m = map(int, input().split())\nprint((n*(n-1)+m*(m-1))/2)', 'n,m = map(int, input().split())\nprint((n*(n-1)/2+m*(m-1)/2)', 'n,m = map(int, input().split())\nprint((n*(n-1)+m*(m-1))/2)', 'n,m = map(int, input().split())\nprint(n*(n-1)+m*(m-1))', 'n,m = map(float, input().split())\nprint(int((n*(n-1)+m*(m-1))/2))']
['Wrong Answer', 'Runtime Error', 'Wrong Answer', 'Wrong Answer', 'Accepted']
['s045773440', 's584726800', 's815156244', 's939293801', 's257718379']
[2940.0, 2940.0, 2940.0, 3316.0, 2940.0]
[17.0, 17.0, 17.0, 21.0, 17.0]
[58, 59, 58, 54, 65]
p02729
u088115428
2,000
1,048,576
We have N+M balls, each of which has an integer written on it. It is known that: * The numbers written on N of the balls are even. * The numbers written on M of the balls are odd. Find the number of ways to choose two of the N+M balls (disregarding order) so that the sum of the numbers written on them is even. ...
['s= input()\nl = list(s)\nans= "Yes"\nfor i in range(0,(len(s)//2)):\n if(l[i]!=l[-1-i]):\n ans = "No"\nprint(ans)\n', 's= input()\nl = list(s)\nans= "Yes"\nfor i in range(0,(len(s)//2)+1):\n if(l[i]!=l[-1-i]):\n ans = "No"\nprint(ans)\n', 's= input()\nl = list(s)\nans= "Yes"\nfor i in range(0,len(s)//2):\n i...
['Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Accepted']
['s077771924', 's318297027', 's930527967', 's741146689']
[2940.0, 2940.0, 2940.0, 3316.0]
[17.0, 17.0, 18.0, 21.0]
[112, 114, 110, 60]
p02729
u089504174
2,000
1,048,576
We have N+M balls, each of which has an integer written on it. It is known that: * The numbers written on N of the balls are even. * The numbers written on M of the balls are odd. Find the number of ways to choose two of the N+M balls (disregarding order) so that the sum of the numbers written on them is even. ...
['n,m=map(int,input().split())\nans=n*(n-1)/2+m*(m-1)/2\nprint(ans)', 'n,m=map(int,input().split())\nans=n*(n-1)/2+m*(m-1)/2\nprint(int(ans))']
['Wrong Answer', 'Accepted']
['s284660398', 's268553569']
[2940.0, 2940.0]
[17.0, 21.0]
[63, 68]
p02729
u092460072
2,000
1,048,576
We have N+M balls, each of which has an integer written on it. It is known that: * The numbers written on N of the balls are even. * The numbers written on M of the balls are odd. Find the number of ways to choose two of the N+M balls (disregarding order) so that the sum of the numbers written on them is even. ...
['a,b=list(map(int, input().split()))\nct=(a*(a-1))//2\nct+=b\nprint(ct)', 'a,b=list(map(int, input().split()))\nct=(a*(a-1))//2\nct+=(b*(b-1))//2\nprint(ct)']
['Wrong Answer', 'Accepted']
['s891050277', 's756107580']
[2940.0, 2940.0]
[18.0, 17.0]
[67, 78]
p02729
u093861603
2,000
1,048,576
We have N+M balls, each of which has an integer written on it. It is known that: * The numbers written on N of the balls are even. * The numbers written on M of the balls are odd. Find the number of ways to choose two of the N+M balls (disregarding order) so that the sum of the numbers written on them is even. ...
['n,m=map(int,input().split())\n\nprint(n*(n-1)/2+m*(m-1)/2)\n', 'n,m=map(int,input().split())\n\nprint(int(n*(n-1)/2+m*(m-1)/2))\n']
['Wrong Answer', 'Accepted']
['s177054164', 's791183790']
[2940.0, 2940.0]
[17.0, 17.0]
[57, 62]
p02729
u096446417
2,000
1,048,576
We have N+M balls, each of which has an integer written on it. It is known that: * The numbers written on N of the balls are even. * The numbers written on M of the balls are odd. Find the number of ways to choose two of the N+M balls (disregarding order) so that the sum of the numbers written on them is even. ...
['N,M = map(int , input().split())\nresult = N+M\nif result % 2 == 1:\n print(result)', 'a = map(int, input().split())\nprint(n*(n-1)//2 + m*(m-1)//2)\n', 'N,M = map(int , input().split())\nresult = N+M\nif result % 2 == 1:\n print(result)\n', 'a = map(int, input().split())\nprint(n*(n-1)//2 + m(m-1)//2)', 'n, m ...
['Wrong Answer', 'Runtime Error', 'Wrong Answer', 'Runtime Error', 'Accepted']
['s075487793', 's211844557', 's318590610', 's668656020', 's087229598']
[3316.0, 2940.0, 2940.0, 2940.0, 2940.0]
[19.0, 17.0, 17.0, 17.0, 17.0]
[83, 61, 84, 59, 64]
p02729
u097069712
2,000
1,048,576
We have N+M balls, each of which has an integer written on it. It is known that: * The numbers written on N of the balls are even. * The numbers written on M of the balls are odd. Find the number of ways to choose two of the N+M balls (disregarding order) so that the sum of the numbers written on them is even. ...
['n,w=map(int,input().split())\nprint((n*w)*(n*w-1) /2)', 'n,w=map(int,input().split())\nprint(nw(nw-1) /2)', 'n,w=map(int,input().split())\nprint(n*w(n*w-1) /2)', 'n,w=map(int,input().split())\nprint((n*(n-1)//2)+(w*(w-1)//2))']
['Wrong Answer', 'Runtime Error', 'Runtime Error', 'Accepted']
['s299603750', 's440232523', 's867292605', 's151401673']
[2940.0, 2940.0, 2940.0, 2940.0]
[18.0, 17.0, 18.0, 17.0]
[52, 47, 49, 61]
p02729
u100572972
2,000
1,048,576
We have N+M balls, each of which has an integer written on it. It is known that: * The numbers written on N of the balls are even. * The numbers written on M of the balls are odd. Find the number of ways to choose two of the N+M balls (disregarding order) so that the sum of the numbers written on them is even. ...
['import math\nN,M = map(int,input().split())\n\ndef combinations_count(n, r):\n return math.factorial(n) // (math.factorial(n - r) * math.factorial(r))\n\nif N !=0 and N != 1:\n a = combinations_count(N, 2)\nelse:\n a = 0\n\nif M !=0 and M != 0:\n b = combinations_count(M, 2)\nelse:\n b = 0\n\nprint(a+b...
['Runtime Error', 'Accepted']
['s535496083', 's122282433']
[3060.0, 3064.0]
[17.0, 18.0]
[303, 303]
p02729
u100812801
2,000
1,048,576
We have N+M balls, each of which has an integer written on it. It is known that: * The numbers written on N of the balls are even. * The numbers written on M of the balls are odd. Find the number of ways to choose two of the N+M balls (disregarding order) so that the sum of the numbers written on them is even. ...
['s=input()\ns = int(s)\nt=input()\nt = int(t)\nprint(s*(s-1) /2 + t*(t-1)/2)', 's,t=(int(x) for x in input().split())\nprint(s*(s-1) /2 + t*(t-1)/2)', 's,t=(int(x) for x in input().split())\nprint(int(s*(s-1) /2 + t*(t-1)/2))']
['Runtime Error', 'Wrong Answer', 'Accepted']
['s731813071', 's733203620', 's344866078']
[2940.0, 2940.0, 2940.0]
[17.0, 17.0, 18.0]
[71, 67, 72]
p02729
u100873497
2,000
1,048,576
We have N+M balls, each of which has an integer written on it. It is known that: * The numbers written on N of the balls are even. * The numbers written on M of the balls are odd. Find the number of ways to choose two of the N+M balls (disregarding order) so that the sum of the numbers written on them is even. ...
['n,m = map(int,input().split())\n\nprint((n+m)*(n+m-1)/2-n*m)', 'n,m = map(int,input().split())\n\nprint(round((n+m)*(n+m-1)/2-n*m))']
['Wrong Answer', 'Accepted']
['s302645398', 's750755857']
[2940.0, 2940.0]
[17.0, 18.0]
[58, 65]
p02729
u101350975
2,000
1,048,576
We have N+M balls, each of which has an integer written on it. It is known that: * The numbers written on N of the balls are even. * The numbers written on M of the balls are odd. Find the number of ways to choose two of the N+M balls (disregarding order) so that the sum of the numbers written on them is even. ...
['s = input()\nn = len(s)\nt = s[:(n-1)//2]\nu = s[(n+3)//2-1:]\nif s==s[::-1] and t==t[::-1] and u==u[::-1]:\n print("Yes")\nelse:\n print("No")\n', 'N, M = map(int,input( ).split())\nanswer = (N * (N-1) + M * (M-1)) // 2\nprint(answer)']
['Wrong Answer', 'Accepted']
['s843221007', 's029948279']
[2940.0, 2940.0]
[17.0, 18.0]
[143, 84]
p02729
u101513660
2,000
1,048,576
We have N+M balls, each of which has an integer written on it. It is known that: * The numbers written on N of the balls are even. * The numbers written on M of the balls are odd. Find the number of ways to choose two of the N+M balls (disregarding order) so that the sum of the numbers written on them is even. ...
["import math\n\ndef inputlist(): return [int(i) for i in input().split()]\n\ndef kumiawase(num):\n r = 2\n if num != 1 or num != 0:\n return math.factorial(num) // (math.factorial(num - r) * math.factorial(r))\n else:\n return 0\n\ndef main():\n N, M = inputlist()\n print(kumiawase(N) + ku...
['Runtime Error', 'Runtime Error', 'Accepted']
['s936381064', 's944162396', 's195905127']
[3060.0, 3060.0, 3060.0]
[18.0, 17.0, 17.0]
[355, 295, 356]
p02729
u102242691
2,000
1,048,576
We have N+M balls, each of which has an integer written on it. It is known that: * The numbers written on N of the balls are even. * The numbers written on M of the balls are odd. Find the number of ways to choose two of the N+M balls (disregarding order) so that the sum of the numbers written on them is even. ...
['\nn = int(input())\na = list(map(int,input().split()))\nb = a.copy()\nb = set(b)\nb = list(b)\nc = []\nans = []\n\nfor i in range(len(b)):\n c.append(a.count(b[i]))\nprint(b)\nprint(c)\nd = []\nfor i in range(len(b)):\n num = 0\n for j in range(len(b)):\n if i == j:\n num += int(((c[j]-1)*(...
['Runtime Error', 'Accepted']
['s594597555', 's163601029']
[3064.0, 2940.0]
[17.0, 18.0]
[494, 83]
p02729
u103520789
2,000
1,048,576
We have N+M balls, each of which has an integer written on it. It is known that: * The numbers written on N of the balls are even. * The numbers written on M of the balls are odd. Find the number of ways to choose two of the N+M balls (disregarding order) so that the sum of the numbers written on them is even. ...
['guu, ki = map(int, input().split())\n\nprint(guu*(guu-1)/2 + ki*(ki-1)/2)', 'guu, ki = map(int, input().split())\n\nprint(int(guu*(guu-1)/2 + ki*(ki-1)/2))']
['Wrong Answer', 'Accepted']
['s349854956', 's260167983']
[2940.0, 2940.0]
[17.0, 17.0]
[71, 76]
p02729
u103724957
2,000
1,048,576
We have N+M balls, each of which has an integer written on it. It is known that: * The numbers written on N of the balls are even. * The numbers written on M of the balls are odd. Find the number of ways to choose two of the N+M balls (disregarding order) so that the sum of the numbers written on them is even. ...
["val = input().split(' ')\nn = int(val[0])\nm = int(val[1])\n\nresult = n * (n-1) / 2 + m * (m-1) / 2\n\nprint(result)\n", "val = input().split(' ')\nn = int(val[0])\nm = int(val[1])\n\nresult = n * (n-1) / 2 + m * (m-1) / 2\n\nprint(int(result))\n"]
['Wrong Answer', 'Accepted']
['s306370613', 's583363475']
[2940.0, 2940.0]
[18.0, 17.0]
[112, 117]
p02729
u104005543
2,000
1,048,576
We have N+M balls, each of which has an integer written on it. It is known that: * The numbers written on N of the balls are even. * The numbers written on M of the balls are odd. Find the number of ways to choose two of the N+M balls (disregarding order) so that the sum of the numbers written on them is even. ...
["s1 = str(input())\ns2 = ''\nfor i in range(len(s1)):\n s2 += s1[- i - 1]\nif s1 != s2:\n print('No')\n exit()\n\nt1 = s1[0 : ((len(s1)) - 1) // 2]\nt2 = ''\nfor i in range(len(t1)):\n t2 += t1[- i - 1]\nif t1 != t2:\n print('No')\n exit() \n\nu1 = s1[(len(s1) + 3) // 2 - 1:]\nu2 = ''\nfor i in range...
['Wrong Answer', 'Accepted']
['s484173465', 's084440807']
[3064.0, 2940.0]
[17.0, 18.0]
[386, 84]
p02729
u105659451
2,000
1,048,576
We have N+M balls, each of which has an integer written on it. It is known that: * The numbers written on N of the balls are even. * The numbers written on M of the balls are odd. Find the number of ways to choose two of the N+M balls (disregarding order) so that the sum of the numbers written on them is even. ...
['N,M=map(int, input().split()) \nif M == 1:\n answer = N * N-1\nelif N == 1:\n answer = M * M-1\nelse:\n answer = (N * (N-1))//2 + (M * (M-1))//2\nprint(answer)', 'N,M=map(int, input().split()) \nif M == 1 or M==0:\n answer = N * (N-1)\nelif N == 1 or N==0:\n answer = M * (M-1) \nelse:\n answer = ...
['Wrong Answer', 'Wrong Answer', 'Accepted']
['s800952899', 's971918565', 's378256465']
[3060.0, 2940.0, 3060.0]
[18.0, 17.0, 17.0]
[161, 190, 191]
p02729
u106489129
2,000
1,048,576
We have N+M balls, each of which has an integer written on it. It is known that: * The numbers written on N of the balls are even. * The numbers written on M of the balls are odd. Find the number of ways to choose two of the N+M balls (disregarding order) so that the sum of the numbers written on them is even. ...
['N,M=map(int(input().split())\ntotal=0\nif N>=2\n\ttotal+=N*(N-1)/2\nif M>=2\n total+=M*(M-1)/2\nprint(total)', 'N,M=map(int,input().split())\nt =0\nif N>=2:\n\tt+=N*(N-1)//2\nif M>=2:\n t+=M*(M-1)//2\nprint(t)']
['Runtime Error', 'Accepted']
['s554595710', 's030129009']
[2940.0, 2940.0]
[17.0, 19.0]
[104, 93]
p02729
u109133010
2,000
1,048,576
We have N+M balls, each of which has an integer written on it. It is known that: * The numbers written on N of the balls are even. * The numbers written on M of the balls are odd. Find the number of ways to choose two of the N+M balls (disregarding order) so that the sum of the numbers written on them is even. ...
['n,m=int(input().split())\nif n<=1:\n n=0\nif m<=1:\n m=0\nprint((n*(n-1)//2)+(m*(m-1)//2))', 'n,m=map(int,input().split())\n\nprint((n*(n-1)//2)+(m*(m-1)//2))']
['Runtime Error', 'Accepted']
['s059273277', 's167665032']
[2940.0, 2940.0]
[17.0, 17.0]
[91, 62]
p02729
u111652094
2,000
1,048,576
We have N+M balls, each of which has an integer written on it. It is known that: * The numbers written on N of the balls are even. * The numbers written on M of the balls are odd. Find the number of ways to choose two of the N+M balls (disregarding order) so that the sum of the numbers written on them is even. ...
['N,M=map(int,input().split())\n\nN1=(N*(N-1))/2\nM1=(M*(M-1))/2\n\nif N==0:\n print(M1)\nelif M==0:\n print(N1)\nelse:\n print(M1+N1)', 'N,M=map(int,input().split())\n\nN1=(N*(N-1))/2\nM1=(M*(M-1))/2\n\nif N==0:\n print(int(M1))\nelif M==0:\n print(int(N1))\nelse:\n print(int(M1+N1))']
['Wrong Answer', 'Accepted']
['s391761318', 's451410525']
[3060.0, 3060.0]
[17.0, 18.0]
[131, 146]
p02729
u112247039
2,000
1,048,576
We have N+M balls, each of which has an integer written on it. It is known that: * The numbers written on N of the balls are even. * The numbers written on M of the balls are odd. Find the number of ways to choose two of the N+M balls (disregarding order) so that the sum of the numbers written on them is even. ...
['print((int(input()))**3/27)', 'n, m = list(map(int,input().strip().split()))\nprint(((n- 1)*(n))//2 + ((m-1)*(m))//2)']
['Runtime Error', 'Accepted']
['s199018769', 's706736202']
[9092.0, 2940.0]
[23.0, 17.0]
[27, 85]
p02729
u113991073
2,000
1,048,576
We have N+M balls, each of which has an integer written on it. It is known that: * The numbers written on N of the balls are even. * The numbers written on M of the balls are odd. Find the number of ways to choose two of the N+M balls (disregarding order) so that the sum of the numbers written on them is even. ...
['a=0\nb=0\ndef ball(x,y):\n a=x*(x-1)//2\n b=y*(y-1)//2\n if a!=0 and b!=0:\n print(a+b)\n elif a=0:\n print(b)\n else:\n print(a)\n\n\nn,m=list(map(int,input().split()))\nball(n,m)', 'n=int(input())\na=(input().split())\nfor i in range(n):\n x=0\n for j in range(n):\n ...
['Runtime Error', 'Runtime Error', 'Wrong Answer', 'Wrong Answer', 'Accepted']
['s175399614', 's198383255', 's460185522', 's893596234', 's060741298']
[2940.0, 2940.0, 3060.0, 2940.0, 3060.0]
[17.0, 17.0, 19.0, 17.0, 18.0]
[202, 220, 71, 156, 246]
p02729
u115877451
2,000
1,048,576
We have N+M balls, each of which has an integer written on it. It is known that: * The numbers written on N of the balls are even. * The numbers written on M of the balls are odd. Find the number of ways to choose two of the N+M balls (disregarding order) so that the sum of the numbers written on them is even. ...
['a,b=map(int,input().split())\nn=(a*(a-1))//2\nm=(b*(b-1))//2\nif b<2 and b<2:\n print(0)\nelif b<2:\n print(n)\nelse:\n print(n+m)\n\n ', 'def uhe(x):\n return x%2\n\na,b=map(int,input().split())\nc=list(range(2,a*2+1,2))\nd=list(range(1,b*2+1,2))\n\ne=[(x+y) for x in c for y in d]\nf=list(map(uhe,e))\n\nwhile...
['Wrong Answer', 'Runtime Error', 'Wrong Answer', 'Accepted']
['s227137394', 's274632936', 's572496644', 's698083332']
[2940.0, 3188.0, 3316.0, 2940.0]
[18.0, 2104.0, 19.0, 17.0]
[129, 270, 176, 129]
p02729
u122428774
2,000
1,048,576
We have N+M balls, each of which has an integer written on it. It is known that: * The numbers written on N of the balls are even. * The numbers written on M of the balls are odd. Find the number of ways to choose two of the N+M balls (disregarding order) so that the sum of the numbers written on them is even. ...
['N, M = (int(x) for x in input().split())\nprint(N*(N-1)/2+M*(M-1)/2)', 'N, M = (int(x) for x in input().split())\nprint(N*(N-1)//2+M*(M-1)//2)']
['Wrong Answer', 'Accepted']
['s161463563', 's868816356']
[2940.0, 2940.0]
[17.0, 17.0]
[67, 69]
p02729
u123745130
2,000
1,048,576
We have N+M balls, each of which has an integer written on it. It is known that: * The numbers written on N of the balls are even. * The numbers written on M of the balls are odd. Find the number of ways to choose two of the N+M balls (disregarding order) so that the sum of the numbers written on them is even. ...
['from math import factorial\n\nx,y=map(int,input().split())\n\na = factorial(x) / factorial(2) / factorial(x - 2)\nb = factorial(y) / factorial(2) / factorial(y - 2)\nprint(int(a+b))', 'from math import factorial\n\nx,y=map(int,input().split())\nif x>1:\n a = factorial(x) / factorial(2) / factorial(x - 2)\nelse: a=...
['Runtime Error', 'Accepted']
['s676308962', 's629399859']
[3060.0, 3060.0]
[17.0, 17.0]
[175, 218]
p02729
u123849536
2,000
1,048,576
We have N+M balls, each of which has an integer written on it. It is known that: * The numbers written on N of the balls are even. * The numbers written on M of the balls are odd. Find the number of ways to choose two of the N+M balls (disregarding order) so that the sum of the numbers written on them is even. ...
["# -*- coding: utf-8 -*-\n\nimport collections\n\nn = int(input())\nballs = list(map(int, input().split(' ')))\n\nfor k in range(n):\n # print(balls[ : k])\n \n arr = balls[ : k] + balls[ k + 1 : ]\n\n dic = collections.Counter(arr)\n total = 0\n for v in dic.values():\n total += int(v * (v - ...
['Runtime Error', 'Accepted']
['s885637540', 's789525299']
[3316.0, 2940.0]
[21.0, 17.0]
[353, 99]
p02729
u125269142
2,000
1,048,576
We have N+M balls, each of which has an integer written on it. It is known that: * The numbers written on N of the balls are even. * The numbers written on M of the balls are odd. Find the number of ways to choose two of the N+M balls (disregarding order) so that the sum of the numbers written on them is even. ...
['n, m = map(int, input().split())\n\nif n >= 2:\n even = n * (n-1) /2\nelse:\n even = 0\n\nif m >= 2: \n odd = m * (m-1) /2\nelse:\n odd = 0\nprint(even + odd)', 'n, m = map(int, input().split())\n\nif n >= 2:\n even = n * (n - 1) / 2\nelse:\n even = 0\n\nif m >= 2:\n odd = m * (m - 1) / 2\nelse:\n od...
['Wrong Answer', 'Accepted']
['s836633992', 's637243852']
[9100.0, 9164.0]
[28.0, 30.0]
[152, 169]
p02729
u125389321
2,000
1,048,576
We have N+M balls, each of which has an integer written on it. It is known that: * The numbers written on N of the balls are even. * The numbers written on M of the balls are odd. Find the number of ways to choose two of the N+M balls (disregarding order) so that the sum of the numbers written on them is even. ...
['import math\nN,M = list(map(int,input().split()))\n\ndef combination(n,r):\n return math.factorial(n)//(math.factorial(n-r)*math.factorial(r))\n\nans = combination(N,2) + combination(M,2)\n\nprint(ans)', 'import math\nN,M = list(map(int,input().split()))\n\ndef combination(n,r):\n return math.factorial(n)/(math...
['Runtime Error', 'Runtime Error', 'Wrong Answer', 'Wrong Answer', 'Accepted']
['s018810168', 's534613705', 's786492252', 's988933389', 's964883973']
[3056.0, 2940.0, 2940.0, 2940.0, 2940.0]
[18.0, 18.0, 17.0, 17.0, 17.0]
[196, 195, 79, 75, 81]
p02729
u129019798
2,000
1,048,576
We have N+M balls, each of which has an integer written on it. It is known that: * The numbers written on N of the balls are even. * The numbers written on M of the balls are odd. Find the number of ways to choose two of the N+M balls (disregarding order) so that the sum of the numbers written on them is even. ...
['import math\ndef cmb(n, r):\n return math.factorial(n) // (math.factorial(n - r) * math.factorial(r))\n\ndef main():\n import sys\n N,M=list(map(int,sys.stdin.readline().split()))\n print(cmb(M,2)+cmb(N,2))\n\n\nmain()\n', 'import math\ndef cmb(n, r):\n if n<2:\n return 0\n\n return math.fact...
['Runtime Error', 'Accepted']
['s939505853', 's136383768']
[3064.0, 2940.0]
[18.0, 17.0]
[221, 251]
p02729
u131464432
2,000
1,048,576
We have N+M balls, each of which has an integer written on it. It is known that: * The numbers written on N of the balls are even. * The numbers written on M of the balls are odd. Find the number of ways to choose two of the N+M balls (disregarding order) so that the sum of the numbers written on them is even. ...
['N,M = map(int,input()split())\nans = N*(N-1)/2 + M*(M-1)/2\nprint(ans)', 'N,M = map(int,input()split())\nans = N*(N-1)/2 + M*(M-1)/2\nans = int()\nprint(ans)', 'N,M = map(int,input().split())\nans = N*(N-1)//2 + M*(M-1)//2\nprint(ans)']
['Runtime Error', 'Runtime Error', 'Accepted']
['s526416391', 's706888565', 's796984887']
[8900.0, 8900.0, 9044.0]
[21.0, 23.0, 27.0]
[68, 80, 71]
p02729
u132895075
2,000
1,048,576
We have N+M balls, each of which has an integer written on it. It is known that: * The numbers written on N of the balls are even. * The numbers written on M of the balls are odd. Find the number of ways to choose two of the N+M balls (disregarding order) so that the sum of the numbers written on them is even. ...
["S=str(input())\nN=len(S)\nif S[1:int(N-1)//2] == S[int(N+3)//2:N]:\n print('Yes')\nelse:\n print('No')\n", "S=str(input())\nN=len(S)\nif S[1:int(N-1)//2]== S[int(N+3)//2:N]:\n print('Yes')\nelse:\n print('No')", 'N,M=map(int,input().split())\na=N*N/4+M*M/4\nb=N+M\nif int(b)>2:\n print(a)\nelse:\n print(0)', 'N,...
['Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Accepted']
['s193390527', 's351703444', 's655340456', 's318985792']
[2940.0, 2940.0, 2940.0, 2940.0]
[18.0, 17.0, 17.0, 17.0]
[100, 98, 89, 64]
p02729
u135389999
2,000
1,048,576
We have N+M balls, each of which has an integer written on it. It is known that: * The numbers written on N of the balls are even. * The numbers written on M of the balls are odd. Find the number of ways to choose two of the N+M balls (disregarding order) so that the sum of the numbers written on them is even. ...
['import math\n\nn,m = map(int,input().split())\n\nans = (math.factorial(n) // (math.factorial(n - 2) * math.factorial(2))) + (math.factorial(m) // ((math.factorial(m - 2) * math.factorial(2))))\nprint(ans)', 'import math\n\nn,m = map(int,input().split())\n\ndef ans(a):\n if a<2:\n return 0\n else:\n ...
['Runtime Error', 'Accepted']
['s336487276', 's144665422']
[3060.0, 3060.0]
[17.0, 24.0]
[201, 205]
p02729
u135847648
2,000
1,048,576
We have N+M balls, each of which has an integer written on it. It is known that: * The numbers written on N of the balls are even. * The numbers written on M of the balls are odd. Find the number of ways to choose two of the N+M balls (disregarding order) so that the sum of the numbers written on them is even. ...
['l = int(input())\na = l/3\nprint(round(a**3,13))', 'n,m = map(int,input().split())\nans = n*(n-1)//2 + m*(m-1)//2\nprint(ans)\n']
['Runtime Error', 'Accepted']
['s419843581', 's962751037']
[2940.0, 2940.0]
[17.0, 17.0]
[46, 72]
p02729
u136071569
2,000
1,048,576
We have N+M balls, each of which has an integer written on it. It is known that: * The numbers written on N of the balls are even. * The numbers written on M of the balls are odd. Find the number of ways to choose two of the N+M balls (disregarding order) so that the sum of the numbers written on them is even. ...
['def factorial(n):\n if n == 0 or n == 1 or n < 0:\n return 1\n return n * factorial(n-1)\n\nN,M = map(int,input().split())\n\ncombination = int(factorial(N) / (2 * (factorial(N-2)))) + M\nprint(combination)\n', 'def factorial(n):\n if n == 0 or n == 1 or n < 0:\n return 1\n return n * factor...
['Wrong Answer', 'Accepted']
['s753047752', 's514549391']
[3060.0, 3060.0]
[17.0, 17.0]
[212, 246]
p02729
u136279532
2,000
1,048,576
We have N+M balls, each of which has an integer written on it. It is known that: * The numbers written on N of the balls are even. * The numbers written on M of the balls are odd. Find the number of ways to choose two of the N+M balls (disregarding order) so that the sum of the numbers written on them is even. ...
['input_line = input().split()\nN = int(input_line[0])\nM = int(input_line[1])\n\nimport math\n\nprint("N="+str(N)+" M="+str(M))\n\ndef combination(n, r):\n if(n == 1 or n == 0):\n return 0\n else:\n return math.factorial(n) // math.factorial(n-r) // math.factorial(r)\n\nprint(combination(N,2) + com...
['Wrong Answer', 'Accepted']
['s572491248', 's150426325']
[3060.0, 2940.0]
[17.0, 18.0]
[319, 286]
p02729
u144310740
2,000
1,048,576
We have N+M balls, each of which has an integer written on it. It is known that: * The numbers written on N of the balls are even. * The numbers written on M of the balls are odd. Find the number of ways to choose two of the N+M balls (disregarding order) so that the sum of the numbers written on them is even. ...
['n, m = map(int,input().split())\nx = (n*(n-1)) / 2\ny = (m*(m-1)) / 2\nprint(x+y)\n\n', 'n, m = map(int, input().split())\nx = (n*(n-1)) // 2\ny = (m*(m-1)) // 2\nprint(x+y)']
['Wrong Answer', 'Accepted']
['s815405898', 's069880786']
[2940.0, 2940.0]
[20.0, 17.0]
[80, 81]
p02729
u145145077
2,000
1,048,576
We have N+M balls, each of which has an integer written on it. It is known that: * The numbers written on N of the balls are even. * The numbers written on M of the balls are odd. Find the number of ways to choose two of the N+M balls (disregarding order) so that the sum of the numbers written on them is even. ...
['l=int(input())\n\nimport numpy as np\nresult = 0\nfor x in np.arange(l/3-0.1, l/3+0.1, 0.1):\n for y in np.arange(x, l/3+0.1, 0.1):\n z = l - (x+y)\n if z <= 0:\n break\n v = x*y*z\n result = max(v, result)\nprint(result)', 'n,m=map(int,input().split())\nprint( int((n+m)*(n+m-1)/2 - n*m) )']
['Runtime Error', 'Accepted']
['s142589650', 's182618090']
[9120.0, 9164.0]
[25.0, 31.0]
[228, 64]
p02729
u148753842
2,000
1,048,576
We have N+M balls, each of which has an integer written on it. It is known that: * The numbers written on N of the balls are even. * The numbers written on M of the balls are odd. Find the number of ways to choose two of the N+M balls (disregarding order) so that the sum of the numbers written on them is even. ...
['n = int(input())\na = list(map(int, input().split()))\nimport math\nimport collections\ndef combinations_count(n, r):\n return math.factorial(n) // (math.factorial(n - r) * math.factorial(r))\ndef get_result(key, c):\n ans = 0\n for d in c.items():\n if d[0] == key:\n value = d[1]-1\n ...
['Runtime Error', 'Accepted']
['s052104981', 's127790217']
[3064.0, 3064.0]
[17.0, 26.0]
[642, 234]
p02729
u153259685
2,000
1,048,576
We have N+M balls, each of which has an integer written on it. It is known that: * The numbers written on N of the balls are even. * The numbers written on M of the balls are odd. Find the number of ways to choose two of the N+M balls (disregarding order) so that the sum of the numbers written on them is even. ...
['n,m=map(int,input().split())\nprint(n*(n-1)/2+m*(m-1)/2)', 'n,m=map(int,input().split())\nx=n*(n-1)/2+m*(m-1)/2\nprint(x)', 'n,m=map(int,input().split())\nprint(int(n*(n-1)/2+m*(m-1)/2))']
['Wrong Answer', 'Wrong Answer', 'Accepted']
['s596995230', 's944723636', 's134127725']
[2940.0, 2940.0, 3064.0]
[17.0, 17.0, 17.0]
[55, 59, 60]
p02729
u155946404
2,000
1,048,576
We have N+M balls, each of which has an integer written on it. It is known that: * The numbers written on N of the balls are even. * The numbers written on M of the balls are odd. Find the number of ways to choose two of the N+M balls (disregarding order) so that the sum of the numbers written on them is even. ...
['n = int(input())\nm = int(input())\n\nn_dot = n*(n-1)/2\nm_dot = m*(m-1)/2\n\nanswer = int(n_dot+ m_dot)\nprint(answer)', 'n = int(input())\nm = int(input())\n\nn_dot = n*(n-1)/2\nm_dot = m*(m-1)/2\n\nanswer = n_dot+ m_dot\nprint(answer)', 'n,m=(int(x) for x in input().split())\n\nn_dot = n*(n-1)/2\nm_dot = m*(m-1)/2...
['Runtime Error', 'Runtime Error', 'Accepted']
['s154510027', 's351433220', 's360585202']
[2940.0, 2940.0, 2940.0]
[20.0, 19.0, 17.0]
[112, 107, 117]
p02729
u163907160
2,000
1,048,576
We have N+M balls, each of which has an integer written on it. It is known that: * The numbers written on N of the balls are even. * The numbers written on M of the balls are odd. Find the number of ways to choose two of the N+M balls (disregarding order) so that the sum of the numbers written on them is even. ...
['import math\nm,n=map(int,input().split())\ndm,dn=0,0\nif m>2:\n dm = math.factorial(m)//math.factorial(m-2)\nif n>2:\n dn = math.factorial(n)//math.factorial(n-2)\nprint((dm+dn)//2)\n', 'import math\nm,n=map(int,input().split())\ndm,dn=0,0\nif m>=2:\n dm = math.factorial(m)//math.factorial(m-2)\nif n>=2:\n ...
['Wrong Answer', 'Accepted']
['s988931150', 's977654359']
[2940.0, 3060.0]
[18.0, 18.0]
[181, 183]
p02729
u165114979
2,000
1,048,576
We have N+M balls, each of which has an integer written on it. It is known that: * The numbers written on N of the balls are even. * The numbers written on M of the balls are odd. Find the number of ways to choose two of the N+M balls (disregarding order) so that the sum of the numbers written on them is even. ...
['import math\nn, m = input().split()\nn = int(n)\nm = int(m)\n\nprint(int(math.factorial(n)/(2 * math.factorial(n-2)) + math.factorial(m)/(2 * math.factorial(m-2))))\n\n', 'n, m = input().split()\nn = int(n)\nm = int(m)\n\nprint(n!/(2 * (n-2)!) + m!/(2 * (n-2)!))', 'import math\nn, m = input().split()\nn = int(n)\nm =...
['Runtime Error', 'Runtime Error', 'Runtime Error', 'Accepted']
['s316046405', 's364162629', 's812978881', 's519090219']
[9028.0, 8960.0, 9152.0, 9076.0]
[27.0, 26.0, 31.0, 28.0]
[161, 86, 161, 212]
p02729
u165268875
2,000
1,048,576
We have N+M balls, each of which has an integer written on it. It is known that: * The numbers written on N of the balls are even. * The numbers written on M of the balls are odd. Find the number of ways to choose two of the N+M balls (disregarding order) so that the sum of the numbers written on them is even. ...
['N, M = map(int, input().split())\n\nprint((N*(N-1)+M*(M-1))/2)\n', '\nN, M = map(int, input().split())\nprint((N*(N-1)+M*(M-1))//2)\n']
['Wrong Answer', 'Accepted']
['s598936338', 's127843534']
[2940.0, 2940.0]
[18.0, 17.0]
[61, 62]
p02729
u165394332
2,000
1,048,576
We have N+M balls, each of which has an integer written on it. It is known that: * The numbers written on N of the balls are even. * The numbers written on M of the balls are odd. Find the number of ways to choose two of the N+M balls (disregarding order) so that the sum of the numbers written on them is even. ...
['from math import factorial\n\nN, M = map(int, input().split())\n\ndef comb(n, k):\n return int(factorial(n) / factorial(k) / factorial(n-k))\n\nres = comb(M, 2) + comb(N, 2)\n\nprint(res)', 'N, M = map(int, input().split())\n\ndef factorial(n):\n p = 1\n for i in range(n, 0, -1):\n p *= i\n return ...
['Runtime Error', 'Accepted']
['s914144230', 's316133076']
[8932.0, 9012.0]
[27.0, 25.0]
[181, 240]
p02729
u166621202
2,000
1,048,576
We have N+M balls, each of which has an integer written on it. It is known that: * The numbers written on N of the balls are even. * The numbers written on M of the balls are odd. Find the number of ways to choose two of the N+M balls (disregarding order) so that the sum of the numbers written on them is even. ...
['N,M = map(int,input().split())\ncnt = 0\ncnt += ((N * N-1) / 2)\ncnt += ((M * M-1) / 2)\nprint(cnt)\n', 'N,M = map(int,input().split())\ncnt = 0\nif N >= 2:\n cnt += ((N * (N-1)) / 2)\nif M >= 2:\n cnt += ((M * (M-1)) / 2)\nprint(int(cnt))\n\n']
['Wrong Answer', 'Accepted']
['s193161118', 's502486511']
[2940.0, 2940.0]
[17.0, 17.0]
[96, 136]
p02729
u170158642
2,000
1,048,576
We have N+M balls, each of which has an integer written on it. It is known that: * The numbers written on N of the balls are even. * The numbers written on M of the balls are odd. Find the number of ways to choose two of the N+M balls (disregarding order) so that the sum of the numbers written on them is even. ...
['def fact(n):\n for i in range(1,n+1): \n fact = fact * i \n return fact\n\n\nx,y = input().split()\nreturn ((fact(x)/(2*fact(x-2)) + (fact(y)/(2*fact(y-2)))', '\nusing namespace std;\nint fact(int n)\n{\n int facto=1;\n for (int i = 1; i < n+1;i++)\n {\n facto = facto * i;\n }\n return facto;\n}\n\n\nint...
['Runtime Error', 'Runtime Error', 'Runtime Error', 'Accepted']
['s041460549', 's358386394', 's438917371', 's940691485']
[2940.0, 2940.0, 2940.0, 2940.0]
[17.0, 17.0, 18.0, 17.0]
[154, 301, 163, 188]
p02729
u172780602
2,000
1,048,576
We have N+M balls, each of which has an integer written on it. It is known that: * The numbers written on N of the balls are even. * The numbers written on M of the balls are odd. Find the number of ways to choose two of the N+M balls (disregarding order) so that the sum of the numbers written on them is even. ...
['n,m=map(int,input.split())\n\nans=n*(n-1)/2\nans+=m*(m-1)/2\n\nprint(int(ans))', 'n,m=map(int,input().split())\n\nans=n*(n-1)/2\nans+=m*(m-1)/2\n\nprint(int(ans))']
['Runtime Error', 'Accepted']
['s430910010', 's658570699']
[2940.0, 2940.0]
[17.0, 17.0]
[136, 75]
p02729
u172966990
2,000
1,048,576
We have N+M balls, each of which has an integer written on it. It is known that: * The numbers written on N of the balls are even. * The numbers written on M of the balls are odd. Find the number of ways to choose two of the N+M balls (disregarding order) so that the sum of the numbers written on them is even. ...
['N,M=input().split()\nfrom math import factorial \nif int(N)>=2 and int(M)>=2:\n print(factorial(int(N))/2/factorial(int(N)-2)+factorial(int(M))/2/factorial(int(M)-2))\nelif int(N)<2 and int(M)>=2:\n print(factorial(int(M))/2/factorial(int(M)-2))\nelif int(M)<2 and int(N)>=2:\n print(factorial(int(N))/2/fac...
['Wrong Answer', 'Wrong Answer', 'Accepted']
['s024692582', 's555527401', 's251901032']
[3064.0, 3064.0, 3064.0]
[18.0, 17.0, 17.0]
[349, 456, 400]
p02729
u173550659
2,000
1,048,576
We have N+M balls, each of which has an integer written on it. It is known that: * The numbers written on N of the balls are even. * The numbers written on M of the balls are odd. Find the number of ways to choose two of the N+M balls (disregarding order) so that the sum of the numbers written on them is even. ...
['n, m = map(int, input().split())\n\nif n <= 2:\n n_even = 0\nelse:\n n_even = n * (n-1) / 2\nif m <= 2:\n m_even = 0\nelse:\n m_even = m * (m-1) / 2\n\neven = n_even + m_even\nprint(int(even))', 'n, m = map(int, input().split())\n\nif n <= 1:\n n_even = 0\nelse:\n n_even = n * (n-1) / 2\nif m <= 1:\n m_even = ...
['Wrong Answer', 'Accepted']
['s438103669', 's171688362']
[2940.0, 2940.0]
[17.0, 18.0]
[184, 185]
p02729
u174181999
2,000
1,048,576
We have N+M balls, each of which has an integer written on it. It is known that: * The numbers written on N of the balls are even. * The numbers written on M of the balls are odd. Find the number of ways to choose two of the N+M balls (disregarding order) so that the sum of the numbers written on them is even. ...
['import math\n\nN, M = map(int, input().split())\ndef combinations_count(n, r):\n return math.factorial(n) // (math.factorial(n - r) * math.factorial(r))\n\nif N == 0:\n ans = combinations_count(M, 2)\nelif M == 0:\n ans = combinations_count(N, 2)\nelif N == 1 and M == 1:\n ans = 0\nelse:\n ans = combinations_cou...
['Runtime Error', 'Accepted']
['s548908649', 's855182949']
[3060.0, 3188.0]
[18.0, 20.0]
[351, 443]
p02729
u175217658
2,000
1,048,576
We have N+M balls, each of which has an integer written on it. It is known that: * The numbers written on N of the balls are even. * The numbers written on M of the balls are odd. Find the number of ways to choose two of the N+M balls (disregarding order) so that the sum of the numbers written on them is even. ...
['N,M = map(int, input().split())\nans1 = 0\nans2 = 0\n\nif(N >= 2): \n ans1 = (N*(N-1))/2\nif(M >= 2):\n ans2 = (M*(M-1))/2\n\nprint(ans1+ans2)', 'N,M = map(int, input().split())\nans1 = 0\nans2 = 0\n\nif(N >= 2): \n ans1 = (N*(N-1))//2\nif(M >= 2):\n ans2 = (M*(M-1))//2\n\nprint(ans1+ans2)']
['Wrong Answer', 'Accepted']
['s537555749', 's720389670']
[2940.0, 2940.0]
[17.0, 17.0]
[142, 144]
p02729
u175590965
2,000
1,048,576
We have N+M balls, each of which has an integer written on it. It is known that: * The numbers written on N of the balls are even. * The numbers written on M of the balls are odd. Find the number of ways to choose two of the N+M balls (disregarding order) so that the sum of the numbers written on them is even. ...
['n,m = map(int,input().split())\nprint((n*(n-1)//2))+(m*(m-1)//2))', 'n,m = map(int,input().split())\nprint((n*(n-1//2))+(m*(m-1)//2))', 'n,m = map(int,input().split())\nprint((n*(n-1)//2)+(m*(m-1)//2))']
['Runtime Error', 'Wrong Answer', 'Accepted']
['s367185007', 's427551576', 's134445899']
[2940.0, 2940.0, 9104.0]
[17.0, 17.0, 26.0]
[64, 63, 63]
p02729
u177411511
2,000
1,048,576
We have N+M balls, each of which has an integer written on it. It is known that: * The numbers written on N of the balls are even. * The numbers written on M of the balls are odd. Find the number of ways to choose two of the N+M balls (disregarding order) so that the sum of the numbers written on them is even. ...
['import math,string,itertools,fractions,heapq,collections,re,array,bisect,sys,random,time, copy,bisect\nfrom operator import itemgetter\n#from heapq import heappush, heappop\n#import numpy as np\n#from scipy.sparse.csgraph import shortest_path, floyd_warshall, dijkstra, bellman_ford, johnson\n#from scipy.sparse import...
['Wrong Answer', 'Accepted']
['s177445781', 's430308166']
[10820.0, 10936.0]
[42.0, 43.0]
[730, 745]
p02729
u180824420
2,000
1,048,576
We have N+M balls, each of which has an integer written on it. It is known that: * The numbers written on N of the balls are even. * The numbers written on M of the balls are odd. Find the number of ways to choose two of the N+M balls (disregarding order) so that the sum of the numbers written on them is even. ...
['import math\n\nN,M=map(int,input().split())\n\nprint(int(math.factorial(N)/math.factorial(N-2)/math.factorial(2)+math.factorial(M)/math.factorial(M-2)/math.factorial(2)))\n', 'import math\n\nN,M=map(int,input().split())\n\nif (N==0 or N==1) and (M==0 or M==1):\n print(0)\nelif (N==0 or N==1) and (M!=0 and M!=1):\n ...
['Runtime Error', 'Accepted']
['s401560622', 's130084967']
[2940.0, 3064.0]
[17.0, 17.0]
[167, 446]
p02729
u182594853
2,000
1,048,576
We have N+M balls, each of which has an integer written on it. It is known that: * The numbers written on N of the balls are even. * The numbers written on M of the balls are odd. Find the number of ways to choose two of the N+M balls (disregarding order) so that the sum of the numbers written on them is even. ...
['n, m = map (int, input().split())\nex1 = n*(n-1)/2\nex2 = m*(m-1)/2\nans = ex1 + ex2\nprint(ans)', 'n, m = map (int, input().split())\nex1 = n*(n-1)//2\nex2 = m*(m-1)//2\nans = ex1 + ex2\nprint(ans)']
['Wrong Answer', 'Accepted']
['s087086521', 's088638802']
[9152.0, 9116.0]
[30.0, 27.0]
[92, 94]
p02729
u184238067
2,000
1,048,576
We have N+M balls, each of which has an integer written on it. It is known that: * The numbers written on N of the balls are even. * The numbers written on M of the balls are odd. Find the number of ways to choose two of the N+M balls (disregarding order) so that the sum of the numbers written on them is even. ...
['N,M = input().split()\n\nN = int(N)\nM = int(M)\n\neven = int\nodd = int\nfinal = int\n\neven = (N*(N-1))/2\nodd = (M*(M-1))/2\nfinal = even + odd\nprint(final)', 'N,M = input().split()\n\nN = int(N)\nM = int(M)\n\neven = 0\nodd = 0\nfinal = 0\n\neven = (N*(N-1))/2\nodd = (M*(M-1))/2\nfinal = even + odd\nprint(final)...
['Wrong Answer', 'Wrong Answer', 'Accepted']
['s473731370', 's779698594', 's538979789']
[3060.0, 3060.0, 3060.0]
[18.0, 17.0, 17.0]
[148, 142, 149]
p02729
u184793010
2,000
1,048,576
We have N+M balls, each of which has an integer written on it. It is known that: * The numbers written on N of the balls are even. * The numbers written on M of the balls are odd. Find the number of ways to choose two of the N+M balls (disregarding order) so that the sum of the numbers written on them is even. ...
['M, N = map(int, input().split())\n\nprint(M*(M-1)/2+N*(N-1)/2)', 'M, N = map(int, input().split())\n\nprint(int(M*(M-1)/2+N*(N-1)/2))']
['Wrong Answer', 'Accepted']
['s796748845', 's371002927']
[9136.0, 9040.0]
[26.0, 26.0]
[60, 65]
p02729
u186121428
2,000
1,048,576
We have N+M balls, each of which has an integer written on it. It is known that: * The numbers written on N of the balls are even. * The numbers written on M of the balls are odd. Find the number of ways to choose two of the N+M balls (disregarding order) so that the sum of the numbers written on them is even. ...
['import math\nn, m = map(int, input().split())\nans = math.factorial(n - 1) + math.factorial(m)\nprint(ans)', 'from math import factorial\nn, m = map(int, input().split())\nc_n = factorial(n) / (factorial(2) * factorial(n - 2)) if n > 1 else 0\nc_m = factorial(m) / (factorial(2) * factorial(m - 2)) if m > 1 else 0\nan...
['Runtime Error', 'Accepted']
['s366639594', 's394117263']
[2940.0, 3060.0]
[17.0, 17.0]
[103, 238]
p02729
u186530241
2,000
1,048,576
We have N+M balls, each of which has an integer written on it. It is known that: * The numbers written on N of the balls are even. * The numbers written on M of the balls are odd. Find the number of ways to choose two of the N+M balls (disregarding order) so that the sum of the numbers written on them is even. ...
['while True:\n m, n = list(map(int, input().split()))\n print(m * (m - 1) / 2 + n * (n - 1) / 2)\n', 'm, n = list(map(int, input().split()))\nprint(m * (m - 1) / 2 + n * (n - 1) / 2)', 'm, n = list(map(int, input().split()))\nprint(int(m * (m - 1) / 2 + n * (n - 1) / 2))']
['Runtime Error', 'Wrong Answer', 'Accepted']
['s164214433', 's412975319', 's639243566']
[2940.0, 2940.0, 2940.0]
[18.0, 18.0, 17.0]
[100, 79, 84]
p02729
u186729829
2,000
1,048,576
We have N+M balls, each of which has an integer written on it. It is known that: * The numbers written on N of the balls are even. * The numbers written on M of the balls are odd. Find the number of ways to choose two of the N+M balls (disregarding order) so that the sum of the numbers written on them is even. ...
['from math import factorial\n\nn, m = map(int, input().split())\n\n\ndef combinations_count(n, r):\n \n return factorial(n) // (factorial(n - r) * factorial(r))\n\n\nn_cmb = combinations_count(n, 2)\nm_cmb = combinations_count(m, 2)\n\nprint(n_cmb + m_cmb)', 'from operator import mul\nfrom functools import reduc...
['Runtime Error', 'Runtime Error', 'Accepted']
['s751372208', 's816551744', 's025936578']
[3060.0, 3572.0, 2940.0]
[17.0, 23.0, 17.0]
[271, 310, 108]
p02729
u187169337
2,000
1,048,576
We have N+M balls, each of which has an integer written on it. It is known that: * The numbers written on N of the balls are even. * The numbers written on M of the balls are odd. Find the number of ways to choose two of the N+M balls (disregarding order) so that the sum of the numbers written on them is even. ...
['def compute_fact(n):\n global f\n f = [0 for i in range(n+1)]\n f[0] = 1\n f[1] = 1\n for i in range(2,n+1):\n f[i] = f[i-1]*i\n\ndef compute_c(n,r):\n compute_fact(n)\n ans = f[n]/(f[r] * f[n-r])\n return ans\n\nn,m = [int(s) for s in input().split()]\nprint(int(compute_c(n,2) + comput...
['Runtime Error', 'Accepted']
['s515744632', 's267189602']
[3060.0, 3064.0]
[17.0, 17.0]
[316, 515]
p02729
u193927973
2,000
1,048,576
We have N+M balls, each of which has an integer written on it. It is known that: * The numbers written on N of the balls are even. * The numbers written on M of the balls are odd. Find the number of ways to choose two of the N+M balls (disregarding order) so that the sum of the numbers written on them is even. ...
['a = list(map(int, input().split()))\nif a[0]<=1:\n n=0\nelse:\n n=a[0]*(a[0]-1)/2\n\nif a[1]<=1:\n m=0\nelse:\n m=a[1]*(a[1]-1)/2\n \nprint(n+m)', 'a = list(map(int, input().split()))\nif a[0]==1:\n n=0\nelse:\n n=a[0]*(a[0]-1)/2\n\nif a[1]==1:\n m=0\nelse:\n m=a[1]*(a[1]-1)/2\n \nprint(n+m)', 'a = list(map(i...
['Wrong Answer', 'Wrong Answer', 'Accepted']
['s590085233', 's626760749', 's859381555']
[3060.0, 3060.0, 3060.0]
[17.0, 17.0, 17.0]
[137, 137, 142]
p02729
u194472175
2,000
1,048,576
We have N+M balls, each of which has an integer written on it. It is known that: * The numbers written on N of the balls are even. * The numbers written on M of the balls are odd. Find the number of ways to choose two of the N+M balls (disregarding order) so that the sum of the numbers written on them is even. ...
['N, M = map(int, input().split())\nmethod1 = N*(N-1)/2\nmethod2 = M*(M-1)/2\nmethod=method1+method2\nprint(str(method))\n', 'N, M = map(int, input().split())\nmethod1 = N*(N-1)/2\nmethod2 = M*(M-1)/2\nmethod=method1+method2\nprint(str(round(method)))\n']
['Wrong Answer', 'Accepted']
['s988325623', 's497194449']
[2940.0, 2940.0]
[19.0, 17.0]
[115, 122]
p02729
u194585018
2,000
1,048,576
We have N+M balls, each of which has an integer written on it. It is known that: * The numbers written on N of the balls are even. * The numbers written on M of the balls are odd. Find the number of ways to choose two of the N+M balls (disregarding order) so that the sum of the numbers written on them is even. ...
['even, odd = map(int, input().split())\ns = even * (even -1) / 2\ns += odd * (odd - 1) / 2\nprint(s)\n', 'even, odd = map(int, input().split())\ns = even * (even -1) // 2\ns += odd * (odd - 1) // 2\nprint(s)\n']
['Wrong Answer', 'Accepted']
['s494523981', 's401479446']
[2940.0, 3060.0]
[17.0, 19.0]
[97, 99]
p02729
u195272001
2,000
1,048,576
We have N+M balls, each of which has an integer written on it. It is known that: * The numbers written on N of the balls are even. * The numbers written on M of the balls are odd. Find the number of ways to choose two of the N+M balls (disregarding order) so that the sum of the numbers written on them is even. ...
['a, b = [int(i) for i in input().split()]\nx = 0\nx = a*(a-1)/2+b*(b-1)/2\nprint(x)\n\n', 'a, b = [int(i) for i in input().split()]\nx = 0\nx = a*(a-1)//2+b*(b-1)//2\nprint(x)\n\n']
['Wrong Answer', 'Accepted']
['s696979154', 's482879686']
[2940.0, 2940.0]
[18.0, 17.0]
[82, 84]
p02729
u197922478
2,000
1,048,576
We have N+M balls, each of which has an integer written on it. It is known that: * The numbers written on N of the balls are even. * The numbers written on M of the balls are odd. Find the number of ways to choose two of the N+M balls (disregarding order) so that the sum of the numbers written on them is even. ...
["\ndef main():\n from itertools import product\n\n H,W,K = map(int, input().split())\n S = [list(input()) for _ in range(H)]\n \n i = 0\n while i < len(S):\n if '1' in S[i]:\n i += 1\n else:\n del S[i]\n H = len(S)\n \n S = [[int(s[i]) for s in S] for i in ra...
['Runtime Error', 'Wrong Answer', 'Accepted']
['s026008885', 's484418605', 's221396511']
[3064.0, 2940.0, 2940.0]
[18.0, 17.0, 17.0]
[1274, 212, 106]
p02729
u199120400
2,000
1,048,576
We have N+M balls, each of which has an integer written on it. It is known that: * The numbers written on N of the balls are even. * The numbers written on M of the balls are odd. Find the number of ways to choose two of the N+M balls (disregarding order) so that the sum of the numbers written on them is even. ...
['n = int(input())\nm = int(input())\n\nresult = 0\n\nif n != 0: \n result += n*(n-1)/2\n\nif m != 0:\n result += m*(m-1)/2\n\nprint(result)', 'n, m = map(int, input().split())\n \nresult = 0\n \nif n != 0: \n result += n*(n-1)/2\n \nif m != 0:\n result += m*(m-1)/2\n \nprint(int(result))']
['Runtime Error', 'Accepted']
['s758540639', 's434084325']
[2940.0, 2940.0]
[17.0, 17.0]
[129, 137]