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
p02713
u146575240
2,000
1,048,576
Find \displaystyle{\sum_{a=1}^{K}\sum_{b=1}^{K}\sum_{c=1}^{K} \gcd(a,b,c)}. Here \gcd(a,b,c) denotes the greatest common divisor of a, b, and c.
['#C - Sum of gcd of Tuples (Easy)\nK = int(input())\nsum = 0\n\nimport fractions\ndef N_gcd(ans):\n ans2 = ans[0]\n for n in range(1, 3):\n ans2 = fractions.gcd(ans2, ans[n])\n return ans2\n\nfor i in range(1,K+1):\n for j in range(1,K+1):\n for k in range(1,K+1):\n a = [i,...
['Time Limit Exceeded', 'Accepted']
['s454473960', 's025069258']
[10524.0, 9188.0]
[2206.0, 1540.0]
[353, 410]
p02713
u148753842
2,000
1,048,576
Find \displaystyle{\sum_{a=1}^{K}\sum_{b=1}^{K}\sum_{c=1}^{K} \gcd(a,b,c)}. Here \gcd(a,b,c) denotes the greatest common divisor of a, b, and c.
['import math\nfrom functools import reduce\ndef gcd(*numbers):\n return reduce(math.gcd, numbers)\nN = int(input())\nresult = 0\nfor i in range(1,N+1):\n for j in range(i,N+1):\n for k in range(j,N+1):\n result+=gcd(i,j,k)\nprint(result)', 'import math\nfrom functools import reduce\ndef gcd(*nu...
['Wrong Answer', 'Wrong Answer', 'Accepted']
['s238776305', 's799160262', 's864163013']
[9636.0, 9568.0, 9592.0]
[629.0, 2206.0, 1523.0]
[250, 243, 446]
p02713
u150985282
2,000
1,048,576
Find \displaystyle{\sum_{a=1}^{K}\sum_{b=1}^{K}\sum_{c=1}^{K} \gcd(a,b,c)}. Here \gcd(a,b,c) denotes the greatest common divisor of a, b, and c.
['import math\n\nK = int(input())\nans = 0\nfor i in range(1, K+1):\n for j in range(1, K+1):\n for k in range(1, K+1):\n ans += gcd(gcd(i, j), k)\n\nprint(ans)', 'from math import gcd\n\nK = int(input())\nans = 0\nfor i in range(1, K+1):\n for j in range(1, K+1):\n for k in range(1, K+1):\n ans += gc...
['Runtime Error', 'Accepted']
['s454195333', 's290961725']
[9184.0, 9172.0]
[22.0, 1921.0]
[158, 168]
p02713
u152334204
2,000
1,048,576
Find \displaystyle{\sum_{a=1}^{K}\sum_{b=1}^{K}\sum_{c=1}^{K} \gcd(a,b,c)}. Here \gcd(a,b,c) denotes the greatest common divisor of a, b, and c.
['k = int(input())\nans = 0\nfor a in range(k):\n for b in range(k):\n for c in range(k):\n ans += gcd(gcd(a,b),c)\nprint(ans)\n\ndef gcd(p,q):\n if p % q == 0:\n return q\n return gcd(q, p%q)', 'from math import gcd\n\nk = int(input())\nans = 0\nfor a in range(1,k+1):\n for b in range(1,k+1):\n x = g...
['Runtime Error', 'Accepted']
['s871697862', 's713823784']
[9176.0, 9140.0]
[22.0, 1300.0]
[193, 175]
p02713
u152614052
2,000
1,048,576
Find \displaystyle{\sum_{a=1}^{K}\sum_{b=1}^{K}\sum_{c=1}^{K} \gcd(a,b,c)}. Here \gcd(a,b,c) denotes the greatest common divisor of a, b, and c.
['import math\nans = 0\nn = int(input())\nfor i in range(1,k+1):\n for j in range(1,k+1):\n for k in range(1,k+1):\n ans += math.gcd(i,math.gcd(j,k))\nprint(ans)', 'n = int(input())\nimport math\nans = 0\nn = int(input())\nfor i in range(1,n+1):\n for j in range(1,n+1):\n t = math.gcd(i,j...
['Runtime Error', 'Runtime Error', 'Runtime Error', 'Runtime Error', 'Accepted']
['s042167118', 's330974922', 's543136516', 's899954245', 's130878977']
[9164.0, 9180.0, 9204.0, 9192.0, 9180.0]
[22.0, 22.0, 23.0, 25.0, 1381.0]
[173, 204, 208, 204, 187]
p02713
u156815136
2,000
1,048,576
Find \displaystyle{\sum_{a=1}^{K}\sum_{b=1}^{K}\sum_{c=1}^{K} \gcd(a,b,c)}. Here \gcd(a,b,c) denotes the greatest common divisor of a, b, and c.
['#\n# Written by NoKnowledgeGG @YlePhan\n\n#\n#import math\n#mod = 10**9+7\n#import itertools\n#import fractions\n#import numpy as np\n#mod = 10**4 + 7\n\n\n\n\n\n\n\n\n\n\n\n"""def gcd(a,b):\n if b == 0:\n return a\n return gcd(b, a % b)\ndef lcm(a,b):\n g = gcd(a,b)\n return (a * b) // g"""\n\n\n"""import bis...
['Time Limit Exceeded', 'Time Limit Exceeded', 'Time Limit Exceeded', 'Accepted']
['s119478488', 's241510247', 's589944482', 's628024521']
[10664.0, 10552.0, 10956.0, 9580.0]
[2206.0, 2206.0, 2206.0, 769.0]
[2044, 2088, 2085, 2044]
p02713
u159144188
2,000
1,048,576
Find \displaystyle{\sum_{a=1}^{K}\sum_{b=1}^{K}\sum_{c=1}^{K} \gcd(a,b,c)}. Here \gcd(a,b,c) denotes the greatest common divisor of a, b, and c.
["def gcd(a, b, c):\n import fractions\n lis = [a, b, c]\n gc = lis[0]\n for i in range(0, 3):\n gc = fractions.gcd(gc, lis[i])\n return gc\ndef main():\n K = int(input())\n ans = 0\n for p in range(1, K+1):\n for s in range(p, K+1):\n for k in range(s, K+1):\n if p == s == k:\n ans...
['Time Limit Exceeded', 'Accepted']
['s333288067', 's758124132']
[10648.0, 9060.0]
[2206.0, 1788.0]
[482, 499]
p02713
u161712560
2,000
1,048,576
Find \displaystyle{\sum_{a=1}^{K}\sum_{b=1}^{K}\sum_{c=1}^{K} \gcd(a,b,c)}. Here \gcd(a,b,c) denotes the greatest common divisor of a, b, and c.
['import math\nimport numpy as np\n\nK = int(input())\n\ngcdSum = 0\n\nmyArr = np.zeros((K, K), dtype=int)\n\nfor iIndx in range(K):\n for jIndx in range(K):\n myArr[iIndx, jIndx] = math.gcd(iIndx, jIndx)\n\nfor iIndx in range(K):\n for jIndx in range(K):\n presGcd = myArr[iIndx, jIndx]\n for...
['Wrong Answer', 'Accepted']
['s560320635', 's023908432']
[27168.0, 9156.0]
[2206.0, 82.0]
[380, 753]
p02713
u161868822
2,000
1,048,576
Find \displaystyle{\sum_{a=1}^{K}\sum_{b=1}^{K}\sum_{c=1}^{K} \gcd(a,b,c)}. Here \gcd(a,b,c) denotes the greatest common divisor of a, b, and c.
['import math\nfrom functools import reduce\n\ndef gcd_list(numbers):\n return reduce(math.gcd, numbers)\n\nk = int(input())\ntmp = 0\nfor a range(1, k+1):\n for b range(1, k+1):\n for c range(1, k+1):\n tmp += gcd_list([a, b, c])\nprint(tmp)', "import math\nfrom functools import reduce\n\ndef gcd_list(numb...
['Runtime Error', 'Accepted']
['s502748379', 's178645533']
[9020.0, 9616.0]
[22.0, 945.0]
[240, 995]
p02713
u166621202
2,000
1,048,576
Find \displaystyle{\sum_{a=1}^{K}\sum_{b=1}^{K}\sum_{c=1}^{K} \gcd(a,b,c)}. Here \gcd(a,b,c) denotes the greatest common divisor of a, b, and c.
['from math import math\n\nK = int(input())\ncnt = 0\n\nfor i in range(1,K+1):\n for j in range(1,K+1):\n for k in range(1,K+1):\n cnt += gcd(gcd(i,j),k)\nprint(cnt)', 'from math import gcd\n\nK = int(input())\ncnt = 0\n\nfor i in range(1,K+1):\n for j in range(1,K+1):\n for k in range(1,...
['Runtime Error', 'Accepted']
['s665812872', 's932824690']
[9092.0, 9044.0]
[23.0, 1936.0]
[175, 174]
p02713
u167206842
2,000
1,048,576
Find \displaystyle{\sum_{a=1}^{K}\sum_{b=1}^{K}\sum_{c=1}^{K} \gcd(a,b,c)}. Here \gcd(a,b,c) denotes the greatest common divisor of a, b, and c.
['import math\nimport numpy\nK = int(input())\n\ntotal = 0\ntmp =0\n for a in range(1,K+1) :\n for b in range(1,K+1) :\n tmp=math.gcd(a,b)\n for c in range(1,K+1) :\n total += math.gcd(tmp,c)\n\nprint(total)\n', 'import math\nimport numpy\nK = int(input())\n\ntotal = tmp = 0\nfor a in ran...
['Runtime Error', 'Accepted']
['s374138629', 's805975123']
[9016.0, 27088.0]
[22.0, 1496.0]
[225, 202]
p02713
u167360450
2,000
1,048,576
Find \displaystyle{\sum_{a=1}^{K}\sum_{b=1}^{K}\sum_{c=1}^{K} \gcd(a,b,c)}. Here \gcd(a,b,c) denotes the greatest common divisor of a, b, and c.
['import math\nk = int(input())+1\nfor i in range(1, k):\n for j in range(1, k):\n temp = math.gcd(i, j)\n for x in range(1, k):\n sum += math.gcd(temp, x)\n\n\nprint(sum)', 'import math\nfor i in range(1, k):\n for j in range(1, k):\n temp = math.gcd(i, j)\n for x in range(...
['Runtime Error', 'Runtime Error', 'Time Limit Exceeded', 'Runtime Error', 'Runtime Error', 'Accepted']
['s001894664', 's102884050', 's428206685', 's448899958', 's648425382', 's050526146']
[9184.0, 9096.0, 8956.0, 9116.0, 9176.0, 9180.0]
[22.0, 22.0, 2205.0, 23.0, 22.0, 1346.0]
[188, 167, 219, 188, 186, 194]
p02713
u167681750
2,000
1,048,576
Find \displaystyle{\sum_{a=1}^{K}\sum_{b=1}^{K}\sum_{c=1}^{K} \gcd(a,b,c)}. Here \gcd(a,b,c) denotes the greatest common divisor of a, b, and c.
['import math\nfrom functools import reduce\ndef gcd(*numbers):\n return reduce(math.gcd, numbers)\n\nk = int(input())\n\ncount = 0\nfrom itertools import product\nfor a in range(1, k+1):\n for b in range(a, k+1):\n for c in range(b, k+1):\n count += gcd(a, b, c)\n\nprint(count)', 'import math\n...
['Wrong Answer', 'Accepted']
['s348117561', 's798246130']
[9664.0, 9628.0]
[639.0, 1187.0]
[287, 387]
p02713
u169165784
2,000
1,048,576
Find \displaystyle{\sum_{a=1}^{K}\sum_{b=1}^{K}\sum_{c=1}^{K} \gcd(a,b,c)}. Here \gcd(a,b,c) denotes the greatest common divisor of a, b, and c.
['import numpy\n\nL = int(input())\nprint(numpy.sum([math.gcd(math.gcd(i + 1, j + 1), k + 1) for i in range(L) for j in range(L) for k in range(L)]))', 'import numpy\nimport math\n\nL = int(input())\nans = 0\nfor i in range(L):\n for j in range(L):\n t = math.gcd(i+1, j+1)\n for k in range(L):\n ...
['Runtime Error', 'Accepted']
['s819990627', 's901181895']
[27180.0, 27020.0]
[104.0, 1568.0]
[144, 199]
p02713
u169350228
2,000
1,048,576
Find \displaystyle{\sum_{a=1}^{K}\sum_{b=1}^{K}\sum_{c=1}^{K} \gcd(a,b,c)}. Here \gcd(a,b,c) denotes the greatest common divisor of a, b, and c.
['import math\nk = int(input())\nsum = 0\n\ndef gcd(a,b,c):\n ab = math.gcd(a,b)\n return math.gcd(ab,c)\n\nfor i in range(k):\n for j in range(k):\n for l in range(k):\n sum += gcd(i,j,l)\n\nprint(sum)\n', 'import math\nk = int(input())\nsum = 0\n\ndef gcd(a,b,c):\n return(math.gcd(math.g...
['Wrong Answer', 'Accepted']
['s625598635', 's420768058']
[9184.0, 9080.0]
[2205.0, 708.0]
[215, 364]
p02713
u172780602
2,000
1,048,576
Find \displaystyle{\sum_{a=1}^{K}\sum_{b=1}^{K}\sum_{c=1}^{K} \gcd(a,b,c)}. Here \gcd(a,b,c) denotes the greatest common divisor of a, b, and c.
['import fractions\nimport itertools\n\nk=int(input())\ntot=0\nfor l,m,n in itertools.product(range(1,k+1),range(1,k+1),range(1,k+1)):\n ans=fractions.gcd(m,l%m)\n ans=fractions.gcd(ans,n)\n tot+=ans\nprint(tot)', 'import fractions\n\nk=int(input())\ntot=0\n\nfor i in range(1,k+1):\n for j in range(1,k+1):\...
['Time Limit Exceeded', 'Time Limit Exceeded', 'Time Limit Exceeded', 'Time Limit Exceeded', 'Accepted']
['s530977650', 's722365989', 's749882694', 's968261866', 's917189626']
[10584.0, 10636.0, 10612.0, 10620.0, 9184.0]
[2206.0, 2206.0, 2206.0, 2206.0, 1682.0]
[209, 244, 256, 219, 207]
p02713
u174766008
2,000
1,048,576
Find \displaystyle{\sum_{a=1}^{K}\sum_{b=1}^{K}\sum_{c=1}^{K} \gcd(a,b,c)}. Here \gcd(a,b,c) denotes the greatest common divisor of a, b, and c.
['import math\nfrom functools import reduce\nk = int(input())\nl = [a,b,c]\ngcd = []\ndef gcd_list(numbers):\n return reduce(math.gcd, numbers)\nfor l[0] in range(1,k+1):\n for l[1] in range(1,k+1):\n for l[2] in range(1,k+1):\n gcd.append(gcd_list(l))\nprint(sum(gcd))', 'import math\nans = 0\nk...
['Runtime Error', 'Accepted']
['s504424667', 's056565141']
[9520.0, 9080.0]
[23.0, 1394.0]
[280, 191]
p02713
u175746978
2,000
1,048,576
Find \displaystyle{\sum_{a=1}^{K}\sum_{b=1}^{K}\sum_{c=1}^{K} \gcd(a,b,c)}. Here \gcd(a,b,c) denotes the greatest common divisor of a, b, and c.
['form math import gcd\nnum = (int)(input())\ntotal = 0\n \nfor i in range(1, num + 1):\n for j in range(1, num + 1):\n sub = gcd(i, j)\n for k in range(1, num + 1):\n total += gcd(sub, k)\nprint(total)', 'from math import gcd\nnum = (int)(input())\ntotal = 0\n \nfor i in range(1, num + 1):\n for j in rang...
['Runtime Error', 'Runtime Error', 'Accepted']
['s150529027', 's913463655', 's722223623']
[8952.0, 9184.0, 9176.0]
[21.0, 21.0, 1223.0]
[203, 213, 204]
p02713
u181295070
2,000
1,048,576
Find \displaystyle{\sum_{a=1}^{K}\sum_{b=1}^{K}\sum_{c=1}^{K} \gcd(a,b,c)}. Here \gcd(a,b,c) denotes the greatest common divisor of a, b, and c.
['import itertools\n\ndef gcd(a, b):\n while b:\n a, b = b, a % b\n return a\n\ndef gcd_3(a,b,c):\n a = gcd(gcd(a,b),c)\n return a\n\nk = int(input())\nans = 0\n\nnum = list(itertools.combinations_with_replacement(range(1,k+1),3))\nprint(num)\nfor l in num:\n a,b,c = l\n if a==b==c:\n an...
['Wrong Answer', 'Accepted']
['s795496888', 's846113386']
[160800.0, 105372.0]
[1673.0, 1184.0]
[404, 394]
p02713
u185405877
2,000
1,048,576
Find \displaystyle{\sum_{a=1}^{K}\sum_{b=1}^{K}\sum_{c=1}^{K} \gcd(a,b,c)}. Here \gcd(a,b,c) denotes the greatest common divisor of a, b, and c.
['import math\nfrom functools import reduce\n\nans=0\ndef gcd(*numbers):\n return reduce(math.gcd, numbers)\n\ndef gcd_list(numbers):\n return reduce(math.gcd, numbers)\n\nn=int(input())\nfor i in range(n+1):\n for j in range(n+1):\n for k in range(n+1):\n ans+=gcd(i,j,k)\nprint(ans)', 'from ...
['Wrong Answer', 'Wrong Answer', 'Accepted']
['s009399923', 's239156475', 's237736520']
[9636.0, 9168.0, 9184.0]
[2205.0, 1287.0, 1131.0]
[294, 182, 207]
p02713
u189056821
2,000
1,048,576
Find \displaystyle{\sum_{a=1}^{K}\sum_{b=1}^{K}\sum_{c=1}^{K} \gcd(a,b,c)}. Here \gcd(a,b,c) denotes the greatest common divisor of a, b, and c.
['import math\nimport numpy as np\nimport itertools\n\nfor l, m, n in itertools.product(range(k), range(k), range(k))\n\nk = int(input())\ntot = 0\n\n\ng = np.array([[-1] * (k + 1)] * (k + 1), dtype=np.int64)\n\nfor l in range(1, k + 1):\n for m in range(1, k + 1):\n for n in range(1, k + 1):\n if ...
['Runtime Error', 'Wrong Answer', 'Accepted']
['s264310245', 's450667241', 's336537103']
[9020.0, 27140.0, 9048.0]
[22.0, 2206.0, 1896.0]
[602, 457, 186]
p02713
u193264896
2,000
1,048,576
Find \displaystyle{\sum_{a=1}^{K}\sum_{b=1}^{K}\sum_{c=1}^{K} \gcd(a,b,c)}. Here \gcd(a,b,c) denotes the greatest common divisor of a, b, and c.
["from scipy.sparse.csgraph import shortest_path, floyd_warshall, dijkstra, bellman_ford, johnson, minimum_spanning_tree\nfrom scipy.sparse import csr_matrix, coo_matrix, lil_matrix\nimport numpy as np\nfrom collections import deque, Counter, defaultdict\nfrom itertools import product, permutations,combinations\nfrom o...
['Time Limit Exceeded', 'Time Limit Exceeded', 'Wrong Answer', 'Accepted']
['s035226668', 's241977166', 's829601470', 's170802558']
[37720.0, 10696.0, 37496.0, 9188.0]
[2206.0, 2205.0, 2207.0, 226.0]
[1207, 751, 1135, 367]
p02713
u195355592
2,000
1,048,576
Find \displaystyle{\sum_{a=1}^{K}\sum_{b=1}^{K}\sum_{c=1}^{K} \gcd(a,b,c)}. Here \gcd(a,b,c) denotes the greatest common divisor of a, b, and c.
['import math\n\ngcd_sum = 0\n\nfor a in range(1,201):\n for b in range(1,201):\n ab = math.gcd(a,b)\n for c in range(1,201):\n gcd_sum += math.gcd(ab,c) \n\nprint(gcd_sum)', 'K = int(input())\n\nimport math\n \ngcd_sum = 0\n \nfor a in range(1,K + 1):\n for b in range(1,K + 1):\n ...
['Wrong Answer', 'Accepted']
['s630151327', 's467126460']
[9104.0, 9184.0]
[1499.0, 1378.0]
[194, 221]
p02713
u197610362
2,000
1,048,576
Find \displaystyle{\sum_{a=1}^{K}\sum_{b=1}^{K}\sum_{c=1}^{K} \gcd(a,b,c)}. Here \gcd(a,b,c) denotes the greatest common divisor of a, b, and c.
['k = int(input())\n\nans = [1,10,40,116,257,524,924,1548,2433,3682,5272,7480,10169,13580,17828,23076,29157,36642,45172,55420,67309,80996,96224,114212,134265,156834,182076,210664,241717,277180,315464,358004,404585,455478,510840,572664,638521,709768,786652,871040,960389,1058270,1161612,1273140,1393281,1521328,1655908,18...
['Wrong Answer', 'Accepted']
['s261634147', 's760040486']
[9384.0, 9384.0]
[22.0, 23.0]
[1751, 1682]
p02713
u197921942
2,000
1,048,576
Find \displaystyle{\sum_{a=1}^{K}\sum_{b=1}^{K}\sum_{c=1}^{K} \gcd(a,b,c)}. Here \gcd(a,b,c) denotes the greatest common divisor of a, b, and c.
['def gcd(a, b):\n if a % b == 0:\n return b\n return gcd(b, a % b)\n\n\nk = int(input())\n\nsum = 0\n\n# gcd(a,a,a)\nsum += int((1+k)*k/2)\n\n# gcd(a,b,b)\nif k >= 2:\n for i in range(1, k+1):\n for j in range(1, k+1):\n sum += gcd(i, j)*3\n\n# gcd(a,b,c)\nif k >= 3:\n for i in ran...
['Wrong Answer', 'Wrong Answer', 'Accepted']
['s277463878', 's540538038', 's350957953']
[9144.0, 9172.0, 9148.0]
[1122.0, 1092.0, 1075.0]
[435, 433, 433]
p02713
u202400119
2,000
1,048,576
Find \displaystyle{\sum_{a=1}^{K}\sum_{b=1}^{K}\sum_{c=1}^{K} \gcd(a,b,c)}. Here \gcd(a,b,c) denotes the greatest common divisor of a, b, and c.
['from fractions import gcd\n\ndef main():\n n = int(input())\n\n t = 0\n for i in range(1, n+1):\n for j in range(1, n+1):\n for k in range(1, n+1):\n ans = gcd(i, gcd(j, k))\n t += ans\n\n print(t)\n\nif __name__ == "__main__":\n main()', 'import fraction...
['Time Limit Exceeded', 'Time Limit Exceeded', 'Accepted']
['s099611343', 's137818540', 's726690748']
[10496.0, 10592.0, 9192.0]
[2206.0, 2206.0, 1493.0]
[284, 256, 279]
p02713
u202577948
2,000
1,048,576
Find \displaystyle{\sum_{a=1}^{K}\sum_{b=1}^{K}\sum_{c=1}^{K} \gcd(a,b,c)}. Here \gcd(a,b,c) denotes the greatest common divisor of a, b, and c.
['from itertools import product\nN = (input())\nd = 0\nres = [ele for ele in product(range(1,N+1),repeat=3)]\na =(res)\nfor i in a:\n if i[0]==i[1]==i[2]:\n d = d+i[0]\n else:\n d = d+1\nprint(d)\n', "import itertools\ndef all_passwords(chars,length):\n b = []\n c= 0\n for i in itertools.pr...
['Runtime Error', 'Runtime Error', 'Accepted']
['s447442261', 's862578396', 's392831832']
[9016.0, 9004.0, 8984.0]
[21.0, 25.0, 1632.0]
[204, 213, 199]
p02713
u202634017
2,000
1,048,576
Find \displaystyle{\sum_{a=1}^{K}\sum_{b=1}^{K}\sum_{c=1}^{K} \gcd(a,b,c)}. Here \gcd(a,b,c) denotes the greatest common divisor of a, b, and c.
['from math import gcd\nk = int(input())\ngcdl = [[0 for i in range(k + 1)]for i in range(k+1)]\nfor i in range(1, k + 1):\n for j in range(1, k + 1):\n gcdl[i][j] = gcd(i, j)\ns = 0\nfor i in range(1, k + 1):\n for j in range(1, k + 1):\n for l in range(1, k + 1):\n s += gcdl[i][gcdl[j][...
['Wrong Answer', 'Accepted']
['s601476430', 's041069925']
[9480.0, 9416.0]
[1347.0, 1359.0]
[322, 325]
p02713
u203669169
2,000
1,048,576
Find \displaystyle{\sum_{a=1}^{K}\sum_{b=1}^{K}\sum_{c=1}^{K} \gcd(a,b,c)}. Here \gcd(a,b,c) denotes the greatest common divisor of a, b, and c.
['#! /usr/bin/env python3\n\nfrom fractions import gcd\nfrom collections import Counter, deque, defaultdict\nfrom heapq import heappush, heappop, heappushpop, heapify, heapreplace, merge\nfrom bisect import bisect_left, bisect_right, bisect, insort_left, insort_right, insort\nfrom itertools import accumulate, product, ...
['Time Limit Exceeded', 'Time Limit Exceeded', 'Accepted']
['s313933851', 's338629119', 's363877032']
[10676.0, 10700.0, 9184.0]
[2206.0, 2206.0, 1211.0]
[540, 540, 190]
p02713
u204208382
2,000
1,048,576
Find \displaystyle{\sum_{a=1}^{K}\sum_{b=1}^{K}\sum_{c=1}^{K} \gcd(a,b,c)}. Here \gcd(a,b,c) denotes the greatest common divisor of a, b, and c.
['import numpy as np\n\nk = input()\nsum = 0\nfor p in range(k):\n for q in range(k):\n for r in range(k):\n sum += np.gcd.reduce([i,j,k])\n\nprint(sum)', 'import math\n\nk = int(input())\nsum = 0\ngcds = [[0 for i in range(k)] for i in range(k)]\nfor p in range(1,k+1):\n for q in range(1,k+1): ...
['Runtime Error', 'Accepted']
['s113012235', 's729176127']
[27112.0, 9476.0]
[104.0, 1929.0]
[162, 292]
p02713
u205303316
2,000
1,048,576
Find \displaystyle{\sum_{a=1}^{K}\sum_{b=1}^{K}\sum_{c=1}^{K} \gcd(a,b,c)}. Here \gcd(a,b,c) denotes the greatest common divisor of a, b, and c.
['import fractions\nK=int(input())\nans=0\nA=0\n\nfor n in range(1,K+1):\n for m in range(1,K+1):\n gcd1=fractions.gcd(n,m)\n for l in range(1,K+1):\n A=fractions.gcd(gcd1,l) \n ans+=A\nprint(ans)', '\nimport fractions\nK=int(input())\nans=0\n\nfor n in range(1,K+1):\n for m in range...
['Time Limit Exceeded', 'Time Limit Exceeded', 'Time Limit Exceeded', 'Time Limit Exceeded', 'Time Limit Exceeded', 'Accepted']
['s102880216', 's240501489', 's348717699', 's386908605', 's604581711', 's068322372']
[10620.0, 10524.0, 10680.0, 10556.0, 10588.0, 9200.0]
[2206.0, 2205.0, 2205.0, 2206.0, 2206.0, 1517.0]
[216, 242, 237, 201, 241, 219]
p02713
u210828934
2,000
1,048,576
Find \displaystyle{\sum_{a=1}^{K}\sum_{b=1}^{K}\sum_{c=1}^{K} \gcd(a,b,c)}. Here \gcd(a,b,c) denotes the greatest common divisor of a, b, and c.
['import math\nimport itertools\nimport numpy as np\ndef is_prime(q):\n q = abs(q)\n if q == 2: return True\n if q < 2 or q&1 == 0: return False\n return pow(2, q-1, q) == 1\nlist2 = []\nresult = 0\nn = int(input())\nfor i in range(1,n+1):\n if(not(is_prime(i))):\n for j in range(1,n+1):\n ...
['Runtime Error', 'Accepted']
['s968011740', 's470423186']
[8996.0, 9168.0]
[20.0, 1939.0]
[570, 160]
p02713
u212328220
2,000
1,048,576
Find \displaystyle{\sum_{a=1}^{K}\sum_{b=1}^{K}\sum_{c=1}^{K} \gcd(a,b,c)}. Here \gcd(a,b,c) denotes the greatest common divisor of a, b, and c.
['import math\nfrom functools import reduce\n\n\ndef gcd(*numbers):\n return reduce(math.gcd, numbers)\n\n\nk = int(input()) + 1\n\ncount = 0\nfor a in range(1, k):\n for b in range(2, k):\n for c in range(2, k):\n count += gcd(a, b, c)\nprint(count)\n', 'from math import gcd \n\nnum = int(input...
['Wrong Answer', 'Accepted']
['s430741104', 's652807513']
[9628.0, 9200.0]
[2205.0, 1238.0]
[258, 210]
p02713
u214811259
2,000
1,048,576
Find \displaystyle{\sum_{a=1}^{K}\sum_{b=1}^{K}\sum_{c=1}^{K} \gcd(a,b,c)}. Here \gcd(a,b,c) denotes the greatest common divisor of a, b, and c.
['K=int(input())\nans=0\nfor a in range(1,K):\n for b in range(1,K):\n for c in range(1,K):\n n=math.gcd(a,b,c)\n ans=ans+n\n\nprint(ans)', 'import math\nK=int(input())\nk=K+1\nans=0\nfor a in range(k):\n for b in range(k):\n for c in range(k):\n m=math.gcd(a,b)\n ...
['Runtime Error', 'Wrong Answer', 'Runtime Error', 'Accepted']
['s490694484', 's685465628', 's950777785', 's812074367']
[9180.0, 9120.0, 9180.0, 9196.0]
[25.0, 2205.0, 23.0, 689.0]
[159, 194, 171, 360]
p02713
u215341636
2,000
1,048,576
Find \displaystyle{\sum_{a=1}^{K}\sum_{b=1}^{K}\sum_{c=1}^{K} \gcd(a,b,c)}. Here \gcd(a,b,c) denotes the greatest common divisor of a, b, and c.
['import math\nfrom functools import reduce\n\nk = int(input())\nsum = 0\n\nfor a in range(0, k + 1):\n for b in range(0, k + 1):\n d = math.gcd(a, b)\n for c in range(0, k + 1):\n sum += math.gcd(d, c)\n\nprint(sum)', 'from math import gcd\n\nk = int(input())\nnum = 0\n\nfor a in range(0, k + 1):\n for b ...
['Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Accepted']
['s047867751', 's174471106', 's402777304', 's532961934', 's936499369', 's662814105']
[9492.0, 9068.0, 9560.0, 9496.0, 9172.0, 9172.0]
[1463.0, 755.0, 2205.0, 34.0, 1390.0, 742.0]
[214, 182, 266, 234, 185, 182]
p02713
u218487926
2,000
1,048,576
Find \displaystyle{\sum_{a=1}^{K}\sum_{b=1}^{K}\sum_{c=1}^{K} \gcd(a,b,c)}. Here \gcd(a,b,c) denotes the greatest common divisor of a, b, and c.
['from math import gcd\nk = int(input())+1\nn = 0\nfor i in range(1,k):\n for j in range(i,k):\n for l in range(j, k):\n if i == j == l:\n print([i, j, l])\n print(gcd(i,gcd(j,l)))\n n += gcd(i,gcd(j,l))\n elif i == j or j == l or l == i:\n print([i,j,l])\n print(gcd(i,g...
['Wrong Answer', 'Accepted']
['s296631872', 's449341366']
[24936.0, 9196.0]
[2083.0, 599.0]
[456, 288]
p02713
u218506594
2,000
1,048,576
Find \displaystyle{\sum_{a=1}^{K}\sum_{b=1}^{K}\sum_{c=1}^{K} \gcd(a,b,c)}. Here \gcd(a,b,c) denotes the greatest common divisor of a, b, and c.
['import math\n\nk = int(input())\nfor i in range(1,k+1):\n for j in range(1,k+1):\n for l in range(1,k+1):\n m = math.gcd(i,j)\n ans += math.gcd(m,l)\n\nprint(ans)', 'import math\n\nk = int(input())\nans = 0\nm = 0\nfor a in range(1,k+1):\n for b in range(a+1,k+1):\n for c in ...
['Runtime Error', 'Accepted']
['s335199908', 's213980002']
[9180.0, 9224.0]
[23.0, 455.0]
[185, 407]
p02713
u221537793
2,000
1,048,576
Find \displaystyle{\sum_{a=1}^{K}\sum_{b=1}^{K}\sum_{c=1}^{K} \gcd(a,b,c)}. Here \gcd(a,b,c) denotes the greatest common divisor of a, b, and c.
['K = int(input())\nimport math\nimport itertools\n\n\ndef better_gcd(a,b,c):\n tup = set((a,b,c))\n kinds = len(tup)\n if kinds == 3:\n return math.gcd(a, math.gcd(b, c)) * 6\n elif kinds == 2:\n return math.gcd(*tup) * 3\n else:\n return a\n\nans = 0\ncands = list(itertools.combina...
['Wrong Answer', 'Wrong Answer', 'Runtime Error', 'Accepted']
['s177086755', 's276940135', 's877076841', 's188910504']
[105576.0, 105668.0, 8984.0, 105340.0]
[1069.0, 1020.0, 24.0, 1026.0]
[395, 393, 358, 394]
p02713
u224119985
2,000
1,048,576
Find \displaystyle{\sum_{a=1}^{K}\sum_{b=1}^{K}\sum_{c=1}^{K} \gcd(a,b,c)}. Here \gcd(a,b,c) denotes the greatest common divisor of a, b, and c.
['k=input()\nsumk=0\nfor i in range (1,k+1):\n for a in range(1,k+1):\n for b in range(1,k+1):\n for c in range(1,k+1):\n gcd=1\n m=min(a,b,c)\n for x in range(1,m+1):\n if (a%x==0 and b%x==0 and c%x==0):\n gcd=x...
['Runtime Error', 'Wrong Answer', 'Accepted']
['s671600003', 's830441581', 's263146078']
[9144.0, 9208.0, 9064.0]
[23.0, 2205.0, 1407.0]
[416, 421, 186]
p02713
u225850197
2,000
1,048,576
Find \displaystyle{\sum_{a=1}^{K}\sum_{b=1}^{K}\sum_{c=1}^{K} \gcd(a,b,c)}. Here \gcd(a,b,c) denotes the greatest common divisor of a, b, and c.
['import fractions\n\nk = int(input())\nans = 0\n\nfor a in range(1, k+1):\n for b in range(1, k+1):\n for c in range(1, k+1):\n ans += fractions.gcd(fractions.gcd(a, b), c)\n\nprint(ans)', 'import fractions\n \nk = int(input())\nans = 0\n \nfor a in range(1, k+1):\n for b in range(1, k+1):\n ...
['Time Limit Exceeded', 'Time Limit Exceeded', 'Accepted']
['s149296557', 's165975715', 's232626072']
[10676.0, 10612.0, 9132.0]
[2206.0, 2205.0, 1403.0]
[196, 217, 201]
p02713
u227082700
2,000
1,048,576
Find \displaystyle{\sum_{a=1}^{K}\sum_{b=1}^{K}\sum_{c=1}^{K} \gcd(a,b,c)}. Here \gcd(a,b,c) denotes the greatest common divisor of a, b, and c.
['from math import gcd\ng=[201*[0]for _ in range(201)]\nfor i in range(1,201):\n for j in range(i,201):\n g[i][j]=gcd(i,j)\nans=0\nfor i in range(1,201):\n for j in range(1,201):\n for k in range(1,201):\n m=g[min(i,j)][max(i,j)]\n ans+=g[min(k,m)][max(k,m)]\nprint(ans)', 'from math import gcd\ng=[201*[0]...
['Runtime Error', 'Wrong Answer', 'Time Limit Exceeded', 'Accepted']
['s432633234', 's686201498', 's906932098', 's475800350']
[8984.0, 9304.0, 9288.0, 9136.0]
[22.0, 1341.0, 2205.0, 1609.0]
[271, 355, 276, 186]
p02713
u229429359
2,000
1,048,576
Find \displaystyle{\sum_{a=1}^{K}\sum_{b=1}^{K}\sum_{c=1}^{K} \gcd(a,b,c)}. Here \gcd(a,b,c) denotes the greatest common divisor of a, b, and c.
['import math\nK = int(input())\ns = 0\nfor a in range(1,K+1):\n for b in range(1,K+1):\n x = math.gcd(a,b)\n for c in range(1,K+1):\n s += gcd(x,c)\nprint(s)', 'import math\nK = int(input())\ns = 0\nfor a in range(1,K+1):\n for b in range(1,K+1):\n x = math.gcd(a,b)\n for c in range(1,K+1):\n s...
['Runtime Error', 'Accepted']
['s365072817', 's077114443']
[9172.0, 9172.0]
[21.0, 1373.0]
[160, 166]
p02713
u234582536
2,000
1,048,576
Find \displaystyle{\sum_{a=1}^{K}\sum_{b=1}^{K}\sum_{c=1}^{K} \gcd(a,b,c)}. Here \gcd(a,b,c) denotes the greatest common divisor of a, b, and c.
['k = int(input())\nsum=0\nfor a in range(1,k+1):\n for b in range(1,k+1):\n g1 = math.gcd(a,b)\n for c in range(1,k+1):\n sum += math.gcd(g1,c)\nprint(sum)', 'mod = 10**9 + 7\nimport math \nfrom bisect import bisect_left \nfrom collections import Counter\nfrom itertools import combinations\...
['Runtime Error', 'Accepted']
['s969450387', 's679791774']
[9208.0, 9480.0]
[20.0, 1359.0]
[175, 548]
p02713
u235376569
2,000
1,048,576
Find \displaystyle{\sum_{a=1}^{K}\sum_{b=1}^{K}\sum_{c=1}^{K} \gcd(a,b,c)}. Here \gcd(a,b,c) denotes the greatest common divisor of a, b, and c.
['N=int(input())\nS=input()\nans=S.count("R")*S.count("G")*S.count("B")\n \nfor i in range(N):\n for j in range(i+1,N):\n k=j+(j-i)\n if N-1<k:\n break\n \n if S[j]!=S[i] and S[j]!=S[k] and S[k]!=S[i]:\n ans-=1\n \nprint(ans)', 'from math import gcd\nK=int(input())\n\nresult=[]\ncount=0\ncn...
['Runtime Error', 'Accepted']
['s265782893', 's583481377']
[9196.0, 9172.0]
[20.0, 1984.0]
[239, 181]
p02713
u241544828
2,000
1,048,576
Find \displaystyle{\sum_{a=1}^{K}\sum_{b=1}^{K}\sum_{c=1}^{K} \gcd(a,b,c)}. Here \gcd(a,b,c) denotes the greatest common divisor of a, b, and c.
['N = int(input())\nsum=0\nimport math\nfor i in range(N):\n for j in range(N):\n t=gcd(i+1,j+1)\n for k in range(N):\n sum =sum + gcd(t, k+1)\nprint(sum)\n', 'N = int(input())\nsum=0\nimport math\nfrom functools import reduce\ndef gcd(*numbers):\n return reduce(math.gcd, numbers)\nfrom itertoo...
['Runtime Error', 'Runtime Error', 'Wrong Answer', 'Accepted']
['s347004690', 's833806706', 's835877834', 's189290639']
[9172.0, 9572.0, 9636.0, 9176.0]
[23.0, 26.0, 2205.0, 1403.0]
[167, 220, 252, 176]
p02713
u243128461
2,000
1,048,576
Find \displaystyle{\sum_{a=1}^{K}\sum_{b=1}^{K}\sum_{c=1}^{K} \gcd(a,b,c)}. Here \gcd(a,b,c) denotes the greatest common divisor of a, b, and c.
['from itertools import product\n\ndef gcb(a, b):\n if b == 0:\n return a\n return gcb(b, a % b)\n\ndef gcb_3(a, b, c):\n return gcb(gcb(a, b), gcb(b, c))\n\nk = int(input())\nres = 0\nl_k = range(1, k+1)\nfor part in itertools.product(l_k, l_k, l_k):\n res += gcb_3(part[0], part[1], part[2])\nprint(...
['Runtime Error', 'Runtime Error', 'Runtime Error', 'Runtime Error', 'Accepted']
['s131095240', 's311979332', 's466160696', 's693921470', 's704384774']
[9204.0, 9532.0, 9012.0, 9560.0, 9384.0]
[20.0, 47.0, 22.0, 40.0, 938.0]
[307, 658, 633, 632, 612]
p02713
u244423127
2,000
1,048,576
Find \displaystyle{\sum_{a=1}^{K}\sum_{b=1}^{K}\sum_{c=1}^{K} \gcd(a,b,c)}. Here \gcd(a,b,c) denotes the greatest common divisor of a, b, and c.
['x = np.arange(1, K + 1)\nnums = np.gcd.outer(np.gcd.outer(x, x), x)', 'import numpy as np\n \nK=int(input())\n \nx = np.arange(1, K + 1)\nnums = np.gcd.outer(np.gcd.outer(x, x), x)\nprint(nums.sum())']
['Runtime Error', 'Accepted']
['s595527178', 's120497230']
[9036.0, 89512.0]
[20.0, 215.0]
[66, 122]
p02713
u244466744
2,000
1,048,576
Find \displaystyle{\sum_{a=1}^{K}\sum_{b=1}^{K}\sum_{c=1}^{K} \gcd(a,b,c)}. Here \gcd(a,b,c) denotes the greatest common divisor of a, b, and c.
['import math\n\nK = int(input())\nsum = 0\n\nfor i in (1, K + 1):\n for j in range(1, K + 1):\n a = math.gcd(i, j)\n for k in range(1, K + 1):\n sum += math.gcd(a, k)\n \nprint(sum)\n', 'import math\n\nK = int(input())\nsum = 0\n\nfor i in (1, K + 1):\n for j in range(1, K + 1):\n tmp = math.gcd(i...
['Wrong Answer', 'Wrong Answer', 'Runtime Error', 'Wrong Answer', 'Wrong Answer', 'Accepted']
['s013295906', 's129070279', 's178278424', 's214294045', 's459988609', 's701405111']
[8924.0, 9012.0, 8988.0, 9068.0, 9112.0, 9156.0]
[43.0, 43.0, 28.0, 41.0, 29.0, 1285.0]
[187, 191, 166, 187, 247, 196]
p02713
u245960901
2,000
1,048,576
Find \displaystyle{\sum_{a=1}^{K}\sum_{b=1}^{K}\sum_{c=1}^{K} \gcd(a,b,c)}. Here \gcd(a,b,c) denotes the greatest common divisor of a, b, and c.
['s = input()\nk = int(s)\nn = 3\nans={}\nfor i in reversed(range(1, k+1)):\n ans[i]=math.floor(k/i)**n\n l=2\n j=i*l\n while j<=k:\n ans[i]=ans[i]-ans[j]\n l +=1\n j = i*l\nres=0\nfor i in ans:\n res+=i*ans[i]\nprint(res)', 's = input().split()\nk = int(s[0])\nn = 3\nans={}\nfor i i...
['Runtime Error', 'Runtime Error', 'Runtime Error', 'Runtime Error', 'Accepted']
['s209041132', 's314846666', 's547048297', 's833711079', 's554027283']
[9196.0, 9180.0, 9036.0, 9204.0, 9216.0]
[24.0, 23.0, 22.0, 22.0, 22.0]
[241, 252, 241, 288, 253]
p02713
u247211039
2,000
1,048,576
Find \displaystyle{\sum_{a=1}^{K}\sum_{b=1}^{K}\sum_{c=1}^{K} \gcd(a,b,c)}. Here \gcd(a,b,c) denotes the greatest common divisor of a, b, and c.
['K=int(input())\nans=0\n \nimport math\n \nfor i in range(1,K+1):\n for j in range(1,K+1):\n x = math.gcd(i,j)\n for k in range(1,K+1):\n ans += math.gcd(x,j)\n\nprint(ans)', 'K=int(input())\nans=0\n \nimport math\n \nfor i in range(1,K+1):\n for j in range(1,K+1):\n x = math.gcd(i,j)\n for k in ran...
['Wrong Answer', 'Accepted']
['s436184108', 's193580041']
[9076.0, 9124.0]
[1334.0, 1444.0]
[172, 172]
p02713
u252828980
2,000
1,048,576
Find \displaystyle{\sum_{a=1}^{K}\sum_{b=1}^{K}\sum_{c=1}^{K} \gcd(a,b,c)}. Here \gcd(a,b,c) denotes the greatest common divisor of a, b, and c.
['k = int(input())\nk = [int(x)+1 for x in range(k)]\n#print(k)\nfrom fractions import gcd\nfrom itertools import product,combinations\nfrom functools import reduce\nnum = 0\n\nfor v in product(k,repeat =3):\n v = (list(v))\n \n a = reduce(gcd,v)\n num +=a\n #print(v,num)\nprint(num)', 'k = int(input())\...
['Time Limit Exceeded', 'Accepted']
['s749002252', 's012877636']
[10748.0, 9184.0]
[2206.0, 1588.0]
[283, 205]
p02713
u252964975
2,000
1,048,576
Find \displaystyle{\sum_{a=1}^{K}\sum_{b=1}^{K}\sum_{c=1}^{K} \gcd(a,b,c)}. Here \gcd(a,b,c) denotes the greatest common divisor of a, b, and c.
['import fractions\nK=int(input())\ntotal = 0\n\nfor a in range(K):\n for b in range(a,K):\n for c in range(b,K):\n total += fractsion.gcd(a+1, fractions.gcd(b+1,c+1) )\ntotal *= 6\n\nfor a in range(K):\n for b in range(a,K):\n total += fractions.gcd(a+1, b+1)\ntotal *= 6\n\nfor a in range(K):\n total += ...
['Runtime Error', 'Accepted']
['s468324762', 's805047897']
[10428.0, 9196.0]
[31.0, 442.0]
[321, 302]
p02713
u260036763
2,000
1,048,576
Find \displaystyle{\sum_{a=1}^{K}\sum_{b=1}^{K}\sum_{c=1}^{K} \gcd(a,b,c)}. Here \gcd(a,b,c) denotes the greatest common divisor of a, b, and c.
["import math\nfrom itertools import product\nfrom functools import reduce\n\ndef main():\n def gcd(numbers): return reduce(math.gcd, numbers)\n K = int(input())\n ans = 0\n valiation = list(itertools.product(range(1, K+1), repeat=3))\n for v in valiation:\n ans += gcd(v)\n\n# for j in ran...
['Runtime Error', 'Runtime Error', 'Runtime Error', 'Accepted']
['s126796094', 's498040727', 's655115284', 's165609397']
[9588.0, 9592.0, 9588.0, 9568.0]
[24.0, 24.0, 24.0, 446.0]
[489, 349, 489, 704]
p02713
u263660661
2,000
1,048,576
Find \displaystyle{\sum_{a=1}^{K}\sum_{b=1}^{K}\sum_{c=1}^{K} \gcd(a,b,c)}. Here \gcd(a,b,c) denotes the greatest common divisor of a, b, and c.
['import math\n\nans = 0\nk = int(input())\nfor a in range(k):\n for b in range(k):\n tmp = math.gcd(a, b)\n for c in range(k):\n ans += math.gcd(tmp, c)\n\nprint(ans)\n', 'import math\nk = int(input())\n\nans = 0\nfor a in range(1, k+1):\n for b in range(1, k+1):\n tmp = math.gcd(...
['Wrong Answer', 'Accepted']
['s984531831', 's333291600']
[9136.0, 9180.0]
[1391.0, 1307.0]
[184, 198]
p02713
u264988409
2,000
1,048,576
Find \displaystyle{\sum_{a=1}^{K}\sum_{b=1}^{K}\sum_{c=1}^{K} \gcd(a,b,c)}. Here \gcd(a,b,c) denotes the greatest common divisor of a, b, and c.
['from math import gcd\n\ndef solve():\n K = int(input())\n ans = 0\n \n for i in range(1,K+1):\n num = [0, 0, 0]\n num[0] = i\n for k in range(1,K+1):\n num[1] = k\n for m in range(1,K+1):\n num[2] = m\n ans += reduce(gcd, num)\n r...
['Runtime Error', 'Accepted']
['s348595839', 's138452720']
[9200.0, 9048.0]
[26.0, 732.0]
[329, 253]
p02713
u266675845
2,000
1,048,576
Find \displaystyle{\sum_{a=1}^{K}\sum_{b=1}^{K}\sum_{c=1}^{K} \gcd(a,b,c)}. Here \gcd(a,b,c) denotes the greatest common divisor of a, b, and c.
['def main():\n k = int(input())\n k1 = k + 1\n\n sum = 0\n for i in range(1, k1):\n for j in range(1, k1):\n for m in range(1, k1):\n sum += math.gcd(math.gcd(i, j), m)\n print(sum)\n\nmain()', 'import math\n\n\ndef main():\n k = int(input())\n k1 = k + 1\n\n su...
['Runtime Error', 'Accepted']
['s071368472', 's850118033']
[9184.0, 9020.0]
[21.0, 1809.0]
[227, 243]
p02713
u268792407
2,000
1,048,576
Find \displaystyle{\sum_{a=1}^{K}\sum_{b=1}^{K}\sum_{c=1}^{K} \gcd(a,b,c)}. Here \gcd(a,b,c) denotes the greatest common divisor of a, b, and c.
['k=int(input())\nans=0\nfrom math import gcd\nfor a in range(1,201):\n for b in range(1,201):\n for c in range(1,201):\n ans+=gcd(gcd(a,b),c)\nprint(ans)', 'k=int(input())\nans=0\nfrom math import gcd\nfor a in range(1,k+1):\n for b in range(1,k+1):\n for c in range(1,k+1):\n ans+=gcd(gcd(a,b),c)\npr...
['Wrong Answer', 'Accepted']
['s640314660', 's686027997']
[9176.0, 9172.0]
[1979.0, 1808.0]
[154, 154]
p02713
u276422816
2,000
1,048,576
Find \displaystyle{\sum_{a=1}^{K}\sum_{b=1}^{K}\sum_{c=1}^{K} \gcd(a,b,c)}. Here \gcd(a,b,c) denotes the greatest common divisor of a, b, and c.
['def sort_2(a,b):\n if b<a:\n c=a\n a=b\n b=c\n return [a,b]\n\n\ndef GCDbase(a,b):\n D=b//a\n if b==D*a:\n return a\n else:\n return GCD(b-a*D,a)\n \ndef GCD(a,b):\n ab=sort_2(a,b)\n return GCDbase(ab[0],ab[1])\n \n \n\nK=int(input())\nsum=0\nfor i in r...
['Runtime Error', 'Accepted']
['s080954972', 's122701628']
[8996.0, 9064.0]
[26.0, 1443.0]
[415, 184]
p02713
u277353449
2,000
1,048,576
Find \displaystyle{\sum_{a=1}^{K}\sum_{b=1}^{K}\sum_{c=1}^{K} \gcd(a,b,c)}. Here \gcd(a,b,c) denotes the greatest common divisor of a, b, and c.
['from math import gcd\nk=int(input())\nans=0\nfor i in range(0,k):\n for j in range(0,k):\n for l in range(0,k):\n ans=ans+gcd(gcd(i,j),l)\nprint(ans)\n', 'import fractions\nk=int(input())\nans=0\nfor i in range(1,k+1):\n for j in range(1,k+1):\n for l in range(1,k+1):\n ans=ans+fractions.gcd(i,fract...
['Wrong Answer', 'Time Limit Exceeded', 'Runtime Error', 'Time Limit Exceeded', 'Accepted']
['s117667993', 's559984928', 's560304124', 's957766433', 's452746891']
[9168.0, 10648.0, 10456.0, 10616.0, 9172.0]
[1831.0, 2206.0, 28.0, 2206.0, 1799.0]
[152, 173, 342, 313, 157]
p02713
u277641173
2,000
1,048,576
Find \displaystyle{\sum_{a=1}^{K}\sum_{b=1}^{K}\sum_{c=1}^{K} \gcd(a,b,c)}. Here \gcd(a,b,c) denotes the greatest common divisor of a, b, and c.
['k = int(input())\nimport math\nk1 = 0\nk2 = 0\nk3 = 0\ncount = 0\nfor i in range(0,k):\n k1 = k1 + 1\n for j in range(0,i):\n k2 = k2 + 1\n for k in range(0, j):\n k3 = k3 + 1\n if k1==k2==k3:\n count = count + k1\n elif k1==k2 or k2==k3 or k3==k1:\n count = count + 3*math.gcd(k1,...
['Runtime Error', 'Wrong Answer', 'Accepted']
['s211186612', 's894205052', 's570782211']
[9204.0, 9252.0, 9220.0]
[20.0, 691.0, 670.0]
[366, 541, 525]
p02713
u285891772
2,000
1,048,576
Find \displaystyle{\sum_{a=1}^{K}\sum_{b=1}^{K}\sum_{c=1}^{K} \gcd(a,b,c)}. Here \gcd(a,b,c) denotes the greatest common divisor of a, b, and c.
["import sys, re\nfrom collections import deque, defaultdict, Counter\nfrom math import ceil, sqrt, hypot, factorial, pi, sin, cos, radians\nfrom itertools import accumulate, permutations, combinations, product, groupby\nfrom operator import itemgetter, mul\nfrom copy import deepcopy\nfrom string import ascii_lowercase...
['Time Limit Exceeded', 'Runtime Error', 'Accepted']
['s237382890', 's707699920', 's588447021']
[27336.0, 9080.0, 27184.0]
[2206.0, 23.0, 1145.0]
[915, 155, 919]
p02713
u288233771
2,000
1,048,576
Find \displaystyle{\sum_{a=1}^{K}\sum_{b=1}^{K}\sum_{c=1}^{K} \gcd(a,b,c)}. Here \gcd(a,b,c) denotes the greatest common divisor of a, b, and c.
['import math\n\nK = int(input())\n\nsum = 0\nfor i in range(K):\n for j in range(K):\n for k in range(K):\n sum += math.gcd(math.gcd(i, j), k)\n \nprint(sum)', 'import math\n \nK = int(input())\n \nsum = 0\nfor i in range(K):\n for j in range(K):\n r = math.gcd(i+1, j+1)\n ...
['Wrong Answer', 'Accepted']
['s519617617', 's664106785']
[9176.0, 9172.0]
[2205.0, 1464.0]
[178, 201]
p02713
u288430479
2,000
1,048,576
Find \displaystyle{\sum_{a=1}^{K}\sum_{b=1}^{K}\sum_{c=1}^{K} \gcd(a,b,c)}. Here \gcd(a,b,c) denotes the greatest common divisor of a, b, and c.
['from fractions import gcd \nfrom functools import reduce\nimport itertools\nk = int(input())\na = [i for i in range(1,k+1)]\ns = 0\nfor t in itertools.product(a,repeat=3):\n s += reduce(gcd,t)\nprint(s)', 'from fractions import gcd \nfrom functools import reduce\nimport itertools\nk = int(input())\na = [i for i in r...
['Time Limit Exceeded', 'Time Limit Exceeded', 'Accepted']
['s540678171', 's725878459', 's594937679']
[10744.0, 10684.0, 9576.0]
[2206.0, 2206.0, 518.0]
[195, 343, 338]
p02713
u295797489
2,000
1,048,576
Find \displaystyle{\sum_{a=1}^{K}\sum_{b=1}^{K}\sum_{c=1}^{K} \gcd(a,b,c)}. Here \gcd(a,b,c) denotes the greatest common divisor of a, b, and c.
['def gcd(*numbers):\n return reduce(math.gcd, numbers)\n\ndef gcd_list(numbers):\n return reduce(math.gcd, numbers)\n\nline = int(input())\n\na = list(range(1,line + 1))\nb = list(range(1,line + 1))\nc = list(range(1,line + 1))\n\nresult = list(itertools.product(a,b,c))\n\nall = 0\n\nfor i in result:\n tmp = ...
['Runtime Error', 'Accepted']
['s549923066', 's986210234']
[9160.0, 9176.0]
[20.0, 1185.0]
[349, 210]
p02713
u307418002
2,000
1,048,576
Find \displaystyle{\sum_{a=1}^{K}\sum_{b=1}^{K}\sum_{c=1}^{K} \gcd(a,b,c)}. Here \gcd(a,b,c) denotes the greatest common divisor of a, b, and c.
['import math\nn = int(input() )\n\nsum = 0\nfor i in range (1,n):\n for j in range (1,n): \n for k in range (1,n):\n sum += math.gcd( math.gcd(i,j) ,k )\n \n\nprint( sum )', 'import math\nn = int(input() )\nn+=1\nsum = 0\nfor i in range (1,n):\n for j in range (1,n):\n gcdIJ ...
['Wrong Answer', 'Accepted']
['s236551817', 's413356662']
[9176.0, 9184.0]
[2205.0, 1410.0]
[193, 231]
p02713
u310012552
2,000
1,048,576
Find \displaystyle{\sum_{a=1}^{K}\sum_{b=1}^{K}\sum_{c=1}^{K} \gcd(a,b,c)}. Here \gcd(a,b,c) denotes the greatest common divisor of a, b, and c.
['import math\nfrom functools import reduce\nimport itertools\n\n\ndef gcd_list(numbers):\n return reduce(math.gcd, numbers)\n\n\nk = int(input())\nitems = list(range(1, k+1))\nans = 6 * sum(items)\nans += sum([6 * gcd_list(item) for item in itertools.combinations(items, 2)])\nans += sum([6 * gcd_list(item) for item i...
['Wrong Answer', 'Accepted']
['s318525703', 's301878367']
[19752.0, 19612.0]
[501.0, 465.0]
[355, 351]
p02713
u313291636
2,000
1,048,576
Find \displaystyle{\sum_{a=1}^{K}\sum_{b=1}^{K}\sum_{c=1}^{K} \gcd(a,b,c)}. Here \gcd(a,b,c) denotes the greatest common divisor of a, b, and c.
['K = int(input())\nprint(K ** 3 + (1 / 2) *K ** 2 - (1 / 2) * K)', 'import math\n\nk = int(input())\nsum = 0\n\nfor i in range(1, k + 1):\n for j in range(1, k + 1):\n sum1 = math.gcd(i , j)\n for l in range(1, k + 1):\n sum += math.gcd(sum1, l)\nprint(sum)\n']
['Wrong Answer', 'Accepted']
['s505407925', 's076972331']
[8964.0, 9152.0]
[22.0, 1315.0]
[62, 208]
p02713
u318182140
2,000
1,048,576
Find \displaystyle{\sum_{a=1}^{K}\sum_{b=1}^{K}\sum_{c=1}^{K} \gcd(a,b,c)}. Here \gcd(a,b,c) denotes the greatest common divisor of a, b, and c.
['a = int(input())\nl = []\ndef gcd(n, m):\n if m == 0:\n return n\n else:\n return gcd(m, n%m)\n for n in range(1, a+1):\n for m in range(a+1):\n for p in range(1, a+1):\n ans = gcd(n, gcd(m, p))\n l.append(ans)\nprint(sum(l))', 'from math import g...
['Wrong Answer', 'Accepted']
['s959400069', 's629569384']
[9200.0, 9180.0]
[21.0, 1871.0]
[284, 176]
p02713
u323776907
2,000
1,048,576
Find \displaystyle{\sum_{a=1}^{K}\sum_{b=1}^{K}\sum_{c=1}^{K} \gcd(a,b,c)}. Here \gcd(a,b,c) denotes the greatest common divisor of a, b, and c.
['import math\nfrom functools import reduce\ndef gcd(*number):\n return reduce(math.gcd, number)\nn = int(input())\na, b, c = 1, 1, 1\nsum = 0\nlist_number = []\nwhile True:\n print(a,b,c)\n list_number.append(gcd(a, b, c))\n if n > c:\n c += 1\n elif n == c and n == b and n == a:\n break\n...
['Wrong Answer', 'Wrong Answer', 'Accepted']
['s841190520', 's875149904', 's192379815']
[35524.0, 43436.0, 9156.0]
[2243.0, 2244.0, 1779.0]
[470, 489, 183]
p02713
u329675280
2,000
1,048,576
Find \displaystyle{\sum_{a=1}^{K}\sum_{b=1}^{K}\sum_{c=1}^{K} \gcd(a,b,c)}. Here \gcd(a,b,c) denotes the greatest common divisor of a, b, and c.
['import numpy as np\nk=int(input())\ns=0\nn=range(k+1)\nfor x,y,z in n:\n\ts+=np.gcd.reduce([x,y,z])\nprint(s)', 'import math\nk=input()\ns=0\nfor x in range(1,k+1):\n for y in range(1,k+1):\n for z in range(1,k+1):\n s+=math.gcd(x,gcd(y,z))\nprint(s)', 'import math\nk=int(input())\nl=[]\ns=0\nfor x in range(...
['Runtime Error', 'Runtime Error', 'Accepted']
['s460830454', 's542061108', 's479249088']
[27140.0, 9044.0, 9304.0]
[101.0, 21.0, 1484.0]
[102, 139, 194]
p02713
u331997680
2,000
1,048,576
Find \displaystyle{\sum_{a=1}^{K}\sum_{b=1}^{K}\sum_{c=1}^{K} \gcd(a,b,c)}. Here \gcd(a,b,c) denotes the greatest common divisor of a, b, and c.
['import numpy as np\nK = int(input())\na = np.arange(a,K+1)\nb = np.gcd.outer(np.gcd.outer(a, a), a)\nprint(np.sum(b))\n', 'from numpy import gcd\nN = int(input())\na = np.arange(1,N+1)\nb = np.gcd.outer(np.gcd.outer(a,a), a)\nprint(b)', 'import numpy as np\nK = int(input())\na = np.arrange(a,K+1)\nb = np.gcd.outer(np...
['Runtime Error', 'Runtime Error', 'Runtime Error', 'Accepted']
['s298971862', 's571732817', 's819855585', 's165553871']
[27144.0, 27160.0, 27152.0, 89244.0]
[107.0, 105.0, 108.0, 1001.0]
[114, 107, 114, 113]
p02713
u332926534
2,000
1,048,576
Find \displaystyle{\sum_{a=1}^{K}\sum_{b=1}^{K}\sum_{c=1}^{K} \gcd(a,b,c)}. Here \gcd(a,b,c) denotes the greatest common divisor of a, b, and c.
['import math\nfrom functools import reduce\n\nK = int(input())\nsum = 0\n\ndef gcd(*numbers):\n return reduce(math.gcd, numbers)\n\nfor i in range(K):\n for j in range(K):\n tmp = math.gcd(i+1, j+1)\n for k in range(K):\n sum += gcd(g, k+1)\n \nprint(sum)\n', 'import math\n\nK = i...
['Runtime Error', 'Accepted']
['s266392506', 's036919072']
[9528.0, 9168.0]
[25.0, 1525.0]
[278, 199]
p02713
u332933608
2,000
1,048,576
Find \displaystyle{\sum_{a=1}^{K}\sum_{b=1}^{K}\sum_{c=1}^{K} \gcd(a,b,c)}. Here \gcd(a,b,c) denotes the greatest common divisor of a, b, and c.
['import math\n \nK = int(input())\n \n_sum = 0\n \nfor a in range(1, K):\n for b in range(1, K):\n for c in range(1, K):\n _sum += math.gcd(math.gcd(a, b), c)\nprint(_sum)', 'import math\n\nK = int(input())\n\n_sum = 0\nfor a in range(1, K):\n for b in range(1, K):\n for c in range(1, K)...
['Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Accepted']
['s103377838', 's812046090', 's814585274', 's998370621', 's625856822']
[9172.0, 9176.0, 9212.0, 9180.0, 9148.0]
[2205.0, 2206.0, 442.0, 400.0, 449.0]
[181, 179, 302, 182, 317]
p02713
u336093806
2,000
1,048,576
Find \displaystyle{\sum_{a=1}^{K}\sum_{b=1}^{K}\sum_{c=1}^{K} \gcd(a,b,c)}. Here \gcd(a,b,c) denotes the greatest common divisor of a, b, and c.
['import math\nK = int(input())\nt = 0\nfor i in range(1,K+1):\n for j in range(1,K+1):\n for k in range(1,K+1):\n t += gcd(gcd(i,j),k)\nprint(t)', ' def gcd(a,b):\n while b!=0:\n a,b=b,a%b\n return a\nK = int(input())\nt = 0\nt1 = 0\nfor i in range(1,K+1):\n for j in range(1,K+1):\...
['Runtime Error', 'Runtime Error', 'Accepted']
['s070523809', 's687146740', 's828986725']
[9176.0, 8920.0, 9168.0]
[22.0, 21.0, 1784.0]
[157, 237, 167]
p02713
u341414348
2,000
1,048,576
Find \displaystyle{\sum_{a=1}^{K}\sum_{b=1}^{K}\sum_{c=1}^{K} \gcd(a,b,c)}. Here \gcd(a,b,c) denotes the greatest common divisor of a, b, and c.
['from math import gcd\n\ndef solv():\n n = int(input())\n ans = 0\n for i in range(1, n + 1):\n for j in range(1, n + 1):\n a = gcd(i, j)\n for k in range(1, n + 1):\n ans += gcd(a, k)\n print(ans)\n\nsolve()', 'import sys\nimport numpy as np\n\nfrom math import ...
['Runtime Error', 'Accepted']
['s599937152', 's157922982']
[9056.0, 27088.0]
[24.0, 1267.0]
[251, 461]
p02713
u344813796
2,000
1,048,576
Find \displaystyle{\sum_{a=1}^{K}\sum_{b=1}^{K}\sum_{c=1}^{K} \gcd(a,b,c)}. Here \gcd(a,b,c) denotes the greatest common divisor of a, b, and c.
['k=int(input())\nimport fractions\nans=0\nfor i in range(1,k+1):\n for j in range(1,k+1):\n an=fractions.gcd(i,j)\n for s in range(1,k+1):\n anse=fractions.gcd(s,an)\n ans+=anse\nprint(ans)', 'k=int(input())\n\nans=0\nfor i in range(1,k+1):\n for j in range(1,k+1):\n an...
['Time Limit Exceeded', 'Runtime Error', 'Accepted']
['s328912669', 's364183706', 's667878248']
[10616.0, 9080.0, 9160.0]
[2206.0, 25.0, 1924.0]
[218, 202, 167]
p02713
u347452770
2,000
1,048,576
Find \displaystyle{\sum_{a=1}^{K}\sum_{b=1}^{K}\sum_{c=1}^{K} \gcd(a,b,c)}. Here \gcd(a,b,c) denotes the greatest common divisor of a, b, and c.
['import math\n\n\ndef gcd(a, b, c):\n d = math.gcd(a, b)\n return math.gcd(c, d)\n\nK = int(input())\nsum = 0\n\nfor i in range(1, a+1):\n for j in range(1, b+1):\n for k in range(1, c+1):\n sum += gcd(i, j, k)\n \nprint(sum)', 'import math\n \n \ndef gcd(a, b, c):\n d = math.gcd(a, b)\n return math....
['Runtime Error', 'Accepted']
['s977034563', 's542920132']
[9184.0, 9220.0]
[22.0, 793.0]
[225, 422]
p02713
u350093546
2,000
1,048,576
Find \displaystyle{\sum_{a=1}^{K}\sum_{b=1}^{K}\sum_{c=1}^{K} \gcd(a,b,c)}. Here \gcd(a,b,c) denotes the greatest common divisor of a, b, and c.
['from fractions import gcd\nn=int(input())\ncnt=0\nfor i in range(1,n+1):\n for j in range(1,n+1):\n a=gcd(i,j)\n for k in range(1,n+1):\n cnt+=gcd(a,k)\nprint(cnt)\n', 'from fractions import gcd\nk=int(input())\ncnt=0\nfor i in range(1,k+1):\n for j in range(1,k+1):\n a=gcd(i,j)\n for k in range(1,...
['Time Limit Exceeded', 'Time Limit Exceeded', 'Accepted']
['s466634087', 's526482921', 's409854027']
[10544.0, 10644.0, 9068.0]
[2206.0, 2206.0, 1178.0]
[168, 167, 163]
p02713
u357949405
2,000
1,048,576
Find \displaystyle{\sum_{a=1}^{K}\sum_{b=1}^{K}\sum_{c=1}^{K} \gcd(a,b,c)}. Here \gcd(a,b,c) denotes the greatest common divisor of a, b, and c.
['import fractions\nfrom functools import reduce\nimport itertools\n\ndef gcd(*numbers):\n return reduce(fractions.gcd, numbers)\n \nK = int(input())\n\nans = 0\nfor comb in itertools.product(range(1, K+1), repeat=3):\n ans += gcd(*comb)\n\nprint(ans)\n', 'import fractions\nfrom functools import reduce\nimport i...
['Time Limit Exceeded', 'Accepted']
['s429834802', 's553075782']
[10712.0, 10524.0]
[2206.0, 619.0]
[244, 419]
p02713
u365858785
2,000
1,048,576
Find \displaystyle{\sum_{a=1}^{K}\sum_{b=1}^{K}\sum_{c=1}^{K} \gcd(a,b,c)}. Here \gcd(a,b,c) denotes the greatest common divisor of a, b, and c.
['import math\ndef gud(a,b):\n if a%b==0:\n return b\n else:\n return gud(b,a%b)\na=int(input())\nans=0\nfor i in range(1,a+1):\n for j in range(1,a+1):\n n=math.gcd(i+1,j+1)\n for k in range(1,a+1):\n ans+=math.gcd(n,k+1)\nprint(ans)', 'import math\ndef gud(a,b):\n if a%b==0:\n return b\n else...
['Wrong Answer', 'Accepted']
['s446485166', 's105606821']
[9224.0, 9100.0]
[1505.0, 1373.0]
[239, 233]
p02713
u366886346
2,000
1,048,576
Find \displaystyle{\sum_{a=1}^{K}\sum_{b=1}^{K}\sum_{c=1}^{K} \gcd(a,b,c)}. Here \gcd(a,b,c) denotes the greatest common divisor of a, b, and c.
['k=int(input())\nf=0\ng=0\nh=0\nimport math\nfor a in range(1,k+1):\n for b in range(1,a+1):\n for c in range(1,b):\n d=math.gcd(a,b)\n e=math.gcd(d,c)\n f+=e\nfor a in range(1,k+1):\n for b in range(1,a):\n for c in range(1,b):\n d=math.gcd(a,b)\n ...
['Wrong Answer', 'Accepted']
['s667181638', 's473196686']
[9220.0, 9168.0]
[868.0, 1937.0]
[393, 177]
p02713
u367965715
2,000
1,048,576
Find \displaystyle{\sum_{a=1}^{K}\sum_{b=1}^{K}\sum_{c=1}^{K} \gcd(a,b,c)}. Here \gcd(a,b,c) denotes the greatest common divisor of a, b, and c.
['from fractions import gcd\n\nk = int(input())\n\nres = 0\nmul = [0, 1, 3, 6]\nfor a in range(1, k+1):\n for b in range(a, k+1):\n for c in range(b, k+1):\n res += gcd(gcd(a, b), c) * mul[len({a, b, c})]\n\nprint(res)', 'from math import gcd\n\nk = int(input())\n\nres = 0\nmul = (0, 1, 3, 6)\nfor ...
['Time Limit Exceeded', 'Accepted']
['s997758899', 's380654762']
[10528.0, 9080.0]
[2206.0, 621.0]
[226, 222]
p02713
u369133448
2,000
1,048,576
Find \displaystyle{\sum_{a=1}^{K}\sum_{b=1}^{K}\sum_{c=1}^{K} \gcd(a,b,c)}. Here \gcd(a,b,c) denotes the greatest common divisor of a, b, and c.
['def gcd(x,y):\n while y>0:\n bk=x%y\n x=y\n y=bk\n return x\n\nk=int(input())\nans=0\nfor i in range(1,k+1):\n for j in range(1,k+1):\n for h in range(1,k+1):\n ans+=1\nprint(ans)', 'import math\nk=int(input())\nans=0\nfor i in range(1,k+1):\n for j in range(1,k+1):\n tmp=math.gcd(i,j)\n fo...
['Wrong Answer', 'Wrong Answer', 'Accepted']
['s211160279', 's414940963', 's550205823']
[9124.0, 9176.0, 9176.0]
[591.0, 1364.0, 1406.0]
[186, 167, 167]
p02713
u373295322
2,000
1,048,576
Find \displaystyle{\sum_{a=1}^{K}\sum_{b=1}^{K}\sum_{c=1}^{K} \gcd(a,b,c)}. Here \gcd(a,b,c) denotes the greatest common divisor of a, b, and c.
['import itertools\nimport math\n\nm = int(input())\ng = range(1, m+1)\nres = 0\nfor c in itertools.combinations(g, 3):\n set_c = set(c)\n if len(set_c) == 3:\n n = 6\n elif len(set_c) == 2:\n n = 3\n else:\n n = 1\n tmp_res = math.gcd(c[0], c[1], c[2])\n res += tmp_res * n\nprint(res)', 'import itertool...
['Runtime Error', 'Accepted']
['s727798903', 's150510402']
[9128.0, 9220.0]
[23.0, 1283.0]
[283, 475]
p02713
u375681664
2,000
1,048,576
Find \displaystyle{\sum_{a=1}^{K}\sum_{b=1}^{K}\sum_{c=1}^{K} \gcd(a,b,c)}. Here \gcd(a,b,c) denotes the greatest common divisor of a, b, and c.
['import math\nn=int(input())\nadd=0\nfor i in range(n):\n for j in range(n):\n for k in range(n):\n add+=math.gcd(math.gcd(i,j),k)\nprint(add)\n', 'import math\ncnt=0\nn=int(input())\nfor i in range(1,n+1):\n for j in range(1,n+1):\n wk=math.gcd(i,j)\n for k in range(1,n+1):\n ...
['Wrong Answer', 'Accepted']
['s937846343', 's320442076']
[9168.0, 9060.0]
[2206.0, 1373.0]
[156, 181]
p02713
u382169668
2,000
1,048,576
Find \displaystyle{\sum_{a=1}^{K}\sum_{b=1}^{K}\sum_{c=1}^{K} \gcd(a,b,c)}. Here \gcd(a,b,c) denotes the greatest common divisor of a, b, and c.
['import copy\nK=200\nprimes=[2,3,5,7,11,13,17,19,23,29,31,37,41,43,47,53,59,61,67,71,73,79,83,89,97,101,103,107,109,113,127,131,137,139,149,151,157,163,167,173,179,181,191,193,197,199]\nyakusuu_array=[]\nfor i in range(200):\n i+=1\n tmp=[]\n while i!=1:\n for prime in primes:\n if i % prime ==0:\n t...
['Time Limit Exceeded', 'Runtime Error', 'Accepted']
['s560504418', 's723217904', 's178112872']
[8940.0, 9284.0, 9168.0]
[2205.0, 21.0, 1123.0]
[610, 617, 190]
p02713
u382639013
2,000
1,048,576
Find \displaystyle{\sum_{a=1}^{K}\sum_{b=1}^{K}\sum_{c=1}^{K} \gcd(a,b,c)}. Here \gcd(a,b,c) denotes the greatest common divisor of a, b, and c.
['import math\n\nK = int(input())\nsum_gcd = 0\nfor a in range(1, K+1):\n for b in range(1, K+1):\n n = math.gcd(a, b)\n for c in range(1, K+1):\n sum_gcd += np.gcd(n, c)\nprint(sum_gcd)', 'import math\n\nK = int(input())\n\nsum = 0\nfor a in range(1, K+1):\n for b in range(1, K+1):\n ...
['Runtime Error', 'Runtime Error', 'Runtime Error', 'Accepted']
['s230035406', 's266814368', 's928951488', 's819913694']
[9052.0, 9196.0, 9176.0, 9176.0]
[24.0, 22.0, 25.0, 1187.0]
[203, 192, 203, 187]
p02713
u385309449
2,000
1,048,576
Find \displaystyle{\sum_{a=1}^{K}\sum_{b=1}^{K}\sum_{c=1}^{K} \gcd(a,b,c)}. Here \gcd(a,b,c) denotes the greatest common divisor of a, b, and c.
['ans = 0\nk = 2\ndef f(x,y):\n x,y= min(x,y),max(x,y)\n while y%x != 0:\n z = y%x\n y = x\n x = z\n else:\n return x\ndef ff(a,b,c):\n return f(c,f(a,b))\nfor i in range(1,k+1):\n for j in range(1,k+1):\n for k in range(1,k+1):\n c = sorted([i,j,k])\n print(c)\n ...
['Wrong Answer', 'Wrong Answer', 'Accepted']
['s327577254', 's836993507', 's973300867']
[9096.0, 18868.0, 9208.0]
[22.0, 2231.0, 1493.0]
[340, 351, 458]
p02713
u387080888
2,000
1,048,576
Find \displaystyle{\sum_{a=1}^{K}\sum_{b=1}^{K}\sum_{c=1}^{K} \gcd(a,b,c)}. Here \gcd(a,b,c) denotes the greatest common divisor of a, b, and c.
['a=int(input())\nimport math\nprint(sum(gcd(gcd(i,j),k)for i in range(1,a+1) for j in range(1,a+1) for k in range(1,a+1)))', 'a=int(input())\nimport math\nprint(sum(math.gcd(math.gcd(i,j),k)for i in range(1,a+1) for j in range(1,a+1) for k in range(1,a+1)))']
['Runtime Error', 'Accepted']
['s950955782', 's775459468']
[9120.0, 9116.0]
[24.0, 1722.0]
[119, 129]
p02713
u390901183
2,000
1,048,576
Find \displaystyle{\sum_{a=1}^{K}\sum_{b=1}^{K}\sum_{c=1}^{K} \gcd(a,b,c)}. Here \gcd(a,b,c) denotes the greatest common divisor of a, b, and c.
["from collections import defaultdict, deque\nimport sys\nimport heapq\nimport bisect\nimport math\nimport itertools\nimport string\nimport queue\nimport copy\nimport time\n# import numpy as np\nfrom fractions import gcd\n\nsys.setrecursionlimit(10**8)\nINF = float('inf')\nmod = 10**9+7\neps = 10 ** -7\n\ndef inp(): re...
['Time Limit Exceeded', 'Time Limit Exceeded', 'Accepted']
['s231327668', 's854657271', 's599920190']
[11296.0, 11300.0, 10560.0]
[2206.0, 2206.0, 663.0]
[862, 868, 947]
p02713
u391540332
2,000
1,048,576
Find \displaystyle{\sum_{a=1}^{K}\sum_{b=1}^{K}\sum_{c=1}^{K} \gcd(a,b,c)}. Here \gcd(a,b,c) denotes the greatest common divisor of a, b, and c.
['def debug(arg):\n if __debug__:\n pass\n else:\n import sys\n print(arg, file=sys.stderr)\n\n\n\nn, k = (int(x) for x in input().split())\n\nc = {} \nt = 0\nfor x in range(k, 0, -1):\n c[x] = (k // x) ** n\n c[x] = c[x] - sum(c[x * y] for y in range(2, k // x + 1))\n s = c[x] * x\n...
['Runtime Error', 'Runtime Error', 'Runtime Error', 'Wrong Answer', 'Accepted']
['s027628641', 's526071833', 's547201360', 's993261503', 's888176072']
[9204.0, 9112.0, 9132.0, 42288.0, 9156.0]
[23.0, 20.0, 21.0, 619.0, 21.0]
[344, 349, 343, 378, 237]
p02713
u391725895
2,000
1,048,576
Find \displaystyle{\sum_{a=1}^{K}\sum_{b=1}^{K}\sum_{c=1}^{K} \gcd(a,b,c)}. Here \gcd(a,b,c) denotes the greatest common divisor of a, b, and c.
['import fractions\n\nK = input()\n\nSum = 0\nk = int(K)\n\nfor A in range(k):\n a = A + 1\n for B in range(k):\n b = B + 1\n gcd_ab = fractions.gcd(a, b)\n for C in range(k):\n c = C + 1\n\n Sum = Sum + fractions.gcd(gcd_ab, c)\n\nprint(Sum)', 'import fractions\n\nK = i...
['Time Limit Exceeded', 'Runtime Error', 'Time Limit Exceeded', 'Accepted']
['s111449136', 's668427453', 's915557453', 's242756707']
[10680.0, 10380.0, 10672.0, 9192.0]
[2205.0, 31.0, 2205.0, 1624.0]
[272, 237, 252, 262]
p02713
u395202850
2,000
1,048,576
Find \displaystyle{\sum_{a=1}^{K}\sum_{b=1}^{K}\sum_{c=1}^{K} \gcd(a,b,c)}. Here \gcd(a,b,c) denotes the greatest common divisor of a, b, and c.
["import sys\nimport math\nimport time\nreadline = sys.stdin.readline\n\n\ndef main():\n listSum = [6, 3, 1]\n k = int(input())\n sumGCD = 0\n for a in range(1, k + 1):\n for b in range(a, k + 1):\n for c in range(b, k + 1):\n sumGCD += gcd(a, b, c) * listSum[len(set([a, b, ...
['Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Accepted']
['s004380693', 's655450450', 's922315366', 's131332830']
[9152.0, 9120.0, 9184.0, 9088.0]
[730.0, 723.0, 736.0, 722.0]
[479, 481, 479, 481]
p02713
u404678206
2,000
1,048,576
Find \displaystyle{\sum_{a=1}^{K}\sum_{b=1}^{K}\sum_{c=1}^{K} \gcd(a,b,c)}. Here \gcd(a,b,c) denotes the greatest common divisor of a, b, and c.
['import math\nans=0\nk=int(input())\nfor i in range(k):\n for j in range(k):\n gcd_ij=math.gcd(i+1,j+1)\n for k in range(k):\n ans+=math.gcd(gcd_ij,k+1)\nprint(ans)\n ', 'import math\nk=int(input())\n#print(k)\nans_list=[]\nfor i in range(1,k+1):\n for j in range(1,k+1):\n gcd_ij=math.gcd(i,j)\n ...
['Wrong Answer', 'Accepted']
['s381892241', 's095221697']
[9128.0, 71344.0]
[24.0, 1526.0]
[174, 253]
p02713
u408375121
2,000
1,048,576
Find \displaystyle{\sum_{a=1}^{K}\sum_{b=1}^{K}\sum_{c=1}^{K} \gcd(a,b,c)}. Here \gcd(a,b,c) denotes the greatest common divisor of a, b, and c.
['def gcd(a, b):\n if a < b:\n a, b = b, a\n while a % b:\n a, b = b, a % b\n return b\n\nk = int(input())\ntotal = 0\nfor a in range(1, k-1):\n for b in range(a, k):\n for c in range(b, k+1):\n if a == b == c:\n total += gcd(gcd(a, b), c)\n elif a == b or b == c:\n total += 3*gcd(g...
['Wrong Answer', 'Runtime Error', 'Accepted']
['s128266019', 's887580133', 's544171972']
[9220.0, 9152.0, 9100.0]
[816.0, 22.0, 878.0]
[377, 281, 380]
p02713
u409306788
2,000
1,048,576
Find \displaystyle{\sum_{a=1}^{K}\sum_{b=1}^{K}\sum_{c=1}^{K} \gcd(a,b,c)}. Here \gcd(a,b,c) denotes the greatest common divisor of a, b, and c.
['# C - Sum of gcd of Tuples (Easy)\n\nimport math\n\nK = int(input())\nans = 0\n\nfor a in range(1, K + 1):\n\tfor b in range(1, K + 1):\n\t\tab = math.gcd(a, b)\n\t\t\n\t\tfor c in range(1, K + 1):\n\t\t\tans += math.gcd(ab, c))\n\nprint(ans)', '# C - Sum of gcd of Tuples (Easy)\n\nimport math\n\nK = int(input())\nan...
['Runtime Error', 'Accepted']
['s204370588', 's558839035']
[8888.0, 9084.0]
[23.0, 1418.0]
[218, 217]
p02713
u412825945
2,000
1,048,576
Find \displaystyle{\sum_{a=1}^{K}\sum_{b=1}^{K}\sum_{c=1}^{K} \gcd(a,b,c)}. Here \gcd(a,b,c) denotes the greatest common divisor of a, b, and c.
['import fractions\nfrom functools import reduce\n\ndef gcd(*numbers):\n return reduce(fractions.gcd, numbers)\n\nK = int(input())\ntotal = 0\n\nfor a in range(1,K+1):\n for b in range(1,K+1):\n for c in range(1,K+1):\n total += gcd(a,b,c)\nprint(total)', 'import math\nans = 0\nn = int(input())\n\nfor i in ra...
['Time Limit Exceeded', 'Accepted']
['s842443038', 's738782057']
[10712.0, 9172.0]
[2206.0, 1389.0]
[248, 189]
p02713
u422272120
2,000
1,048,576
Find \displaystyle{\sum_{a=1}^{K}\sum_{b=1}^{K}\sum_{c=1}^{K} \gcd(a,b,c)}. Here \gcd(a,b,c) denotes the greatest common divisor of a, b, and c.
['k = int(input())\n\nimport math\nfrom functools import reduce\ndef gcd(*numbers):\n return reduce(math.gcd, numbers)\n\ntotal = 0\nfor a in range(1,k+1):\n for b in range(1,k+1):\n for c in range(1,k+1):\n if (a%b==0 or b%a==0) and (b%c==0 or c%b==0) and (c%a==0 or a%c==0):\n to...
['Wrong Answer', 'Accepted']
['s720561013', 's774797850']
[9632.0, 9064.0]
[2205.0, 1445.0]
[383, 289]
p02713
u423966555
2,000
1,048,576
Find \displaystyle{\sum_{a=1}^{K}\sum_{b=1}^{K}\sum_{c=1}^{K} \gcd(a,b,c)}. Here \gcd(a,b,c) denotes the greatest common divisor of a, b, and c.
['K = int(input())\n\nimport math\n\nans = 0\nfor i in range(1, K+1):\n for j in range(1, K+1):\n a = gcd(i, j)\n for k in range(1, K+1):\n ans += gcd(a,k)\n\nprint(ans)\n\n', 'K = int(input())\n\nimport math\n\nans = 0\nfor i in range(1, K+1):\n for j in range(1, K+1):\n a = math....
['Runtime Error', 'Accepted']
['s130633566', 's209678969']
[9184.0, 9192.0]
[23.0, 1388.0]
[186, 195]
p02713
u425184437
2,000
1,048,576
Find \displaystyle{\sum_{a=1}^{K}\sum_{b=1}^{K}\sum_{c=1}^{K} \gcd(a,b,c)}. Here \gcd(a,b,c) denotes the greatest common divisor of a, b, and c.
["N=int(input())\nS=input()\nr=S.count('R')\ng=S.count('G')\nb=S.count('B')\nc=0\nfor i in range(N):\n for j in range(i+1,N):\n h=2*j-i\n if h<=N-1:\n if S[i]!=S[j] and S[i]!=S[h] and S[j]!=S[h]:\n c+=1\nans=r*g*b-c\nprint(ans)", 'import math\nK=int(input())\nc=0\nfor i in range(1,K+1):\n for j in r...
['Runtime Error', 'Accepted']
['s508239641', 's992723202']
[9140.0, 9068.0]
[22.0, 636.0]
[231, 256]