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
u427984570
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())\nans = 0\nt = 0\nimport fractions\nfor i in range(1,n+1):\n for j in range(1,n+1):\n t = fractions.gcd(i,j)\n for k in range(1,n+1):\n ans += fractions.gcd(t,k)\nprint(ans)', 'n = int(input())\nans = 0\nt = 0\nimport math\nfor i in range(1,n+1):\n for j in range(1,n+1):\n t = math.gcd...
['Time Limit Exceeded', 'Accepted']
['s272704658', 's480698158']
[10700.0, 8976.0]
[2206.0, 1291.0]
[192, 179]
p02713
u432853936
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(i,k+1):\n for l in range(j,k+1):\n tmp = fractions.gcd(i,j)\n tmp = fractions.gcd(tmp,l)\n if i == j == l:\n ...
['Time Limit Exceeded', 'Accepted']
['s295133750', 's014653192']
[10684.0, 9180.0]
[2205.0, 648.0]
[540, 525]
p02713
u433136867
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 numpy as np\n\nN=int(input())\ncount = 0\nj_check = 0\nk_check = 0\n\nfor i in range(1,N+1):\n i_ins=[]\n for x in range(1,i+1):\n if i//x != 0 and i%x == 0:\n i_ins.append(x)\n for j in range(i,N+1):\n i_j_ins=[]\n for y in i_ins:\n if j//y != 0 ...
['Wrong Answer', 'Wrong Answer', 'Accepted']
['s223730809', 's828616668', 's454681419']
[29828.0, 30428.0, 27048.0]
[2004.0, 2232.0, 1764.0]
[781, 775, 789]
p02713
u434296044
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 from math import gcd\n\n K=int(input())\n cal=0\n for a in range(1,K+1):\n for b in range(1,K+1):\n i=gcd(a,b)\n\n for c in range(1,K+1):\n cal+=gcd(i,c)\n\n print(cal)\n\n\nmain()\n', 'def main():\n from math import gcd\n\n K=int(input())\n ca...
['Wrong Answer', 'Accepted']
['s158261315', 's915163603']
[9172.0, 9188.0]
[26.0, 642.0]
[231, 238]
p02713
u437215432
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\nk = 200\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 # print(a, b, c, gcd(a, gcd(b, c)))\n total += gcd(a, gcd(b, c))\nprint(total)\n', 'rom math import gcd\n\nk = int(input())\ntotal = 0\nfor a in range(1, k+1):\n ...
['Wrong Answer', 'Runtime Error', 'Runtime Error', 'Accepted']
['s684066600', 's721462171', 's844329176', 's422049532']
[9108.0, 8944.0, 10400.0, 9084.0]
[1996.0, 20.0, 32.0, 1207.0]
[224, 262, 242, 267]
p02713
u437727817
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\nk = int(input())\nans = 0\nfor a in range(1,k+1):\n\tfor b in range(a+1,k+1):\n\t\tfor c in range(b+1,k+1):\n\t\t\tans += gcd(gcd(a,b),c)\n\nprint(ans*3)', 'from fractions import gcd\nk = int(input())\nans = 0\nfor a in range(1,k+1):\n\tfor b in range(1,k+1):\n\t\tfor c in range(1,k+1):\n\t...
['Wrong Answer', 'Time Limit Exceeded', 'Accepted']
['s046381756', 's401499459', 's518240266']
[10588.0, 10448.0, 8996.0]
[2102.0, 2206.0, 1839.0]
[166, 160, 155]
p02713
u439063038
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\nresult = 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 max_abc = max([a,b,c])\n print(a,b,c)\n for i in range(max_abc, 0, -1):\n if (a%i == 0 and b%i == 0) and c%i == 0:\n result += i\n ...
['Wrong Answer', 'Accepted']
['s648242035', 's296715595']
[9068.0, 9112.0]
[2209.0, 1929.0]
[345, 623]
p02713
u440161695
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 functools import reduce\nfrom math import gcd\nN=int(input())\nans=0\nfor i in range(N):\n for j in range(N):\n for k in range(N):\n ans+=reduce(gcd,(i,j,k))\nprint(ans)', 'from math import gcd\nans=0\nK=int(input())\nfor i in range(K):\n for j in range(K):\n a=gcd(i,j)\n for k in range(K):\n ...
['Wrong Answer', 'Wrong Answer', 'Accepted']
['s457530307', 's943292964', 's408093667']
[9560.0, 9120.0, 9208.0]
[2205.0, 1188.0, 897.0]
[175, 150, 339]
p02713
u443569380
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\nn = int(input())\nans = 0\nfor 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(gcd(i, j), k)', 'from math import gcd\n\nn = int(input())\nans = 0\nfor i in range(1, n + 1):\n for j in range(1, n + 1):\n for k in range(1,...
['Wrong Answer', 'Accepted']
['s411852850', 's250159895']
[9172.0, 9172.0]
[1973.0, 1906.0]
[173, 197]
p02713
u444481227
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(*numbers):\n return reduce(math.gcd, numbers)\n\ndef sumgcd(K):\n for a in range (len(la)):\n for b in range(len(lb)):\n for c in range(len(lc)):\n sum += gcd(la[a],lb[b],lc[c])\n', 'import math\nfrom functools import reduce\n\ndef gcd(*numbers):\n...
['Wrong Answer', 'Runtime Error', 'Runtime Error', 'Wrong Answer', 'Accepted']
['s067010647', 's101007834', 's860972250', 's946979478', 's989773166']
[9508.0, 8948.0, 9448.0, 9636.0, 9180.0]
[28.0, 22.0, 26.0, 2205.0, 1890.0]
[238, 231, 285, 282, 179]
p02713
u447456419
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 k = int(input())\n ans = 0\n\n for h in range(1, k+1):\n for i in range(1, k+1):\n l = math.gcd(h, i)\n for j in range(1, k+1):\n ans += math.gcd(l, j)\n\n print(ans)', 'import math\n\nk = int(input())\nans = 0\n\nfor h in range(1, k+1):\n for...
['Runtime Error', 'Accepted']
['s379922811', 's516398083']
[8932.0, 9144.0]
[28.0, 1286.0]
[227, 195]
p02713
u447532620
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\nsum=0\nfor a in range(1,K):\n for b in range(1,K):\n for c in range(1,K):\n gcd1 = int(gcd(a,b))\n gcd2 = int(gcd(b,c))\n gcd = int(gcd(gcd1,gcd2))\n\n sum = sum+gcd\nprint(sum)', 'from math import gcd\n\nK = int(input())\no...
['Runtime Error', 'Accepted']
['s892776784', 's021788546']
[9192.0, 9344.0]
[22.0, 45.0]
[260, 349]
p02713
u448747186
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 fractions\n\nN = input()\nN = int(N)\n\nl = list(itertools.combinations_with_replacement(list(range(1,N+1)), 3))\ns_all = 0\nfor nums in l:\n count = 0\n ans = nums[0]\n for i in range(1, 3):\n ans = fractions.gcd(ans, nums[i])\n a,b,c = nums[0], nums[1], nums[2]\n if a=...
['Time Limit Exceeded', 'Accepted']
['s891016025', 's977966968']
[106884.0, 106752.0]
[2208.0, 1990.0]
[519, 755]
p02713
u450147945
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())\ntmp = 0\ncnt = 0\nfor a in range(1, K+1):\n for b in range(1, K+1):\n tmp = math.gcd(a, b)\n cnt = sum([math.gcd(tmp, c) for c in range(1, K+1)])\nprint(cnt)', 'import math\nK = int(input())\nfor a in range(1, K+1):\n for b in range(1, K+1):\n tmp = math.gcd(a...
['Wrong Answer', 'Wrong Answer', 'Accepted']
['s525145290', 's829872979', 's485873815']
[9188.0, 9100.0, 9188.0]
[895.0, 835.0, 841.0]
[197, 181, 199]
p02713
u450904670
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(*numbers):\n return reduce(math.gcd, numbers)\n\ndef gcd_list(numbers):\n return reduce(math.gcd, numbers)\n\nK = int(input())\nans = 0\nfor a in range(1,200+1):\n for b in range(1, 200+1):\n for c in range(1, 200+1):\n ans += gcd(a,b,c) \nprint(ans)...
['Time Limit Exceeded', 'Accepted']
['s794069118', 's131184521']
[9552.0, 9636.0]
[2205.0, 773.0]
[303, 421]
p02713
u453623947
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())\nlist=[]\nimport math\n\nfor i in range(k+1):\n for j in range(k+1):\n for m in range(k+1):\n n = math.gcd(i,j)\n a = math.gcd(n,m)\n list.append(int(a)\n\nans = sum(list)\nprint(ans)\n', 'k = int(input())\nfrom math import gcd\nans = 0\nfor i in range(1,k+1...
['Runtime Error', 'Runtime Error', 'Runtime Error', 'Wrong Answer', 'Runtime Error', 'Runtime Error', 'Runtime Error', 'Runtime Error', 'Runtime Error', 'Runtime Error', 'Accepted']
['s133876444', 's217285235', 's452950105', 's504990759', 's792319618', 's811958243', 's864697226', 's866161825', 's960136683', 's984018722', 's895663753']
[9040.0, 9084.0, 9048.0, 54708.0, 9120.0, 8912.0, 8928.0, 8880.0, 9072.0, 8900.0, 9120.0]
[21.0, 21.0, 22.0, 2207.0, 23.0, 23.0, 21.0, 21.0, 22.0, 21.0, 1142.0]
[232, 215, 192, 233, 215, 244, 211, 239, 209, 244, 190]
p02713
u453683890
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\nl = int(input())\ns = 0\nfor i in range(l):\n for j in range(l):\n t = math.gcd(i,j)\n for k in range(l):\n s += math.gcd(t,k)\nprint(s)', 'import math\nl = int(input())\ns = 0\nfor i in range(1,l+1):\n for j in range(1,l+1):\n t = math.gcd(i,j)\n for k in range(1,l+1):\n s += mat...
['Wrong Answer', 'Accepted']
['s013359156', 's106378852']
[9168.0, 9172.0]
[1374.0, 1404.0]
[153, 165]
p02713
u454472984
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())\nfor a in range(1,K+1):\n for b in range(1,K+1):\n for c in range(1,K+1): \n m=min(a,b,c)\n for i in range(1,m+1):\n if a%i==0 and b%i==0 and c%i==0:\n gcd=i\n sum+=gcd\n\nprint(sum)', 'from math import gcd\nK=int(i...
['Runtime Error', 'Accepted']
['s376481292', 's640369636']
[9196.0, 9068.0]
[24.0, 1769.0]
[275, 190]
p02713
u455809703
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\nfrom fractions import gcd\n \nK = int(input())\nl = range(1, K+1)\nans = sum(l)\n \nfor a, b in itertools.combinations(l, 2):\n ans += gcd(a, b) * 6\n \nfor a, b, c in itertools.combinations(l, 3):\n ans += gcd(gcd(a, b), c) * 6\n \nprint(ans)', 'import itertools\nfrom fractions import ...
['Time Limit Exceeded', 'Wrong Answer', 'Wrong Answer', 'Time Limit Exceeded', 'Accepted']
['s137175165', 's285749781', 's421232741', 's944766125', 's408820473']
[10584.0, 10580.0, 10588.0, 10696.0, 9120.0]
[2206.0, 2205.0, 2206.0, 2205.0, 483.0]
[261, 314, 305, 176, 264]
p02713
u459419927
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 sys import stdin\ndef gcd(a,b):\n x=max(a,b)\n y=min(a,b)\n if x%y==0:return y\n else:\n while(x%y!=0):\n z=x%y\n x=y\n y=z\n return z\n\nK = list(map(int, (stdin.readline().strip().split())))[0]\nans=0\nfor i in range(1,K+1):\n for j in range(1,K+1):...
['Wrong Answer', 'Accepted']
['s191611610', 's458802933']
[9020.0, 9056.0]
[473.0, 1380.0]
[429, 884]
p02713
u463864151
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.
['# -*- coding: utf-8 -*-\n"""\nCreated on Sun Apr 12 21:45:38 2020\n\n@author: H_Hoshigi\n"""\n\nimport math\n\nK = 200#int(input())\n\nanswer = 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 answer += math.gcd(math.gcd(a, b), c)\nprint(answer)\n\n', '# -*- coding...
['Time Limit Exceeded', 'Wrong Answer', 'Accepted']
['s479491824', 's639542487', 's269076829']
[8880.0, 9012.0, 9184.0]
[2205.0, 1461.0, 1440.0]
[284, 309, 305]
p02713
u465900169
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())\ntotal = 0\n\ndef gdc(x,y):\n if x%y==0:\n return y\n return gdc(y, x%y)\n\nfor a in range(K):\n for b in range(a,K):\n for c in range(b,K):\n if a==b and b==c:\n total += gdc(c+1, gdc(b+1, a+1))\n elif a==b or b==c or a==c:\n total += 3*gdc(c+1, gdc(b+1, a+1))\n ...
['Runtime Error', 'Accepted']
['s262460052', 's477953765']
[9068.0, 9120.0]
[20.0, 1784.0]
[365, 219]
p02713
u474423089
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 a in range(1,K+1):\n for b in range(a,K+1):\n for c in range(b,K+1):\n ans += gcd(gcd(a,b),c)\nprint(ans)', 'from math import gcd\nK=int(input())\nans = 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 ...
['Wrong Answer', 'Accepted']
['s311236175', 's410400640']
[9172.0, 9168.0]
[327.0, 1927.0]
[170, 171]
p02713
u474925961
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 itertools\nif sys.platform =='ios':\n sys.stdin=open('input_file.txt')\n\nk=int(input())\nl=[]\nl.append([1, 1])\nl.append([2 ,9])\nl.append([3 ,30])\nl.append([4 ,76])\nl.append([5 ,141])\nl.append([6 ,267])\nl.append([7 ,400])\nl.append([8 ,624])\nl.append([9 ,885])\nl.append([10, 1249])\nl.ap...
['Runtime Error', 'Accepted']
['s133514638', 's466875115']
[9732.0, 9728.0]
[23.0, 21.0]
[4854, 4856]
p02713
u475675023
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\nk=int(input())\nans=0\nfor p in range(1,k+1):\n for q in range(1,k+1):\n for r in range(1,k+1):\n ans+=gcd(p,gcd(q,r))\nprint(ans)', 'from math import gcd\nk=int(input())\nans=0\nfor p in range(1,k+1):\n for q in range(1,k+1):\n for r in range(1,k+1):\n ans+=gcd(p,gcd(q,r)...
['Time Limit Exceeded', 'Accepted']
['s135923027', 's741993725']
[10672.0, 9204.0]
[2205.0, 1976.0]
[159, 154]
p02713
u479638406
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 = 0\nfor a in range(1, k):\n for b in range(1, k):\n for c in range(1, k):\n ans += gcd(a, b, c)\n \nprint(ans)', 'import math\nk = int(input())\n\nans = 0\nfor a in range(1, k+1):\n for b in range(1, k+1):\n m = math.gcd(a, b)\n for c in range(1, k+1):\n ans ...
['Runtime Error', 'Accepted']
['s741159680', 's005895051']
[9172.0, 9176.0]
[23.0, 1366.0]
[141, 186]
p02713
u485566817
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\nk = int(input())\n\nresult = 0\n\ndef gcd(*numbers):\n return reduce(fractions.gcd, numbers)\n\nfor a in range(1, k+1):\n for b in range(a, k+1):\n for c in range(b, k+1):\n if a == b == c:\n result += a\n elif a == b ...
['Time Limit Exceeded', 'Accepted']
['s099956635', 's400431621']
[10756.0, 9628.0]
[2206.0, 824.0]
[572, 562]
p02713
u488178971
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.
["# ABC 162\n\n# https://note.nkmk.me/python-gcd-lcm/\nA = int(input())\n\nans = 0\nfrom fractions import gcd\nfrom functools import reduce\n\ndef Ngcd(*numbers):\n return reduce(gcd, numbers)\nd = dict()\n\nfor i in range(1,A+1):\n for j in range(1,A+1):\n for k in range(1,A+1):\n tmp = ','.joi...
['Time Limit Exceeded', 'Runtime Error', 'Accepted']
['s361571543', 's385731763', 's896492209']
[63424.0, 9184.0, 9036.0]
[2208.0, 26.0, 1901.0]
[544, 194, 192]
p02713
u489155878
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\n\nK=int(input())+1\n\n\n\ndef pront(*n):\n if debug==1:\n print(n)\n \ndebug=1\n\n\nimport math as m\n\nZ=[ [ [-1 for i in range(K)] for j in range(K)] for l in range(K)]\ndef C_1(i,j,k):\n xx=[i,j,k]\n xx.sort()\n if Z[xx[0]][xx[1]][xx[2]]!=-1:\n return Z[xx[0]][xx[1]][xx[2]]\n ...
['Wrong Answer', 'Accepted']
['s191248170', 's731184523']
[75624.0, 9520.0]
[2208.0, 771.0]
[640, 551]
p02713
u493318999
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\nsum = 0\nk = int(input())\nfor i in range(1,k+1):\n for j in range(1,k+1):\n for m in range(1,k+1):\n print(i,j,m)\n l = math.gcd(i,j)\n sum += math.gcd(l,m)\nprint(sum)', 'import math\nsum = 0\nk = int(input())\nfor i in range(1,k+1):\n for j in range(1,k+1):\n if i <= j:\n f...
['Wrong Answer', 'Accepted']
['s806456791', 's425617945']
[23684.0, 9220.0]
[2244.0, 855.0]
[192, 430]
p02713
u497046426
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 functools import reduce\nfrom itertools import product\n\ndef gcd(a, b):\n while b: a, b = b, a % b\n return a\n\ndef gcd_list(A): return reduce(gcd, A)\n\nK = int(input())\nS = K * (K + 1) // 2\nfor a, b in combinations(range(1, K+1), 2):\n S += 6 * gcd(a, b)\nfor a, b, c in combinations(range(1, K+1),...
['Runtime Error', 'Accepted']
['s468350302', 's582186600']
[9560.0, 9624.0]
[24.0, 944.0]
[351, 356]
p02713
u500944229
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 combinations\nimport fractions\nn = int(input())\nans = 0\nfor r in range(1,4): \n if r>n:\n break\n for x in combinations([x+1 for x in range(n)],r):\n if len(x)==1:\n ans += x[0]\n elif len(x)==2:\n ans += fractions.gcd(x[0],x[1])*6\n el...
['Wrong Answer', 'Runtime Error', 'Wrong Answer', 'Runtime Error', 'Accepted']
['s200489391', 's208279509', 's236641531', 's450058031', 's794588138']
[10636.0, 9016.0, 9208.0, 9016.0, 9112.0]
[2206.0, 19.0, 711.0, 20.0, 677.0]
[397, 409, 377, 387, 388]
p02713
u508061226
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());\ngcd = o;\n\nfor a in range(K):\n aa = a + 1 ;\n \n for b in range(K):\n bb = b + 1;\n \n for c in range(K):\n cc = c + 1;\n gcd += math.gcd(aa,bb,cc);\n \nprint(gcd)\n \n ', 'from math import gcd\n \nK = int(input());\nsum = 0;\n\nfor a in range(1,K+1):\...
['Runtime Error', 'Wrong Answer', 'Runtime Error', 'Wrong Answer', 'Accepted']
['s047262501', 's544048433', 's831888933', 's886765552', 's535906289']
[9164.0, 8980.0, 8964.0, 9096.0, 9080.0]
[22.0, 1938.0, 22.0, 2205.0, 1772.0]
[218, 168, 168, 199, 168]
p02713
u509405951
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\ndef gcd_list(numbers):\n return reduce(fractions.gcd, numbers)\nK = int(input())\n\ncount=0\nfor i in range(1, K+1):\n for j in range(i, K+1):\n for k in range(j, K+1):\n if i == j and j == k...
['Time Limit Exceeded', 'Accepted']
['s519703143', 's669867314']
[10764.0, 89552.0]
[2206.0, 217.0]
[456, 124]
p02713
u509565254
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\nfrom itertools import product\nK=int(input())\ngcd=0.\nfor i in range(K):\n for j in range(K):\n a=math.gcd(i+1,j+1)\n for k in range(K):\n gcd+=math.gcd(a,k+1)\nprint(gcd) ', 'import math\nfrom functools import reduce\nfrom itertools import produ...
['Wrong Answer', 'Wrong Answer', 'Accepted']
['s292184532', 's933518585', 's732351619']
[9580.0, 9644.0, 9576.0]
[1490.0, 2206.0, 1507.0]
[234, 193, 239]
p02713
u509739538
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 queue\nfrom collections import defaultdict\n \ndef readInt():\n\treturn int(input())\ndef readInts():\n\treturn list(map(int, input().split()))\ndef readChar():\n\treturn input()\ndef readChars():\n\treturn input().split()\ndef factorization(n):\n\tres = []\n\tif n%2==0:\n\t\tres.append(2)\n\tfor ...
['Runtime Error', 'Accepted']
['s356028962', 's990746918']
[9716.0, 9732.0]
[27.0, 1465.0]
[1071, 1081]
p02713
u513519822
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())\nsumval = 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 g = math.gcd(math.gcd(a,b),c)\n sumval += g\nprint(sumval)', 'from math import gcd\nK = int(input())\nsumval = 0\nfor a in range(1, K+1):\n for b in rang...
['Runtime Error', 'Accepted']
['s413608890', 's410597193']
[9044.0, 9208.0]
[25.0, 1916.0]
[212, 184]
p02713
u514206029
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\ndef euclid(m,n):\n \n if m < n:\n m, n = n, m\n while n != 0:\n m, n = n, m % n\n return m\n\n\nnum = int(input('')) \nans_sum = 0\n\nfor a in range(1,num+1):\n for b in range(1,a):\n gcd_ab = euclid(a,num+1)\n for c in range(1,num+1):\n ans_sum = ans_sum + eu...
['Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Accepted']
['s266744675', 's717456916', 's993435191', 's903846688']
[9152.0, 9156.0, 9196.0, 9196.0]
[949.0, 1935.0, 979.0, 1828.0]
[496, 495, 492, 494]
p02713
u515647766
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 b > a:\n temp = b\n b = a\n a = temp\n if a % b == 0:\n return b\n else:\n return gcd(b, a % b)\n\ndef sum_of_gcd(k):\n ans = 0\n for i in range(1, k + 1):\n for j in range(1, k + 1):\n for k in range(1, k + 1):\n if i < j and j < k:\n ans += gcd(i, gcd(...
['Wrong Answer', 'Accepted']
['s040870594', 's890145004']
[9212.0, 9228.0]
[1533.0, 1578.0]
[501, 571]
p02713
u516566941
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.
['mport math\nk = int(input())\nans = 0\nfor i in range(1, k + 1):\n for j in range(1, k + 1):\n gcd1 = math.gcd(i, j)\n for l in range(1, k + 1):\n gcd2 = math.gcd(gcd1, l)\n ans += gcd2\nprint(ans)', 'import math\nk = int(input())\nans = 0\nfor i in range(1, k + 1):\n for j i...
['Runtime Error', 'Accepted']
['s590199318', 's277861125']
[8948.0, 9036.0]
[21.0, 1600.0]
[227, 228]
p02713
u517447467
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())\nGCD = [[math.gcd(i, j)-1 for i in range(1, N+1)] for j in range(1, N+1)]\n#print(GCD)\nall_gcd = [GCD[GCD[i][j]][m] for i in range(N) for j in range(N) for m in range(N)]\nprint(sum(all_gcd))', 'import math\nN = int(input())\nGCD = [[math.gcd(i, j) for i in range(1, 10)] for j in range(...
['Wrong Answer', 'Runtime Error', 'Accepted']
['s102357310', 's326931835', 's344586277']
[71888.0, 9192.0, 72032.0]
[797.0, 22.0, 920.0]
[217, 217, 217]
p02713
u517935948
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\n\nfor a in range(1, k+1):\n for b in range(1, a+1):\n for c in range(1, b+1):\n g_ab = fractions.gcd(a ,b)\n g_abc = fractions.gcd(g_ab, c)\n if a != b != c:\n ans += g_abc * 6\n elif a == b == c:\n ...
['Time Limit Exceeded', 'Accepted']
['s691734769', 's419181397']
[10620.0, 9196.0]
[2206.0, 543.0]
[390, 375]
p02713
u519452411
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 nampy as np\nk = int(input())\n\nans = 0\nfor a in range(1,k+1):\n for b in range(1,k+1):\n tmp = np.gcd(a,b)\n for c in range(1,k+1):\n ans += np.gcd(tmp,c)\n\nprint(ans)\n', 'from math import gcd\n\nk = int(input())\n\nans = 0\nfor a in range(1,k+1):\n for b in range(1,k+1):\n for c in range(...
['Runtime Error', 'Accepted']
['s246255481', 's686810566']
[9112.0, 9168.0]
[25.0, 1914.0]
[181, 164]
p02713
u519954660
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(*number):\n return reduce(math.gcd, number)\n\ndef gcd_list(number):\n return reduce(math.gcd, number)\n\nsum = 0\nK = int(input())\nfor i in range(1,K+1):\n for j in range(1,K):\n tmp = gcd(i, j)\n for k in range(1,K):\n sum += ...
['Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Accepted']
['s356231315', 's454096786', 's586802923', 's870212706']
[9640.0, 27060.0, 9644.0, 9568.0]
[2206.0, 106.0, 1404.0, 939.0]
[367, 18, 367, 463]
p02713
u524534026
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 as f\na = [1]*3\ntotal = 0\nfor i in range(1,k+1):\n total += f.gcd(a[0],a[1],a[i])\nfor i in range(1,k+1):\n total += f.gcd(a[0],a[i],a[2])\n if i == k:\n for j in range(1,k+1):\n total += f.gcd(a[0],a[i],a[j])\nfor i in range(1,k):\n total += f.gcd(a[...
['Runtime Error', 'Accepted']
['s127600007', 's701947573']
[10468.0, 9416.0]
[29.0, 72.0]
[536, 497]
p02713
u524922893
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(*numbers):\n return reduce(math.gcd, numbers)\nn=200\nans = 0\nfor 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,j,k))\nprint(ans)', 'import math\nfrom functools import reduce\ndef gcd(*numbers):\n ret...
['Time Limit Exceeded', 'Accepted']
['s119383900', 's431560123']
[9348.0, 9652.0]
[2206.0, 795.0]
[233, 387]
p02713
u525882286
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 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)\nprint(c)', 'from math import gcd\nk = int(input())\nans = 0\nfor a in range(1, k+1):\n for b in range(1, k+1):\n for c in range(1, k+1...
['Wrong Answer', 'Accepted']
['s303892069', 's470294289']
[9164.0, 9160.0]
[1957.0, 1919.0]
[175, 177]
p02713
u526407267
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=input()\na=1\nb=1\nc=1\ns=0\nfor p in range(k):\n b=1\n for q in range(k):\n c=1\n for i in range(k):\n g=math.gcd(a,b)\n g=math.gcd(g,c)\n s=s+g\n c=c+1\n b=b+1\n a=a+1\nprint(s)', 'import math\nk=200\ns=0\nfor p in range(k):\n for q in range(k):\n g=math.gcd(p+1,q+...
['Runtime Error', 'Wrong Answer', 'Accepted']
['s618067106', 's952594192', 's381429132']
[9128.0, 9040.0, 9088.0]
[21.0, 1740.0, 1676.0]
[209, 153, 162]
p02713
u527379148
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 colloctions import Counter\nfrom scipy import gcd\n \ndef sum_of_gcd(N):\n temp = [gcd(i, k) for i in range(1, N+1) for k in range(1, N+1)]\n counts = Counter(temp)\n return sum([gcd(i, c)*counts[c] for i in range(1, N+1) for c in counts.keys()])\n \nprint(sum_of_gcd(int(input())))', 'from colloctions import ...
['Runtime Error', 'Runtime Error', 'Accepted']
['s187143285', 's362814846', 's775597599']
[9064.0, 9024.0, 33924.0]
[20.0, 25.0, 275.0]
[282, 283, 287]
p02713
u529737989
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.
['# -*- coding: utf-8 -*-\n"""\nCreated on Sat Jul 11 16:48:51 2020\n\n@author: Aruto Hosaka\n"""\n\n\nimport math\n\nK = int(input())\nans = 0\nfor a in range(K):\n for b in range(K):\n for c in range(K):\n g = math.gcd(a+1, b+1)\n ans += math.gcd(g,c+1)', '# -*- coding: utf-8 -*-\n"""\nCreated on Sat Ju...
['Wrong Answer', 'Accepted']
['s501139924', 's341921970']
[9116.0, 9628.0]
[2206.0, 54.0]
[251, 356]
p02713
u531599639
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()\nK=int(K)\nimport fractions\ndef gcd(a,b,c):\n return fractions.gcd(fractions.gcd(a,b),c)\nm=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 m=m+gcd(i,j,k)\nprint(m)', 'import math\nK = int(input())\nm = 0\nfor i in range(1, K+1):\n for j in range(1, K+1):\n for k...
['Time Limit Exceeded', 'Runtime Error', 'Accepted']
['s380324230', 's958254841', 's729089177']
[10580.0, 9168.0, 9176.0]
[2206.0, 23.0, 498.0]
[205, 145, 209]
p02713
u531631168
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.
['%%time\nimport math\nfrom functools import reduce\n\ndef gcd(*numbers):\n return reduce(math.gcd, numbers)\n\nk = int(input())\nans = 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 ans += gcd(a, b, c)\nprint(ans)', 'import math\nfrom functools import reduce\n\...
['Runtime Error', 'Wrong Answer', 'Accepted']
['s332644201', 's577429104', 's472378131']
[9012.0, 9580.0, 9476.0]
[20.0, 2206.0, 68.0]
[257, 253, 359]
p02713
u535171899
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())\n\ngcd_map = [[-1 for i in range(1,k+1)]for j in range(1,k+1)]\n\nans = 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 gcd_map[a-1][b-1]==-1:\n gab = fractions.gcd(a,b)\n gcd_map...
['Time Limit Exceeded', 'Accepted']
['s932232150', 's802180967']
[10920.0, 9484.0]
[2206.0, 1028.0]
[720, 336]
p02713
u536034761
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\nfrom functools import reduce\ndef gcds(numbers):\n return reduce(gcd, numbers)\nK = int(input())\nans = 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 ans += gcds(a, b, c)\nprint(ans)', 'from math import gcd\nfrom functools import reduce\ndef gcd...
['Runtime Error', 'Accepted']
['s483597615', 's899334779']
[9588.0, 9644.0]
[25.0, 790.0]
[245, 430]
p02713
u536560967
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\nk = int(input()) \nl = list(range(1, k + 1))\nans = 0\ndef gcd(*numbers):\n return reduce(fractions.gcd, numbers)\nfor v in itertools.product(l, repeat=3):\n ans += gcd(*list(v))\nprint(ans)', 'import math\nn = int(input())\nans = 0\nfor i in ran...
['Time Limit Exceeded', 'Accepted']
['s145629528', 's555343909']
[10732.0, 9184.0]
[2205.0, 1387.0]
[252, 183]
p02713
u537550206
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 fractions\nfrom functools import reduce\nk = int(input())\nnum = []\nfor i in range(1, k+1):\n num.append(i)\n num.append(i)\n num.append(i)\npermutation_num = set(itertools.permutations(num, 3))\nx = []\nfor j in permutation_num:\n y = reduce(fractions.gcd, j)\n x.append(y)\n\...
['Time Limit Exceeded', 'Runtime Error', 'Time Limit Exceeded', 'Accepted']
['s174991969', 's297289800', 's325765470', 's992830891']
[188280.0, 188420.0, 1868392.0, 71468.0]
[2210.0, 2210.0, 2262.0, 1520.0]
[317, 303, 329, 215]
p02713
u539969758
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(K))\n\nans = 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 tmp = math.gcd(a,b)\n ans += math.gcd(tmp, c)\n\nprint(ans)\n', 'import math\n\nK = int(input(K))\n\nans = 0\nfor a in range(1, K+1):\n for b in range(1, K+1):\n for c in range(...
['Runtime Error', 'Runtime Error', 'Accepted']
['s182684098', 's188781330', 's690584690']
[9048.0, 9120.0, 9324.0]
[22.0, 21.0, 51.0]
[186, 175, 706]
p02713
u544587633
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 solve(K: int):\n r = range(1, K+1)\n ans = 0\n d = {}\n\n for _ in it.product(r,r,r):\t\n a, b, c = sorted(_)\n _a, _b, _c = a, b, c\n while c:\n if d.get((b, c), False):\n b = d[(b, c)]\n break \n else:\n b, c = b...
['Wrong Answer', 'Accepted']
['s760308012', 's324094970']
[9156.0, 27472.0]
[21.0, 183.0]
[557, 1448]
p02713
u550146922
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 functools import reduce\n\nk = int(input())\n\nwa = 0\n\nfor a in range(1,k+1):\n for b in range(a+1,k+1):\n for c in range(b+1,k+1):\n li = [a,b,c]\n wa += reduce(math.gcd,li)*6\n\nfor a in range(1,k+1):\n for b in range(a+1,k+1):\n wa += math.gcd(a,b)*6\n\nfor a in ran...
['Runtime Error', 'Accepted']
['s006232116', 's636531417']
[9496.0, 9104.0]
[27.0, 1832.0]
[339, 175]
p02713
u552533086
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())\nsum_ = 1+N\n#sum_ = 0\nfor i in range(1, 1+N):\n for j in range(1, 1+N):\n a = math.gcd(i, j)\n for k in range(1, 1+N):\n sum_ += math.gcd(a, k)\n \nprint(sum_)', 'import math\nN = int(input())\n#sum_ = 1+N\nsum_ = 0\nfor i in range(1, 1+N):\n f...
['Wrong Answer', 'Accepted']
['s940974233', 's127319111']
[9116.0, 9140.0]
[1288.0, 1328.0]
[220, 220]
p02713
u556610039
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\nnum = int(input())\nans = 0\nfor a in num:\n for b in num:\n for c in num:\n ans += math.gcd(a, b, c)\nprint(ans)', 'import math\n\nnum = int(input())\nans = 0\nfor a in range(num):\n for b in range(num):\n temp = math.gcd(a + 1, b + 1)\n for c in range(num):\n ...
['Runtime Error', 'Accepted']
['s285582214', 's076016063']
[9168.0, 9176.0]
[21.0, 1444.0]
[141, 204]
p02713
u557792847
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 numpy as np\nimport math\n# for AtCoder\nimport fractions\nfrom collections import deque \nfrom functools import reduce\n\n# input = sys.stdin.readline\n\nn = int(input())\n\nsum = 0\n\ndef gcd_list(numbers):\n return reduce(fractions.gcd, numbers)\n\nfor i in range(1, n+1):\n for j in range(...
['Time Limit Exceeded', 'Time Limit Exceeded', 'Accepted']
['s068367833', 's259867909', 's879791244']
[27348.0, 27332.0, 30680.0]
[2206.0, 2206.0, 1418.0]
[391, 391, 435]
p02713
u558489851
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())\ns = 0\nfor a in range(1, k+1):\n for b in range(1, k+1):\n ab = math.gcd(a, b)\n for c in range(1, k+1):\n s += math.gcd(ab, c)\nprint(s)\n', 'import math\n\nk = int(input())\ns = 0\nfor a in range(1, k+1):\n for b in range(1, k+1):\n ab = math.gcd(a, b)\n ...
['Runtime Error', 'Accepted']
['s051046181', 's509170589']
[9176.0, 9012.0]
[20.0, 1316.0]
[177, 190]
p02713
u561294476
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\nSum = []\nfor a in range(1, K+1):\n for b in range(1, K + 1):\n for c in range(1, K + 1):\n gcd = gcd_list([a, b, c])\n Sum.append(gcd)\n\nprint(sum(Sum))', 'import math\n\nK = int(input())\n\nSum = []\nfor a in range(1, K+1):\n for b in range(1, K + 1):\n ...
['Runtime Error', 'Runtime Error', 'Accepted']
['s427009024', 's616836694', 's734415386']
[9140.0, 9020.0, 71512.0]
[25.0, 20.0, 1624.0]
[197, 238, 238]
p02713
u563676207
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# input\nK = int(input())\n\n# process\ngcdl = []\nfor i in range(K):\n l = []\n for j in range(K):\n l.append(math.gcd(i+1, j+1))\n gcdl.append(l)\nprint(gcdl)\n\nans = 0\nfor a in range(K):\n for b in range(a, K):\n for c in range(b, K):\n print([a, b, c])\n ...
['Wrong Answer', 'Accepted']
['s869204835', 's095848046']
[22568.0, 9436.0]
[1514.0, 526.0]
[595, 599]
p02713
u564525445
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, os, math\n \n def get_cd(n):\n cd = []\n for i in range(1, int(n/2)+1):\n if n % i == 0:\n cd.append(i)\n else:\n continue\n cd.append(n)\n return cd\n \n def get_gcd(a, b, c, cd_d):\n if 1 in [a, b, c...
['Runtime Error', 'Accepted']
['s244218114', 's443633208']
[8996.0, 9172.0]
[22.0, 1928.0]
[1049, 889]
p02713
u568334289
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\n\nn = int(sys.argv[1])\ntotal = 0\n\ndef gcd(a,b):\n\tif b == 0:\n\t\treturn a\n\n\treturn gcd(b, a % b)\n\ntotal = total + n * (n+1) / 2\n\nfor i in range(n):\n\tfor j in range(i+1,n):\n\t\ttotal = total + 6 * gcd(j+1,i+1)\n\nfor i in range(n):\n\tfor j in range(i+1,n):\n\t\tfor k in range(j+1,n):\n\t\t\...
['Runtime Error', 'Runtime Error', 'Accepted']
['s114194698', 's348183702', 's095336339']
[9160.0, 9160.0, 9208.0]
[23.0, 24.0, 1288.0]
[413, 399, 405]
p02713
u568559987
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 gcd(a, b, c):\n g = gcd(a, b)\n return gcd(g, c)\n\nK = int(input())\nans = 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 ans += gcd(i, j, k)\n\nprint(ans)\n', 'from math import gcd\n\nK = int(input())\nans = 0\n\nfor i in ran...
['Runtime Error', 'Accepted']
['s927246951', 's480291807']
[9172.0, 9064.0]
[22.0, 1798.0]
[234, 181]
p02713
u571395477
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(*numbers):\n r = reduce(math.gcd, numbers)\n return r\n\ndef main():\n K = int(input())\n l = []\n for i in range(1, K+1, 1):\n for j in range(1, K+1, 1):\n g = gcd(i, j, i*j)\n l.append(g)', 'import math\nfrom fu...
['Wrong Answer', 'Runtime Error', 'Wrong Answer', 'Wrong Answer', 'Accepted']
['s262585582', 's312085467', 's900932789', 's932810376', 's669171969']
[9536.0, 9044.0, 9912.0, 9636.0, 9572.0]
[24.0, 21.0, 39.0, 35.0, 1386.0]
[281, 315, 318, 279, 330]
p02713
u572142121
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\n\nif K==1:\n print(1)\n exit()\nelif K==2:\n print(8)\n exit()\nelse:\n t=0\n for i in range(1,K-1):\n for j in range(i+1,K):\n for k in range(j+1,K+1):\n a=math.gcd(i,j)\n b=math.gcd(a,k)\n t+=b\n tw=0\n for i in range(1,K):\n for j in range(i+1,K+...
['Wrong Answer', 'Accepted']
['s415310831', 's144097123']
[9228.0, 9216.0]
[475.0, 470.0]
[402, 403]
p02713
u573673983
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 math\nfrom functools import reduce\ndef gcd_list(numbers):\n return reduce(math.gcd, numbers)\ntmp_sum = 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 tmp_list = [i,j,k]\n tmp_sum += gcd_list(tmp_list)\nprint(tmp_sum)', 'K = int(input())\nimpor...
['Runtime Error', 'Accepted']
['s009259972', 's435046842']
[10340.0, 9632.0]
[32.0, 762.0]
[280, 489]
p02713
u574590381
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 \nres=0\n \nfor n in range(1,k+1):\n for i in range(1,k+1):\n for j in range(1,k+1):\n\n res+=math.gcd(gcd(n,i),j)\n\nprint(res)', 'k=int(input())\n\nfrom math import gcd\n \nres=0\n \nfor n in range(1,k+1):\n for i in range(1,k+1):\n for j in range(1,k+1...
['Runtime Error', 'Runtime Error', 'Accepted']
['s165360657', 's967137889', 's842824758']
[9180.0, 9180.0, 9120.0]
[21.0, 19.0, 1967.0]
[169, 183, 173]
p02713
u580362735
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 = 200\nans = 0\nfor i in range(1,K+1):\n for j in range(1,K+1):\n tmp = math.gcd(i,j)\n for k in range(1,K+1):\n ans += math.gcd(tmp,k)\nprint(ans)', 'import math\nK = 200\nans = 0\nfor i in range(1,K+1):\n for j in range(1,K+1):\n tmp = math.gcd(i,j)\n for k in range(1,K+1):\n ...
['Wrong Answer', 'Wrong Answer', 'Time Limit Exceeded', 'Accepted']
['s000490981', 's042065512', 's647742675', 's950738941']
[9112.0, 9148.0, 9352.0, 9208.0]
[1847.0, 1199.0, 2206.0, 1290.0]
[168, 214, 222, 177]
p02713
u581403769
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 = 0\nfor i in range(k + 1):\n for j in range(k + 1):\n for l in range(k + 1):\n for m in range(k, 0, -1):\n if i % m == 0 and j % m == 0 and l % m == 0:\n ans += m\n \nprint(ans)', 'k = int(input())\n\nans = 0\nfor i in ...
['Wrong Answer', 'Wrong Answer', 'Accepted']
['s699403644', 's891010998', 's949448403']
[9156.0, 9020.0, 8968.0]
[2206.0, 2206.0, 1512.0]
[266, 492, 230]
p02713
u583200093
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\nsum = 0\nK = input()\nfor k in range(K):\n for j in range(K):\n for i in range(K):\n sum = sum + gcd(math.gcd(k+1,j+1),i+1)\nprint(sum)', 'import math\nsum = 0\nK = int(input())\nfor k in range(K):\n for j in range(K):\n for i in range(K):\n sum = sum + gcd(math.gcd(k+1,j+1),i+1)\nprint...
['Runtime Error', 'Runtime Error', 'Wrong Answer', 'Runtime Error', 'Accepted']
['s447447576', 's623698011', 's905470744', 's984306961', 's408047382']
[9036.0, 9116.0, 9476.0, 9036.0, 9180.0]
[24.0, 24.0, 26.0, 23.0, 1203.0]
[150, 155, 244, 150, 170]
p02713
u585963734
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())\nS=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 S+=gcd(gcd(i,j),k)\n\nprint(S)', 'from math import gcd \n\nK=int(input())\nS=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 S+=gcd(gcd(i,j),k)\n\nprint(S)...
['Runtime Error', 'Accepted']
['s852727341', 's965363826']
[9108.0, 9164.0]
[23.0, 1885.0]
[142, 152]
p02713
u586857375
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())\nplus = 0\nfor i in range(1, K+1):\n\tfor a in range(1, K+1):\n \tx = gcd(i, a)\n \tfor j in range(1, K+1):\n plus += gcd(x, j)\nprint(plus)', 'from math import gcd\nK = int(input())\nplus = 0\nfor a in range(1, K+1):\n for b in range(1, K+1):\n temp =...
['Runtime Error', 'Accepted']
['s715409020', 's385404230']
[8960.0, 9184.0]
[21.0, 552.0]
[185, 266]
p02713
u588575394
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())\ng = 0\nfor i in range(1, K+1):\n for j in range(1, i+1):\n for k in range(1, j+1):\n a = fractions.gcd(i, j)\n b = fractions.gcd(a, k)\n if i != j != k:\n g += b*6\n elif i == j == k:\n g += b\n ...
['Time Limit Exceeded', 'Time Limit Exceeded', 'Time Limit Exceeded', 'Time Limit Exceeded', 'Time Limit Exceeded', 'Accepted']
['s080250552', 's262830856', 's544628749', 's608773550', 's617119580', 's672330302']
[10648.0, 587584.0, 60400.0, 594140.0, 149860.0, 105376.0]
[2206.0, 2222.0, 2207.0, 2222.0, 2209.0, 896.0]
[357, 247, 568, 270, 516, 342]
p02713
u590198086
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())\nval = 0\nfor i in range(1,k+1):\n for j in range(1,k+1):\n for a in range(1,k+1):\n val+=gcd(i,gcd(j,a))', 'from math import gcd\nk = int(input())\nval = 0\nfor i in range(1,k+1):\n for j in range(1,k+1):\n for a in range(1,k+1):\n val+=gcd(i,gcd(j,a))\nprint(...
['Wrong Answer', 'Accepted']
['s770871041', 's487845641']
[9176.0, 9164.0]
[1951.0, 1998.0]
[147, 159]
p02713
u590230319
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 = 200\n\ndef gcd(*numbers):\n return reduce(math.gcd, numbers)\n\nans = 0\n\nfor i in range(1, K+1):\n for j in range(i, K+1):\n for k in range(j, K+1):\n if i == j and j ==k:\n ans += i\n elif i==j or j==k or i==k:\n ...
['Wrong Answer', 'Accepted']
['s713250098', 's751985312']
[9568.0, 9632.0]
[913.0, 828.0]
[399, 408]
p02713
u596368396
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\nK = int(input())\n\ndef gcd(*nums):\n return reduce(fractions.gcd, nums)\n\ns = 0\nfor a in range(1,K+1):\n for b in range(1,a+1):\n for c in range(1,b+1):\n if a == b and b == c:\n s += gcd(a,b,c)\n elif a == b or a == ...
['Time Limit Exceeded', 'Accepted']
['s805223225', 's094835887']
[10684.0, 9632.0]
[2206.0, 848.0]
[417, 407]
p02713
u597455618
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 functools import reduce\n\ndef gcd(m, n):\n r = m % n\n return gcd(n, r) if r else n\n\ndef mgcd(*a):\n return reduce(gcd, a)\n\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 tmp = mgcd(i, j, l)\n if i == j== k:\n ans += tmp...
['Wrong Answer', 'Runtime Error', 'Accepted']
['s694532608', 's872129799', 's345326386']
[9612.0, 9016.0, 9176.0]
[2206.0, 22.0, 1822.0]
[346, 345, 170]
p02713
u598812605
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())\nfrom fractions import gcd\nans = 0\nfor i in range(1, K + 1):\n for j in range(1, K + 1):\n tmp_gcd = gcd(i, j)\n for k in range(1, K + 1):\n ans += gcd(tmp_gcd, k)\nprint(ans)', 'import math\nK = int(input())\nans = 0\nfor i in range(1, K + 1):\n for j in range(i, K +...
['Time Limit Exceeded', 'Accepted']
['s815966292', 's557658777']
[10644.0, 9196.0]
[2206.0, 663.0]
[214, 409]
p02713
u600261652
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 resolve():\n N = int(input())\n ans = []\n for i in range(1, N+1):\n for j in range(1, N+1):\n for p in range(1, N+1):\n count = [1]\n for q in range(2, min(i, j, p)+1):\n if i%q == 0 and j%q == 0 and p%q == 0:\n co...
['Wrong Answer', 'Wrong Answer', 'Accepted']
['s690630123', 's736209422', 's980714914']
[9112.0, 9152.0, 71488.0]
[22.0, 23.0, 1881.0]
[388, 389, 268]
p02713
u601575292
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 mapint_inp():\n return map(int, input().split())\n\ndef intinp():\n return int(input())\n\nimport math\nfrom functools import reduce\nimport itertools\n\nK = intinp()\n\ndef gcd(*num):\n return reduce(math.gcd, num)\n\nans = 0\nfor i in range(1, K+1):\n if i ==1:\n ans += 1\n continue\n ...
['Runtime Error', 'Accepted']
['s535533850', 's212193687']
[9004.0, 9200.0]
[22.0, 1422.0]
[525, 311]
p02713
u604269317
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(*numbers):\n return reduce(math.gcd, numbers)\ngcd_list=[]\ni=int(input())\nfor x in range(i):\n for y in range(i):\n for z in range(i):\n gcd_list.append(gcd(x, y, z))\nprint(sum(gcd_list))\n \n ', 'from math import gcd\nk=int(input())\nans=0...
['Wrong Answer', 'Accepted']
['s161848133', 's143659348']
[49212.0, 9116.0]
[2207.0, 1146.0]
[258, 184]
p02713
u606045429
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 numba import njit\nfrom math import gcd\n\nK = int(input())\n\n@njit\ndef solve():\n ans = 0\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 ans += gcd(gcd(a, b), c)\n\n print(ans)', 'from numba import njit\nfrom math import gcd\n\nK...
['Wrong Answer', 'Accepted']
['s692966447', 's981425483']
[91724.0, 111600.0]
[363.0, 687.0]
[252, 267]
p02713
u607563136
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\n\nk = int(input())\nans = 0\n\nfor a in range(1,k+1):\n if i == 1:\n ans += k*k\n continue\n for b in range(1,k+1):\n n = math.gcd(a,b)\n if n == 1:\n ans += k\n continue\n for c in range(1,k+1):\n ans += math.gcd(n,c)\nprint(ans)', ...
['Runtime Error', 'Runtime Error', 'Runtime Error', 'Runtime Error', 'Accepted']
['s661246228', 's760965757', 's865637906', 's901951872', 's324328230']
[9008.0, 9172.0, 9168.0, 9096.0, 9084.0]
[26.0, 24.0, 26.0, 25.0, 1190.0]
[299, 166, 227, 301, 188]
p02713
u611033537
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\n\nfor s in range(1,k+1):\n\tfor t in range(1,k+1):\n \t\tfor u in range(1, k+1):\n\t\t\tans += gcd(gcd(s,t),u)\nprint(ans)', 'from math import gcd\nk = int(input())\nans = 0\n \nfor s in range(1,k+1):\n for t in range(1,k+1):\n for u in range(1, k+1):\n ans +...
['Runtime Error', 'Accepted']
['s646721274', 's042753568']
[9028.0, 9180.0]
[21.0, 1916.0]
[158, 163]
p02713
u614073932
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 b == 0 or b == 1:\n return b\n return gcd(b, a % b)\n\nif __name__ == '__main__':\n N = int(input())\n total = 0\n for i in range(1, N + 1):\n for j in range(i + 1, N + 1):\n for k in range(j + 1, N + 1):\n total += gcd(k, gcd(j, i))\n prin...
['Wrong Answer', 'Runtime Error', 'Runtime Error', 'Accepted']
['s045446312', 's084494133', 's728698205', 's072257327']
[9180.0, 9120.0, 9064.0, 15744.0]
[803.0, 20.0, 22.0, 1518.0]
[315, 332, 332, 377]
p02713
u614181788
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\na=int(input())\nA=[]\nfor i in range(a):\n A.extend(str(i+1))\n\nli=list(itertools.combinations_with_replacement(A, 3))\ns = 0\nfor lis in li:\n a = int(lis[0])\n b = int(lis[1])\n c = int(lis[2])\n \n for i in range(min(a,b,c)):\n if a%(i+1) == 0 and b%(i+1) == 0 and c%(i+1...
['Wrong Answer', 'Runtime Error', 'Accepted']
['s178726916', 's447046151', 's572838127']
[1433256.0, 9184.0, 105968.0]
[2250.0, 25.0, 1538.0]
[509, 259, 596]
p02713
u614320306
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\nif K == 1:\n print(1)\n \ndef f(K):\n s = 0\n count = 0\n for i in range(2,K+1):\n if K % i != 1:\n s += i\n count += 1\n return 3*K + s - count \n \nelse:\n ans = 0\n for i in range(2,K+1):\n ans += f(K)\n print(ans)', 'K = int(input())\n \nimport math\n\nans = 0\na = ...
['Runtime Error', 'Accepted']
['s201533150', 's433440321']
[8968.0, 8988.0]
[23.0, 1462.0]
[247, 188]
p02713
u617037231
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())\nL = [4680225, 4806225, 4876132,4983108,5081415, 5192101, 5280120, 5414682, 5490193, 5586549,5682696, 5818120, 5910951, 6044601, 6125932, 6241626, 6369993, 6476209, 6561540, 6732588,6826435, 6961953, 7083840, 7210858, 7302369, 7448493, 7574128, 7725096, 7843815, 7965721, 8063628, 8269314...
['Wrong Answer', 'Accepted']
['s293565717', 's275235056']
[9244.0, 9384.0]
[322.0, 20.0]
[719, 1674]
p02713
u619809897
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\ngcd = lambda a,b : a if b == 0 else gcd(b, a % b)\ngcd3 = lambda a,b,c = gcd(c, gcd(a,b))\n\nprint(sum(list(map(lambda: x,y,z: gcd3(x,y,z), list(range(1,K+1))))))', 'from math import gcd\nK = int(input())\nr = range(1,K+1)\nprint(sum(gcd(gcd(a,b),c)for a in r for b in r for c in r))']
['Runtime Error', 'Accepted']
['s419871377', 's596185487']
[8952.0, 9088.0]
[24.0, 1316.0]
[177, 114]
p02713
u620238824
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\ndef main():\n K=int(input())\n ans=0\n for a in range(1,K+1):\n for b in range(1,K+1):\n p=gcd(a,b)\n if p==1:\n ans+=p*K\n else:\n for c in range(1,K+1):\n ans+=gcd(p,c)\n print(ans)', 'from mat...
['Wrong Answer', 'Runtime Error', 'Accepted']
['s472423370', 's611459148', 's847307908']
[9124.0, 9064.0, 9148.0]
[22.0, 20.0, 1809.0]
[294, 292, 174]
p02713
u624617831
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.
['\nimport fractions\nfrom functools import reduce\n\n\nk = int(input())\n\ndef gcd(*numbers):\n return reduce(fractions.gcd, numbers)\n\nk += 1\nans = 0\n\n\n# for j in range(i,k):\n# #print(i,j)\n\n# ans += gcd(i,j)\n# else:\n# ans += gcd(i,j)*6\n\nfor i in range(1,k):\n f...
['Wrong Answer', 'Time Limit Exceeded', 'Accepted']
['s086812216', 's636336584', 's267829438']
[10588.0, 10680.0, 9504.0]
[2205.0, 2206.0, 651.0]
[464, 457, 446]
p02713
u625495026
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, itertools\nfrom functools import reduce\ndef gcd_list(numbers):\n return(reduce(math.gcd,numbers))\nk=int(input())\nans=0\nfor numbers in itertools.combinations_with_replacement(range(1,k+1),3):\n a,b,c=numbers\n if a==b==c:\n ans+=gcd_list(numbers)\n elif a!=b and a!=c:\n ans+=...
['Wrong Answer', 'Accepted']
['s296917878', 's008656939']
[9592.0, 9556.0]
[804.0, 872.0]
[380, 389]
p02713
u625864724
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())\ndef gcd1 (a, b):\n while True:\n if (a < b):\n a, b = b, a\n c = a%b\n if (c == 0):\n return (b)\n else:\n a = b\n b = c\n\ndef gcd2 (a, b, c):\n tmp = gcd1(a, b)\n ans = gcd1(tmp, c)\n return (ans)\n\ncount = 0\nfor...
['Runtime Error', 'Runtime Error', 'Runtime Error', 'Accepted']
['s243562270', 's611410759', 's929841647', 's163838643']
[9224.0, 9112.0, 9168.0, 9116.0]
[23.0, 24.0, 24.0, 1078.0]
[625, 625, 454, 626]
p02713
u626228246
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\nfor i in range(1,K+1):\n\tfor j in range(1,K+1):\n\t\tfor n in range(1,K+1):\n\t\t\ttmp = fractions.gcd(i,j)\n\t\t\tans += fractions.gcd(tmp,n)\nprint(ans)', 'import math\nK = int(input())\nans = 0\nfor i in range(1,K+1):\n\tfor j in range(1,K+1):\n\t\ttmp = math.gcd(i,j)\...
['Time Limit Exceeded', 'Accepted']
['s468232445', 's782165239']
[10560.0, 9140.0]
[2206.0, 1323.0]
[183, 167]
p02713
u626467464
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())\nbox = []\nfor i in range(1,k+1):\n for j in range(1,k+1):\n gap = math.gcd(i,j)\n if gap == 1:\n box.append(1*k)\n else:\n for l in range(1,k+1):\n gap2 = math.gcd(gap,l)\n box.append(gap2) \nprint(sum(box))\nprint(box)', 'import math\nk = int(in...
['Wrong Answer', 'Accepted']
['s738192953', 's588294273']
[55448.0, 33320.0]
[939.0, 717.0]
[278, 268]