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
|
---|---|---|---|---|---|---|---|---|---|---|
p03633 | u092926023 | 2,000 | 262,144 | We have N clocks. The hand of the i-th clock (1≤i≤N) rotates through 360° in exactly T_i seconds. Initially, the hand of every clock stands still, pointing directly upward. Now, Dolphin starts all the clocks simultaneously. In how many seconds will the hand of every clock point directly upward again? | ['n_in = int(input()) \nl = [int(input()) for i in range(n_in)] \n\np = l[0]\nfor i in range(1, len(l)):\n q = l[i]\n\n if p >= q:\n m = p\n n = q\n else:\n m = q\n n = p\n\n while True:\n mod_value = m % n\n\n if mod_value == 0:\n n = mod_value\n break\n\n m = n\n n = mod_value\n\n p = int(p*q/n)\n\nprint(p)', 'n_in = int(input()) \nt = [int(input()) for i in range(n_in)] \n\np = t[0]\nfor i in range(1, len(t)):\n q = t[i]\n\n if p >= q:\n m, n = p, q\n else:\n m, n = q, p\n\n while True:\n mod_value = m % n\n if mod_value == 0:\n break\n\n m = n\n n = mod_value\n\n p = p//n * q\n\nprint(p)'] | ['Runtime Error', 'Accepted'] | ['s786869100', 's729015797'] | [3060.0, 3064.0] | [17.0, 17.0] | [376, 331] |
p03633 | u094191970 | 2,000 | 262,144 | We have N clocks. The hand of the i-th clock (1≤i≤N) rotates through 360° in exactly T_i seconds. Initially, the hand of every clock stands still, pointing directly upward. Now, Dolphin starts all the clocks simultaneously. In how many seconds will the hand of every clock point directly upward again? | ['from fractions import gcd\n\nn=int(input())\nt=[int(input()) for i in range(n)]\n\nfor i in range(1,n):\n lcm=(t[i]*t[i-1]//gcd(t[i],t[i-1]))\n t[i]=lcm\nprint(lcm)', 'from fractions import gcd\n\nn=int(input())\nt=[int(input()) for i in range(n)]\n\nfor i in range(0,n-1):\n lcm=(t[i]*t[i+1]//gcd(t[i],t[i+1]))\n t[i+1]=lcm\nprint(lcm)', 'from math import gcd\n\nn=int(input())\n\nlcm=0\nfor i in range(n):\n t=int(input())\n if lcm==0:\n lcm=t\n else:\n lcm=(t*lcm)//gcd(t,lcm)\n\nprint(lcm)'] | ['Runtime Error', 'Runtime Error', 'Accepted'] | ['s130052347', 's221315658', 's155146205'] | [5688.0, 5688.0, 9084.0] | [51.0, 51.0, 29.0] | [162, 166, 150] |
p03633 | u102461423 | 2,000 | 262,144 | We have N clocks. The hand of the i-th clock (1≤i≤N) rotates through 360° in exactly T_i seconds. Initially, the hand of every clock stands still, pointing directly upward. Now, Dolphin starts all the clocks simultaneously. In how many seconds will the hand of every clock point directly upward again? | ['N = int(input())\n\ndef gcd(a,b):\n while b:\n a,b = b,a%b\n return a\n\nanswer = 0\nfor _ in range(N):\n answer = gcd(answer, int(input())\n \nprint(answer)', 'N = int(input())\n\ndef gcd(a,b):\n while b:\n a,b = b,a%b\n return a\n\nanswer = 0\nfor _ in range(N):\n x = int(input())\n answer *= x//gcd(answer, x)\n \nprint(answer)', 'N = int(input())\n\ndef gcd(a,b):\n while b:\n a,b = b,a%b\n return a\n\nanswer = 1\nfor _ in range(N):\n x = int(input())\n answer *= x//gcd(answer, x)\n \nprint(answer)'] | ['Runtime Error', 'Wrong Answer', 'Accepted'] | ['s422240989', 's835846220', 's151559449'] | [2940.0, 2940.0, 3060.0] | [18.0, 17.0, 17.0] | [166, 179, 179] |
p03633 | u104282757 | 2,000 | 262,144 | We have N clocks. The hand of the i-th clock (1≤i≤N) rotates through 360° in exactly T_i seconds. Initially, the hand of every clock stands still, pointing directly upward. Now, Dolphin starts all the clocks simultaneously. In how many seconds will the hand of every clock point directly upward again? | ['N = int(input())\n\na_list = []\nfor _ in range(N):\n a_list.append(int(input())\n\ndef gcd(a, b):\n if a < b:\n a, b = b, a\n if b == 0:\n return a\n c = a % b\n return gcd(b, c)\n\nres = 1\nfor i in range(N):\n d = gcd(res, a_list[i])\n res = res // d\n res = res * a_list[i]\n\nprint(res) \n ', 'N = int(input())\n \na_list = []\nfor _ in range(N):\n a_list.append(int(input()))\n \ndef gcd(a, b):\n if a < b:\n a, b = b, a\n if b == 0:\n return a\n c = a % b\n return gcd(b, c)\n \nres = 1\nfor i in range(N):\n d = gcd(res, a_list[i])\n res = res // d\n res = res * a_list[i]\n \nprint(res) '] | ['Runtime Error', 'Accepted'] | ['s152455701', 's009551735'] | [2940.0, 3064.0] | [17.0, 17.0] | [312, 315] |
p03633 | u112465297 | 2,000 | 262,144 | We have N clocks. The hand of the i-th clock (1≤i≤N) rotates through 360° in exactly T_i seconds. Initially, the hand of every clock stands still, pointing directly upward. Now, Dolphin starts all the clocks simultaneously. In how many seconds will the hand of every clock point directly upward again? | ['def gcd(a,b):\n a=min(a,b)\n b=max(a,b)\n while b:\n a,b= b, a%b\n return a\n\ndef lcm(a,b):\n return a*b//gcd(a,b)\n\nN=int(input())\nfor i in range(N):\n T.append(int(input()))\n\nans=1\nfor t in range(N):\n ans=lcm(ans,T[i])\n \nprint(ans)', 'def gcd(a,b):\n #a=min(a,b)\n #b=max(a,b)\n while b:\n a,b= b, a%b\n return a\n\ndef lcm(a,b):\n return a*b//gcd(a,b)\nT=[]\nN=int(input())\nfor i in range(N):\n T.append(int(input()))\n\nans=1\nfor t in T:\n ans=lcm(ans, t)\n\nprint(int(ans))'] | ['Runtime Error', 'Accepted'] | ['s306924390', 's460366555'] | [3060.0, 3060.0] | [17.0, 17.0] | [263, 253] |
p03633 | u114920558 | 2,000 | 262,144 | We have N clocks. The hand of the i-th clock (1≤i≤N) rotates through 360° in exactly T_i seconds. Initially, the hand of every clock stands still, pointing directly upward. Now, Dolphin starts all the clocks simultaneously. In how many seconds will the hand of every clock point directly upward again? | ['def gcd(x, y):\n while(x % y != 0 and y % x != 0):\n if(x > y):\n x = x % y\n else:\n y = y % x\n if(x > y):\n return y\n else:\n return x\n \nN = int(input())\nA = list()\nfor i in range(N):\n A.append(int(input()))\n\nans = 1\nfor i in range(N):\n gcd_i = gcd(A[i], ans)\n print(gcd_i)\n ans = A[i] * ans // gcd_i\n \nprint(ans)', 'def gcd(x, y):\n while(x % y != 0 and y % x != 0):\n if(x > y):\n x = x % y\n else:\n y = y % x\n if(x > y):\n return y\n else:\n return x\n \nN = int(input())\nA = list()\nfor i in range(N):\n A.append(int(input()))\nfor i in range(N):\n ans = 1\n gcd_i = gcd(A[i], ans)\n ans = A[i] * ans // gcd_i\n \nprint(ans)', 'def gcd(x, y):\n while(x % y != 0 and y % x != 0):\n if(x > y):\n x = x % y\n else:\n y = y % x\n if(x > y):\n return y\n else:\n return x\n \nN = int(input())\nA = list()\nfor i in range(N):\n A.append(int(input()))\n\nans = 1\nfor i in range(N):\n gcd_i = gcd(A[i], ans)\n ans = A[i] * ans // gcd_i\n \nprint(ans)\n'] | ['Wrong Answer', 'Wrong Answer', 'Accepted'] | ['s163389912', 's192525657', 's636554485'] | [3064.0, 3064.0, 3060.0] | [18.0, 20.0, 18.0] | [339, 325, 325] |
p03633 | u116002573 | 2,000 | 262,144 | We have N clocks. The hand of the i-th clock (1≤i≤N) rotates through 360° in exactly T_i seconds. Initially, the hand of every clock stands still, pointing directly upward. Now, Dolphin starts all the clocks simultaneously. In how many seconds will the hand of every clock point directly upward again? | ['def main():\n N = int(input())\n T = []\n for _ in range(N):\n T.append(int(input()))\n\n if N == 1: return 0\n\n g = T[0]\n ans = T[0]\n for t in T[1:]:\n gc = gcd(t, g)\n g = g*t//gc\n return g\n\ndef gcd(a, b):\n if a > b:\n a, b = b, a\n if a == 0: return b\n else: return gcd(b%a, a)\n\n', "def main():\n N = int(input())\n T = []\n for _ in range(N):\n T.append(int(input()))\n\n if N == 1: return T[0]\n\n g = T[0]\n ans = T[0]\n for t in T[1:]:\n gc = gcd(t, g)\n g = g*t//gc\n return g\n\ndef gcd(a, b):\n if a > b:\n a, b = b, a\n if a == 0: return b\n else: return gcd(b%a, a)\n\n\n\n\nif __name__ == '__main__':\n print(main())"] | ['Wrong Answer', 'Accepted'] | ['s057050312', 's978368276'] | [3060.0, 3064.0] | [18.0, 18.0] | [332, 382] |
p03633 | u120810144 | 2,000 | 262,144 | We have N clocks. The hand of the i-th clock (1≤i≤N) rotates through 360° in exactly T_i seconds. Initially, the hand of every clock stands still, pointing directly upward. Now, Dolphin starts all the clocks simultaneously. In how many seconds will the hand of every clock point directly upward again? | ['from functools import reduce\n\ndef gcd(a, b):\n if b == 0:\n return a\n return gcd(b, a % b)\n\ndef lcm(a, b):\n return a * b // gcd(a, b)\n\nn = int(input())\nt = [int(input()) for i in range(n)]\n\nx = reduce(t, lcm)\n\nprint(x)\n\n', 'from functools import reduce\n\ndef gcd(a, b):\n if b == 0:\n return a\n return gcd(b, a%b)\n\ndef lcm(a, b):\n return a * b // gcd(a, b)\n\nn = int(input())\nt = [int(input()) for i in range(n)]\n\nans = reduce(lcm, t)\nprint(ans)'] | ['Runtime Error', 'Accepted'] | ['s715476932', 's995307700'] | [3700.0, 3572.0] | [36.0, 23.0] | [224, 223] |
p03633 | u123756661 | 2,000 | 262,144 | We have N clocks. The hand of the i-th clock (1≤i≤N) rotates through 360° in exactly T_i seconds. Initially, the hand of every clock stands still, pointing directly upward. Now, Dolphin starts all the clocks simultaneously. In how many seconds will the hand of every clock point directly upward again? | ['n=int(input())\nans=1\nfor i in range(n):\n t=int(input())\n print(t)\n ans=lcm(ans,t)\nprint(ans)', 'def gcd(a,b): return a if b==0 else gcd(b,a%b)\ndef lcm(a,b): return a*b//gcd(a,b)\nn=int(input())\nans=1\nfor i in range(n):\n t=int(input())\n print(t)\n ans=lcm(ans,t)\nprint(ans)', 'def gcd(a,b): return a if b==0 else gcd(b,a%b)\ndef lcm(a,b): return a*b//gcd(a,b)\nn=int(input())\nans=1\nfor i in range(n):\n t=int(input())\n ans=lcm(ans,t)\nprint(ans)'] | ['Runtime Error', 'Wrong Answer', 'Accepted'] | ['s654197429', 's691308668', 's089399915'] | [2940.0, 3060.0, 2940.0] | [17.0, 18.0, 17.0] | [101, 183, 170] |
p03633 | u123824541 | 2,000 | 262,144 | We have N clocks. The hand of the i-th clock (1≤i≤N) rotates through 360° in exactly T_i seconds. Initially, the hand of every clock stands still, pointing directly upward. Now, Dolphin starts all the clocks simultaneously. In how many seconds will the hand of every clock point directly upward again? | ['import fractions\n\nN = int(input())\nT = []\n\nfor i in range(N):\n T.append(int(input()))\n\nT.sort\na = T[0]\n\nfor i in range(N-1):\n gcd = fractions.gcd(a, T[i+1])\n a = int(a * T[i+1] / gcd)\n\nprint(int(a)) \n', 'N = int(input())\nT = []\n\nfor i in range(N):\n T.append(int(input()))\n\na = 1\n\ndef gcd(a,b):\n if b == 0:\n return a\n return gcd(b,a%b)\n\nfor i in range(N):\n a = a * T[i] // gcd(a,T[i])\n\nprint(a)\n'] | ['Runtime Error', 'Accepted'] | ['s837673469', 's588041716'] | [5048.0, 3060.0] | [36.0, 17.0] | [209, 209] |
p03633 | u124762318 | 2,000 | 262,144 | We have N clocks. The hand of the i-th clock (1≤i≤N) rotates through 360° in exactly T_i seconds. Initially, the hand of every clock stands still, pointing directly upward. Now, Dolphin starts all the clocks simultaneously. In how many seconds will the hand of every clock point directly upward again? | ['N = int(input())\nt_list = [float(input()) for i in range(N)]\n\ndef gcd(a,b):\n\twhile b:\n\t\ta,b = b, a%b\n\treturn float(a)\n\na = t_list[0]\nfor c in range(N-1):\n\tb = t_list[c+1]\n\ta =a*b/gcd(a,b)\n\nprint(a)', 'N = int(input())\nt_list = [int(input()) for i in range(N)]\n\ndef gcd(a,b):\n\twhile b:\n\t\ta,b = b, a%b\n\treturn a\n\na = t_list[0]\nfor c in range(N-1):\n\tb = t_list[c+1]\n\ta =a*b/gcd(a,b)\n\nprint(a)', 'N = int(input())\nt_list = [int(input()) for i in range(N)]\n\ndef gcd(a,b):\n\twhile b:\n\t\ta,b = b, a%b\n\treturn a\n\na = t_list[0]\nfor c in range(N-1):\n\tb = t_list[c+1]\n\ta =a*b//gcd(a,b)\n\nprint(a)'] | ['Wrong Answer', 'Wrong Answer', 'Accepted'] | ['s176819958', 's980457839', 's943160433'] | [3060.0, 2940.0, 2940.0] | [2104.0, 2104.0, 18.0] | [197, 188, 189] |
p03633 | u131405882 | 2,000 | 262,144 | We have N clocks. The hand of the i-th clock (1≤i≤N) rotates through 360° in exactly T_i seconds. Initially, the hand of every clock stands still, pointing directly upward. Now, Dolphin starts all the clocks simultaneously. In how many seconds will the hand of every clock point directly upward again? | ['def gcd(x, y):\n\tif x < y:\n\t\tx, y = y, x\n\tif y == 0:\n\t\treturn x\n\tz = x % y\n\treturn gcd(y, z) \n\t\nN=int(input())\nprenum = 1\nfor i in range(N):\n\tT = int(input())\n\tlcm = prenum / gcd(prenum, T) * T\n\tprenum = lcm\nprint(str(lcm))', 'def gcd(x, y):\n\tif x < y:\n\t\tx, y = y, x\n\tif y == 0:\n\t\treturn x\n\tz = x % y\n\treturn gcd(y, z) \n\t\nN=int(input())\nprenum = 1\nfor i in range(N):\n\tT = int(input())\n\tlcm = prenum // gcd(prenum, T) * T\n\tprenum = lcm\nprint(lcm)'] | ['Runtime Error', 'Accepted'] | ['s435617204', 's652911260'] | [3944.0, 3060.0] | [75.0, 19.0] | [222, 218] |
p03633 | u137228327 | 2,000 | 262,144 | We have N clocks. The hand of the i-th clock (1≤i≤N) rotates through 360° in exactly T_i seconds. Initially, the hand of every clock stands still, pointing directly upward. Now, Dolphin starts all the clocks simultaneously. In how many seconds will the hand of every clock point directly upward again? | ['N = int(input())\nT = []\nfor i in range(N):\n T.append(int(input()))\ndef lcm(x, y):\n return (x * y) // math.gcd(x, y)\ng = lcm(T[0],T[1])\nif len(T) > 2:\n for i in range(N-1):\n g = lcm(g,T[i+1])\nprint(g)', 'import math\nN = int(input())\nT = []\n\ndef lcm(x, y):\n gc = math.gcd(x, y)\n ans = (x * y)//gc\n return ans\n\nfor i in range(N):\n T.append(int(input()))\n\n \n\nif len(T) > 2:\n g = lcm(T[0],T[1])\n for i in range(3,N-1):\n g = lcm(g,T[i+1])\n print(g)\nelif len(T) == 2:\n print(g)\nelse:\n print(T[0])', 'import math\nN = int(input())\nT = [int(input()) for _ in range(N)]\n\ndef lcm(x, y):\n return (x * y)//math.gcd(x,y)\n\ng = 1\nfor i in T:\n g = lcm(g,i)\n \nprint(g)'] | ['Runtime Error', 'Runtime Error', 'Accepted'] | ['s023815412', 's214632844', 's727272619'] | [9036.0, 9136.0, 9068.0] | [26.0, 29.0, 28.0] | [215, 323, 165] |
p03633 | u143492911 | 2,000 | 262,144 | We have N clocks. The hand of the i-th clock (1≤i≤N) rotates through 360° in exactly T_i seconds. Initially, the hand of every clock stands still, pointing directly upward. Now, Dolphin starts all the clocks simultaneously. In how many seconds will the hand of every clock point directly upward again? | ['def gcd(a,b):\n if b==0:\n return a\n return (gcd(b,a%b))\ndef lcm(a,b):\n return a*b//gcd(a,b)\nn=int(input())\nif n==1:\n print(int(input()))\n exit()\nans=0 \nfor i in range(n):\n ans=lcm(ans,int(input()))\nprint(int(ans))\n', 'def gcd(a,b):\n if b==0:\n return a\n return (gcd(b,a%b))\ndef lcm(a,b):\n return a*b//gcd(a,b)\nn=int(input())\nif n==1:\n print(int(input()))\n exit()\nans=0\nfor i in range(n):\n ans=lcm(ans,int(input()))\nprint(int(ans))\n', 'n=int(input())\nt=list(int(input())for i in range(n))\ndef gcd(a,b):\n while b!=0:\n a,b=b,a%b\n return a\ndef lcm(a,b):\n return a*b//gcd(a,b)\nans=t[0]\nfor i in range(n):\n ans=lcm(ans,t[i])\nprint(ans)\n'] | ['Wrong Answer', 'Wrong Answer', 'Accepted'] | ['s542669415', 's953482459', 's707212730'] | [3060.0, 3316.0, 3060.0] | [17.0, 24.0, 17.0] | [272, 237, 214] |
p03633 | u153902122 | 2,000 | 262,144 | We have N clocks. The hand of the i-th clock (1≤i≤N) rotates through 360° in exactly T_i seconds. Initially, the hand of every clock stands still, pointing directly upward. Now, Dolphin starts all the clocks simultaneously. In how many seconds will the hand of every clock point directly upward again? | ['import sys\nsys.setrecursionlimit(10**7)\nN = int(input())\nts = [int(input()) for _ in range(N)]\n\ndef gcd(a, b):\n if b==0:\n return a\n else:\n return gcd(b, b%a)\n\ndef lcm(a, b):\n g = gcd(a, b)\n return a * b // g\n\nl = 1\nfor t in ts:\n l = lcm(l, t)\n\nprint(l)', 'import sys\nsys.setrecursionlimit(10**7)\nN = int(input())\nts = [int(input()) for _ in range(N)]\n\ndef gcd(a, b):\n if b==0:\n return a\n else:\n return gcd(b, b%a)\n\ndef lcm(a, b):\n g = gcd(a, b)\n return a * b // g\n\nl = 1\nfor t in ts:\n l = lcm(l, t)\n\nprint(l)', 'def gcd(x, y):\n if x > y:\n y, x = x, y\n if x == 0:\n return y\n return gcd(y % x, x)\n \n \ndef lcm(x, y):\n d = gcd(x, y)\n return x * y // d\n \n \nN = int(input())\n \nans = 1\nfor _ in range(N):\n a = int(input())\n ans = lcm(ans, a)\nprint(ans)'] | ['Wrong Answer', 'Wrong Answer', 'Accepted'] | ['s009983032', 's785860145', 's031937156'] | [3060.0, 3060.0, 3060.0] | [18.0, 17.0, 18.0] | [281, 281, 268] |
p03633 | u156314159 | 2,000 | 262,144 | We have N clocks. The hand of the i-th clock (1≤i≤N) rotates through 360° in exactly T_i seconds. Initially, the hand of every clock stands still, pointing directly upward. Now, Dolphin starts all the clocks simultaneously. In how many seconds will the hand of every clock point directly upward again? | ['N = int(input())\nTs = list(set([int(input()) for _ in range(N)]))\n\ndef get_divider(n):\n divider = set()\n for i in range(1, n):\n if i * i > n:\n break\n\n if n % i == 0:\n divider.add(i)\n if i != int(n / i):\n divider.add(int(n / i))\n return divider\n\n\ndivider_set = set()\nfor T in Ts:\n divider_set = divider_set.union(get_divider(T))\ndivider_set.discard(1)\nprint(str(min(divider_set)))\n', 'from collections import defaultdict\n\nN = int(input())\nTs = list(set([int(input()) for _ in range(N)]))\n\ndef gcd(a, b):\n if b == 0:\n return a\n return gcd(b, a % b)\n\ndef lcm(a, b):\n g = gcd(a, b)\n return a // g * b\n\nres = Ts[0]\nfor T in Ts:\n res = lcm(res, T)\nprint(int(res))\n'] | ['Wrong Answer', 'Accepted'] | ['s205535864', 's853906327'] | [6808.0, 3316.0] | [2104.0, 21.0] | [454, 296] |
p03633 | u179169725 | 2,000 | 262,144 | We have N clocks. The hand of the i-th clock (1≤i≤N) rotates through 360° in exactly T_i seconds. Initially, the hand of every clock stands still, pointing directly upward. Now, Dolphin starts all the clocks simultaneously. In how many seconds will the hand of every clock point directly upward again? | ['N = int(input())\nT = []\nfor i in range(N):\n T.append(int(input()))\n\n\nimport numpy as np\nT = np.array(T)\n\n\nans = 1\n\nflg = True\nwhile(flg):\n for i in range(2, int(np.sqrt(max(T))) + 1):\n if sum(T % i) == 0:\n T = T // i\n # print(T)\n ans = ans * i\n break\n flg = False\n\nfor t in np.unique(T):\n ans = ans * t\n\n\nprint(ans)\n', 'N = int(input())\nT = []\nfor i in range(N):\n T.append(int(input()))\n\nT.sort()\n\n\ndef gcd(a, b):\n while (b != 0):\n tmp = a\n a = b\n b = tmp % b\n\n return a\n\n\ndef lcm(a, b):\n return (a*b)//gcd(a, b)\n\n\nans = T[0]\nfor t in T[1:]:\n ans = lcm(ans, t)\n # print(ans)\n\nprint(ans)\n'] | ['Wrong Answer', 'Accepted'] | ['s327061577', 's155902562'] | [14480.0, 3060.0] | [2109.0, 18.0] | [494, 306] |
p03633 | u180058306 | 2,000 | 262,144 | We have N clocks. The hand of the i-th clock (1≤i≤N) rotates through 360° in exactly T_i seconds. Initially, the hand of every clock stands still, pointing directly upward. Now, Dolphin starts all the clocks simultaneously. In how many seconds will the hand of every clock point directly upward again? | ['import numpy as np\n\nN = int(input())\n\narr_T = np.empty(N)\nfor i in range(N):\n arr_T[i] = int(input())\n\n\n\nmax_T = np.max(arr_T)\nlcm = max_T\n\nwhile True:\n \n bools = lcm % arr_T == 0\n if bools.all():\n break\n else:\n lcm += max_T\n\n\nprint(lcm)', 'import numpy as np\n\n\ndef get_gcd(a, b):\n a, b = max(a, b), min(a, b)\n c = a % b\n if c == 0:\n return b\n else:\n return get_gcd(b, c)\n\n# --------------------------------------------\n\n\nN = int(input())\n\narr_T = np.empty(N, dtype = int)\nfor i in range(N):\n arr_T[i] = int(input())\n\narr_sort_T = np.sort(arr_T)[::-1]\n\n\n\nmax_T = np.max(arr_T)\nm = max_T\nif N != 1:\n \n for n in arr_sort_T[1:]:\n gcd = get_gcd(m, n)\n m = (m // gcd) * n\n\n\nprint(m)'] | ['Wrong Answer', 'Accepted'] | ['s727236898', 's770526032'] | [14504.0, 12500.0] | [2109.0, 150.0] | [517, 772] |
p03633 | u191829404 | 2,000 | 262,144 | We have N clocks. The hand of the i-th clock (1≤i≤N) rotates through 360° in exactly T_i seconds. Initially, the hand of every clock stands still, pointing directly upward. Now, Dolphin starts all the clocks simultaneously. In how many seconds will the hand of every clock point directly upward again? | ["# https://qiita.com/_-_-_-_-_/items/34f933adc7be875e61d0\n# abcde\ts=input()\ts='abcde'\n# abcde\ts=list(input())\ts=['a', 'b', 'c', 'd', 'e']\n\n# 1 2\t| x,y = map(int,input().split()) |\tx=1,y=2\n\n\n\n\n# INPUT\n# 3\n# hoge\n# foo\n# bar\n# ANSWER\n# n=int(input())\n\n\n\nfrom collections import defaultdict, Counter\nimport math\nfrom bisect import bisect_left, bisect_right\nimport numpy as np\n\n\ndef gcd(a,b):\n if b == 0:\n return a\n else:\n return gcd(b,a%b)\n\n\ndef lcm(a, b):\n return a * b / gcd(a,b)\n\n\ndef lcmlist(numbers):\n a = numbers[0]\n for i in range(1, len(numbers)):\n a = lcm(a, numbers[i])\n return a\n\n#### START\nn = int(input())\nt = [int(input()) for i in range(n)]\n\nprint(lcmlist(t))\n", "# https://qiita.com/_-_-_-_-_/items/34f933adc7be875e61d0\n# abcde\ts=input()\ts='abcde'\n# abcde\ts=list(input())\ts=['a', 'b', 'c', 'd', 'e']\n\n# 1 2\t| x,y = map(int,input().split()) |\tx=1,y=2\n\n\n\n\n# INPUT\n# 3\n# hoge\n# foo\n# bar\n# ANSWER\n# n=int(input())\n\n\n\nfrom collections import defaultdict, Counter\nimport math\nfrom bisect import bisect_left, bisect_right\nimport numpy as np\n\n\ndef gcd(a,b):\n if b == 0:\n return a\n else:\n return gcd(b,a%b)\n\n\ndef lcm(a, b):\n return int(a * b) // gcd(a,b)\n\n\ndef lcmlist(numbers):\n a = numbers[0]\n for i in range(1, len(numbers)):\n a = lcm(a, numbers[i])\n return int(a)\n\n#### START\nn = int(input())\nt = [int(input()) for i in range(n)]\n\nprint(lcmlist(t))\n"] | ['Runtime Error', 'Accepted'] | ['s664649300', 's719531830'] | [12900.0, 20816.0] | [231.0, 318.0] | [1078, 1089] |
p03633 | u215315599 | 2,000 | 262,144 | We have N clocks. The hand of the i-th clock (1≤i≤N) rotates through 360° in exactly T_i seconds. Initially, the hand of every clock stands still, pointing directly upward. Now, Dolphin starts all the clocks simultaneously. In how many seconds will the hand of every clock point directly upward again? | ['sys.setrecursionlimit(100000)\ndef lcm(x,y):\n return (x*y)//gcd(x,y)\n\ndef gcd(x,y):\n if y <= 0:\n return x\n else:\n return gcd(y,x%y)\n\nN = int(input())\nT = [int(input()) for _ in range(N)]\nans = lcm(T[0],T[1])\nfor i in range(2,N):\n ans = lcm(ans,T[i])\nprint(ans)', 'import sys\nimport os\nsys.setrecursionlimit(1000000000000000)\n\ndef lcm(x,y):\n return (x*y)//gcd(x,y)\n\ndef gcd(x,y):\n if y <= 0:\n return x\n else:\n return gcd(y,x%y)\n\nN = int(input())\nT = [int(input()) for _ in range(N)]\nans = lcm(T[0],T[1])\nfor i in range(2,N):\n ans = lcm(ans,T[i])\nprint(ans)\n', 'import sys\nimport os\nsys.setrecursionlimit(10000000000000)\n\ndef lcm(x,y):\n return (x*y)//gcd(x,y)\n\ndef gcd(x,y):\n if y <= 0:\n return x\n else:\n return gcd(y,x%y)\n\nN = int(input())\nT = [int(input()) for _ in range(N)]\nans = lcm(T[0],T[1])\nfor i in range(2,N):\n ans = lcm(ans,T[i])\nprint(ans)\n', 'import sys\nimport os\nsys.setrecursionlimit(100000000)\n\ndef lcm(x,y):\n return (x*y)//gcd(x,y)\n\ndef gcd(x,y):\n if y <= 0:\n return x\n else:\n return gcd(y,x%y)\n\nN = int(input())\nT = [int(input()) for _ in range(N)]\nif N == 1:\n print(T[0])\n sys.exit()\n\nans = lcm(T[0],T[1])\nfor i in range(2,N):\n ans = lcm(ans,T[i])\nprint(ans)\n'] | ['Runtime Error', 'Runtime Error', 'Runtime Error', 'Accepted'] | ['s717694376', 's741463401', 's782681218', 's735584986'] | [3064.0, 3060.0, 3064.0, 3064.0] | [17.0, 17.0, 17.0, 17.0] | [285, 318, 316, 354] |
p03633 | u216289806 | 2,000 | 262,144 | We have N clocks. The hand of the i-th clock (1≤i≤N) rotates through 360° in exactly T_i seconds. Initially, the hand of every clock stands still, pointing directly upward. Now, Dolphin starts all the clocks simultaneously. In how many seconds will the hand of every clock point directly upward again? | ['def gcd(a,b):\n return b\n\ndef lcm(a,b):\n c=gcd(a,b);\n return a/c*b\n\n\n\nn=int(input())\nt=[0]*n\n\nfor lop2 in range(n):\n t[lop2]=int(input())\n\nans=t[0]\n\nfor lop in range(1,n):\n ans=lcm(ans,t[lop])\nprint(int(ans))', 'import gcc\n\ndef gcd(a,b):\n if a<b:\n c=a;\n a=b;\n b=c;\n c=a%b\n\n if c==0:\n return b\n else:\n return gcc.gcd(b,c)\n\ndef lcm(a,b):\n c=gcd(a,b);\n return a/c*b\n\n\nn=int(input())\nt=[0]*n\n\nfor lop2 in range(n):\n t[lop2]=int(input())\n\nans=t[0]\n\nfor lop in range(1,n):\n ans=lcm(ans,t[lop])\nprint(int(ans))', 'def gcd(a,b):\n if a<b:\n d=a\n a=b\n b=d\n\n if b==0:\n b=1\n\n c=a%b\n\n if c==0:\n return b\n else:\n return 2\n\ndef lcm(a,b):\n c=gcd(a,b)\n return a/c*b\n\n\n\nn=int(input())\nt=[0]*n\n\nfor lop2 in range(n):\n t[lop2]=int(input())\n\nans=t[0]\n\nfor lop in range(1,n):\n ans=lcm(ans,t[lop])\nprint(int(ans))\n', 'import gcc\n\ndef gcd(a,b):\n if a<b:\n c=a;\n a=b;\n b=c;\n c=a%b\n\n if c==0:\n return b\n else:\n return gcc.gcd(b,c)\n\ndef lcm(a,b):\n c=gcd(a,b);\n return a/c*b\n\n\nn=int(input())\nt=[int(input()) for lop in range(n)]\nans=t[0]\n\nfor lop in range(1,n):\n ans=lcm(ans,t[n])\nprint(int(ans))', 'def gcd(a,b):\n if a<b:\n c=a\n a=b\n b=c\n \n c=a%b\n \n if c==0:\n return gcd(b,cs)\n else:\n return b\n \ndef lcm(a,b):\n c=gcd(a,b)\n return a/c*b\n \n \n \nn=int(input())\nt=[0]*n\n \nfor lop2 in range(n):\n t[lop2]=int(input())\n \nans=t[0]\n \nfor lop in range(1,n):\n ans=lcm(ans,t[lop])\nprint(int(ans))\n', 'n=int(input())\nt=[0]*n\n\nfor lop2 in range(n):\n t[lop2]=int(input())\n\nans=t[0]\n\nfor lop in range(1,n):\n ans=lcm(ans,t[lop])\nprint(int(ans))\n\n\ndef gcd(a,b):\n if a<b:\n c=a\n a=b\n b=c\n \n c=a%b\n return b\n \ndef lcm(a,b):\n c=gcd(a,b)\n return a/c*b\n \n \n \nn=int(input())\nt=[0]*n\n \nfor lop2 in range(n):\n t[lop2]=int(input())\n \nans=t[0]\n \nfor lop in range(1,n):\n ans=lcm(ans,t[lop])\nprint(int(ans))', '\n\ndef lcm(a,b):\n c=4\n return a/c*b\n\n\n\nn=int(input())\nt=[0]*n\n\nfor lop2 in range(n):\n t[lop2]=int(input())\n\nans=t[0]\n\nfor lop in range(1,n):\n ans=lcm(ans,t[lop])\nprint(int(ans))\n', 'n=int(input())\nt=[0]*n\n\nfor lop2 in range(n):\n t[lop2]=int(input())\n\nans=t[0]\n\nfor lop in range(1,n):\n ans=lcm(ans,t[lop])\nprint(int(ans))\n\n\ndef gcd(a,b):\n if a<b:\n c=a\n a=b\n b=c\n \n c=a%b\n return b\n \ndef lcm(a,b):\n c=gcd(a,b)\n return a/c*b\n \n \n \nn=int(input())\nt=[0]*n\n \nfor lop2 in range(n):\n t[lop2]=int(input())\n \nans=t[0]\n \nfor lop in range(1,n):\n ans=lcm(ans,t[lop])\nprint(int(ans))', 'def gcd(a,b):\n if a<b:\n d=a\n a=b\n b=d\n\n\ndef lcm(a,b):\n c=gcd(a,b)\n return a/c*b\n\n\n\nn=int(input())\nt=[0]*n\n\nfor lop2 in range(n):\n t[lop2]=int(input())\n\nans=t[0]\n\nfor lop in range(1,n):\n ans=lcm(ans,t[lop])\nprint(int(ans))\n', '\ndef lcm(a,b):\n c=2\n return a/c*b\n\nn=int(input())\nt=[0]*n\n\nfor lop2 in range(n):\n t[lop2]=int(input())\n\nans=t[0]\n\nfor lop in range(1,n):\n ans=lcm(ans,t[lop])\nprint(int(ans))', 'n=int(input())\nt=[0]*n\n\nfor lop2 in range(n):\n t[lop2]=int(input())\n\nans=t[0]\n\nfor lop in range(1,n):\n ans=ans+t[lop]\nprint(int(ans))', 'def gcd(a,b):\n if a<b:\n c=a\n a=b\n b=c\n \n c=a%b\n return b\n \ndef lcm(a,b):\n c=gcd(a,b)\n return a/c*b\n \n \n \nn=int(input())\nt=[0]*n\n \nfor lop2 in range(n):\n t[lop2]=int(input())\n \nans=t[0]\n \nfor lop in range(1,n):\n ans=lcm(ans,t[lop])\nprint(int(ans))', 'def gcd(a,b):\n if a<b:\n c=a\n a=b\n b=c\n \n c=a%b\n \n if c==0:\n return a\n else:\n return b\n \ndef lcm(a,b):\n c=gcd(a,b)\n return a/c*b\n \n \n \nn=int(input())\nt=[0]*n\n \nfor lop2 in range(n):\n t[lop2]=int(input())\n \nans=t[0]\n \nfor lop in range(1,n):\n ans=lcm(ans,t[lop])\nprint(int(ans))\n', 'def gcd(a,b):\n if a<b:\n c=a\n a=b\n b=c\n \n c=a%b\n return b\n \ndef lcm(a,b):\n c=gcd(a,b)\n return a/c*b\n \n \n \nn=int(input())\nt=[0]*n\n \nfor lop2 in range(n):\n t[lop2]=int(input())\n \nans=t[0]\n \nfor lop in range(1,n):\n ans=lcm(ans,t[lop])\nprint(int(ans))\n', 'def gcd(a,b):\n if a<b:\n c=a\n a=b\n b=c\n return b\n \ndef lcm(a,b):\n c=gcd(a,b)\n return a/c*b\n \n \n \nn=int(input())\nt=[0]*n\n \nfor lop2 in range(n):\n t[lop2]=int(input())\n \nans=t[0]\n \nfor lop in range(1,n):\n ans=lcm(ans,t[lop])\nprint(int(ans))\n', 'def gcd(a,b):\n if a<b:\n c=a\n a=b\n b=c\n \n c=a%b\n \n if c==0:\n return gcd(b,c)\n else:\n return b\n \ndef lcm(a,b):\n c=gcd(a,b)\n return a/c*b\n \n \n \nn=int(input())\nt=[0]*n\n \nfor lop2 in range(n):\n t[lop2]=int(input())\n \nans=t[0]\n \nfor lop in range(1,n):\n ans=lcm(ans,t[lop])\nprint(int(ans))\n', '\ndef lcm(a,b):\n c=1;\n return a/c+b\n\n\n\nn=int(input())\nt=[0]*n\n\nfor lop2 in range(n):\n t[lop2]=int(input())\n\nans=t[0]\n\nfor lop in range(1,n):\n ans=lcm(ans,t[lop])\nprint(int(ans))', 'def gcd(a,b):\n return b\n \ndef lcm(a,b):\n c=gcd(a,b)\n return a/c*b\n \n \n \nn=int(input())\nt=[0]*n\n \nfor lop2 in range(n):\n t[lop2]=int(input())\n \nans=t[0]\n \nfor lop in range(1,n):\n ans=lcm(ans,t[lop])\nprint(int(ans))\n', "def gcd(a,b):\n if a<b:\n c=a;\n a=b;\n b=c;\n c=a%b\n\n if c==0:\n return b\n else:\n return gcd(b,c)\n\n\n\n\ndef lcm(a,b):\n c=gcd(a,b);\n return a/c*b\n\n\n\nN=input()\n\nn=int(N)\n\nANS=input()\nans=int(ANS)\n\nfor lop in range(n-1):\n T=input()\n t=int(T)\n ans=lcm(ans,t)\nprint(int(ans))\nprint('\\n')\nquit()\n", '\ndef gcd(a,b):\n if a<b:\n d=a\n a=b\n b=d\n\n if b==0:\n b=1\n if a==0:\n a=1\n\n c=a%b\n\n if c==0:\n return b\n else:\n return 5\n\ndef lcm(a,b):\n c=gcd(a,b)\n return a/c*b\n\n\n\nn=int(input())\nt=[0]*n\n\nfor lop2 in range(n):\n t[lop2]=int(input())\n\nans=t[0]\n\nfor lop in range(1,n):\n ans=lcm(ans,t[lop])\nprint(int(ans))\n', 'import gcc\n\ndef gcd(a,b):\n if a<b:\n c=a;\n a=b;\n b=c;\n c=a%b\n\n if c==0:\n return b\n else:\n return gcc.gcd(b,c)\n\ndef lcm(a,b):\n c=gcd(a,b);\n return a/c*b\n\n\nn=int(input())\nt=[0]*n\n\nfor lop2 in range(n):\n t[lop2]=int(input())\n\nans=t[0]\n\nfor lop in range(1,n):\n ans=lcm(ans,t[n])\nprint(int(ans))', 'n=int(input())\nt=[0]*n\n\nfor lop2 in range(n):\n t[lop2]=int(input())\n\n\nprint(4)', 'def gcd(a,b):\n if a<b:\n c=a\n a=b\n b=c\n \n c=a%b\n \n if c==0:\n a=b\n b=c\n return gcd(a,b)\n else:\n return b\n \ndef lcm(a,b):\n c=gcd(a,b)\n return a/c*b\n \n \n \nn=int(input())\nt=[0]*n\n \nfor lop2 in range(n):\n t[lop2]=int(input())\n \nans=t[0]\n \nfor lop in range(1,n):\n ans=lcm(ans,t[lop])\nprint(int(ans))\n', "def gcd(a,b):\n return b\n\n\n\n\n\ndef lcm(a,b):\n c=gcd(a,b);\n return a\n\n\n\nN=input()\n\nn=int(N)\n\nANS=input()\nans=int(ANS)\n\nfor lop in range(n):\n T=input()\n t=int(T)\n ans=lcm(ans,t)\nprint(int(ans))\nprint('\\n')\nquit()\n", 'import gcc\n\ndef gcd(a,b):\n if a<b:\n c=a;\n a=b;\n b=c;\n c=a%b\n\n if c==0:\n return b\n else:\n return gcc.gcd(b,c)\n\ndef lcm(a,b):\n c=gcd(a,b);\n return a/c*b\n\n\nn=int(input())\nt=[int(input()) for lop in range(n)]\nans=t[0]\n\nfor lop in range(1,n):\n ans=lcm(ans,t)\nprint(int(ans))', 'def gcd(a,b):\n if a<b:\n c=a\n a=b\n b=c\n \n c=a%b\n \n if c==0:\n return b\n else:\n return a\n \ndef lcm(a,b):\n c=gcd(a,b)\n return a/c*b\n \n \n \nn=int(input())\nt=[0]*n\n \nfor lop2 in range(n):\n t[lop2]=int(input())\n \nans=t[0]\n \nfor lop in range(1,n):\n ans=lcm(ans,t[lop])\nprint(int(ans))', "'''\ndef gcd(a,b):\n if a<b:\n c=a\n a=b\n b=c\n\n c=a%b\n\n if c==0:\n return b\n else:\n return gcd(b,c)\n'''\n'''\ndef gcd(a,b):\n return a if b == 0 else gcd(b,a%b)\n'''\n\ndef gcd(a,b):\n if a<b:\n d=a\n a=b\n b=d\n d=a%b\n while d!=0:\n a=b\n b=d\n d=a%b\n return b\n\ndef lcm(e,f):\n c=gcd(e,f)\n g=e*f\n return g//c\n\n\n\nn=int(input())\nt=[0]*n\n\nfor lop2 in range(n):\n t[lop2]=int(input())\n\nans=t[0]\n\nfor lop in range(1,n):\n ans=lcm(ans,t[lop])\nprint(int(ans))\n"] | ['Wrong Answer', 'Runtime Error', 'Runtime Error', 'Runtime Error', 'Runtime Error', 'Runtime Error', 'Runtime Error', 'Runtime Error', 'Runtime Error', 'Runtime Error', 'Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Runtime Error', 'Wrong Answer', 'Wrong Answer', 'Runtime Error', 'Runtime Error', 'Runtime Error', 'Wrong Answer', 'Runtime Error', 'Runtime Error', 'Runtime Error', 'Wrong Answer', 'Accepted'] | ['s247833581', 's287376330', 's311997503', 's333438983', 's438917650', 's441494950', 's453578379', 's462863339', 's476965047', 's484140869', 's497119869', 's519430056', 's522254117', 's599780751', 's617709332', 's685024597', 's702319523', 's769382992', 's773285224', 's778844947', 's807653141', 's814093433', 's819548031', 's860191128', 's918675620', 's966631271', 's191319523'] | [3064.0, 3064.0, 3064.0, 3064.0, 3064.0, 3064.0, 3060.0, 3064.0, 3060.0, 3060.0, 2940.0, 3064.0, 3064.0, 3060.0, 3060.0, 3064.0, 3064.0, 3060.0, 3952.0, 3064.0, 3064.0, 2940.0, 3064.0, 3060.0, 3064.0, 3064.0, 3064.0] | [17.0, 17.0, 17.0, 17.0, 17.0, 17.0, 17.0, 17.0, 17.0, 18.0, 17.0, 17.0, 17.0, 17.0, 18.0, 17.0, 17.0, 17.0, 75.0, 17.0, 17.0, 17.0, 17.0, 17.0, 17.0, 17.0, 17.0] | [222, 350, 334, 328, 335, 430, 189, 430, 249, 185, 139, 283, 327, 284, 268, 334, 188, 229, 345, 357, 348, 81, 352, 229, 325, 326, 518] |
p03633 | u231685196 | 2,000 | 262,144 | We have N clocks. The hand of the i-th clock (1≤i≤N) rotates through 360° in exactly T_i seconds. Initially, the hand of every clock stands still, pointing directly upward. Now, Dolphin starts all the clocks simultaneously. In how many seconds will the hand of every clock point directly upward again? | ['import math\nn = int(input())\ns = int(input())\ndef gcd_core(a, b):\n if b == 0:\n return a\n else:\n return gcd_core(b, a % b)\nfor i in range(1,n):\n t = int(input())\n s = (s*t)//math.gcd_core(s,t)\n\nprint(s)', 'n = int(input())\ns = int(input())\ndef gcd_core(a, b):\n if b == 0:\n return a\n else:\n return gcd_core(b, a % b)\nfor i in range(1,n):\n t = int(input())\n s = (s*t)//gcd_core(s,t)\n\nprint(s)'] | ['Runtime Error', 'Accepted'] | ['s953903857', 's581174682'] | [3060.0, 2940.0] | [17.0, 17.0] | [227, 210] |
p03633 | u238510421 | 2,000 | 262,144 | We have N clocks. The hand of the i-th clock (1≤i≤N) rotates through 360° in exactly T_i seconds. Initially, the hand of every clock stands still, pointing directly upward. Now, Dolphin starts all the clocks simultaneously. In how many seconds will the hand of every clock point directly upward again? | ['import sys\nsys.setrecursionlimit(10**7)\nN = int(input())\nts = [int(input()) for _ in range(N)]\n\ndef gcd(a,b):\n if b == 0:\n return a\n return gcd(b,a%b)\n\ndef lcm(a,b):\n g = gcd(a,b)\n return a/g*b\n\nl = 1\nfor t in ts:\n l = lcm(l,t)\n \nprint(l)', 'import sys\nsys.setrecursionlimit(10**7)\nN = int(input())\nts = [int(input()) for _ in range(N)]\n\ndef gcd(a,b):\n if b == 0:\n return a\n return gcd(b,a%b)\n\ndef lcm(a,b):\n g = gcd(a,b)\n return a * b // g\n\nl = 1\nfor t in ts:\n l = lcm(l,t)\n \nprint(l)'] | ['Runtime Error', 'Accepted'] | ['s859920958', 's029030271'] | [683764.0, 3060.0] | [1318.0, 17.0] | [263, 268] |
p03633 | u239316561 | 2,000 | 262,144 | We have N clocks. The hand of the i-th clock (1≤i≤N) rotates through 360° in exactly T_i seconds. Initially, the hand of every clock stands still, pointing directly upward. Now, Dolphin starts all the clocks simultaneously. In how many seconds will the hand of every clock point directly upward again? | ['def gcd (num1,num2):\n tmp = max(num1,num2) % min(num1,num2)\n if tmp == 0:\n return min(num1,num2)\n return gcd(min(num1,num2),tmp)\n\n\nn = int(input())\nt = []\nstock = [1]\nfor i in range(n):\n t.append(input())\n\nfor i in range(len(t)-1):\n stock.append(t[i] * t[i+1] / gcd(stock[i],t[i]))\n\nprint(stock[-1])', 'def gcd(num1,num2):\n if num2 == 0:\n return num1\n return gcd(num2,num1%num2)\n\nn = int(input())\nt = [int(x) for x in input()]\ntime = 1\n\nfor i in t:\n time = time * t // gcd(time,i)', 'def gcd(num1,num2):\n if num2 == 0:\n return num1\n return gcd(num2,num1%num2)\n\nn = int(input())\nt = []\nfor i in range(n):\n t.append(int(input()))\n\ntime = 1\n\nfor i in t:\n time = time * i / gcd(time,i)\n\nprint(time)', 'def gcd (num1,num2):\n tmp = max(num1,num2) % min(num1,num2)\n if tmp == 0:\n return min(num1,num2)\n return gcd(min(num1,num2),tmp)\n\nn = int(input())\nt = []\nstock = [1]\nfor i in range(n):\n t.append(input())\n\nfor i in range(len(t)-1):\n stock.append(t[i] * t[i+1] / gcd(stock[i],t[i]))\n\nprint(stock[-1])', 'n = int(input())\nans = int(input())\n \ndef gcd(a,b):\n while b:\n a,b = b,a%b\n return a\n \ndef lcm(x,y):\n return (x*y//gcd(x,y))\n \nfor i in range(N-1):\n t = int(input())\n ans = lcm(ans,t)\nprint(ans)', 'n = int(input())\nans = int(input())\n \ndef gcd(a,b):\n while b:\n a,b = b,a%b\n return a\n \ndef lcm(x,y):\n return (x*y//gcd(x,y))\n \nfor i in range(n-1):\n t = int(input())\n ans = lcm(ans,t)\nprint(ans)'] | ['Runtime Error', 'Runtime Error', 'Runtime Error', 'Runtime Error', 'Runtime Error', 'Accepted'] | ['s335315990', 's736546976', 's746883225', 's881647729', 's884368464', 's205294471'] | [3064.0, 2940.0, 3948.0, 3064.0, 3060.0, 3060.0] | [17.0, 18.0, 73.0, 17.0, 17.0, 17.0] | [389, 306, 229, 320, 216, 216] |
p03633 | u239375815 | 2,000 | 262,144 | We have N clocks. The hand of the i-th clock (1≤i≤N) rotates through 360° in exactly T_i seconds. Initially, the hand of every clock stands still, pointing directly upward. Now, Dolphin starts all the clocks simultaneously. In how many seconds will the hand of every clock point directly upward again? | ['cl = [int(input()) for i in range(int(input()))]\nans = 1\n\ndef gcd(a, b):\n\twhile b:\n\t\ta, b = b, a % b\n\treturn a\n\ndef lcm(a, b):\n\treturn a * b // gcd (a, b)\n\nfor i in cl:\n ans = lcm(ans,i)\n print(ans)\n\nprint(ans)\n', 'cl = [int(input()) for i in range(int(input()))]\nans = 1\n\ndef gcd(a, b):\n\twhile b:\n\t\ta, b = b, a % b\n\treturn a\n\ndef lcm(a, b):\n\treturn a * b // gcd (a, b)\n\nfor i in cl:\n ans = lcm(ans,i)\n\nprint(ans)\n'] | ['Wrong Answer', 'Accepted'] | ['s221086282', 's774988978'] | [3060.0, 3060.0] | [17.0, 17.0] | [217, 202] |
p03633 | u240793404 | 2,000 | 262,144 | We have N clocks. The hand of the i-th clock (1≤i≤N) rotates through 360° in exactly T_i seconds. Initially, the hand of every clock stands still, pointing directly upward. Now, Dolphin starts all the clocks simultaneously. In how many seconds will the hand of every clock point directly upward again? | ['import math\ninput()\nlc = 1\nfor i in range(n):\n t = int(input())\n lc = lc * t // math.gcd(lc,t)\nprint(lc)', 'import math\ninput()\nt = list(map(int,input().split()))\nlc = 1\nfor i in t:\n lc = lc * t // math.gcd(lc,t)\nprint(lc)', 'def gcd(a, b):\n while b:\n a, b = b, a % b\n return a\nn = int(input())\nlc = 1\nfor i in range(n):\n t = int(input())\n lc = lc * t // gcd(lc,t)\nprint(lc)'] | ['Runtime Error', 'Runtime Error', 'Accepted'] | ['s058974201', 's904194073', 's934614662'] | [3060.0, 3060.0, 2940.0] | [18.0, 17.0, 17.0] | [110, 117, 167] |
p03633 | u252828980 | 2,000 | 262,144 | We have N clocks. The hand of the i-th clock (1≤i≤N) rotates through 360° in exactly T_i seconds. Initially, the hand of every clock stands still, pointing directly upward. Now, Dolphin starts all the clocks simultaneously. In how many seconds will the hand of every clock point directly upward again? | ['n = int(input())\n\nli = []\nfor i in range(n):\n li.append(int(input()))\n\ndef gcd1(a,b):\n while b:\n a,b = b,a%b\n return a\n\ndef lcm1(a,b):\n return a*b//gcd1(a,b)\nnum = 1\nfor i in range(2,len(li)):\n num = lcm1(num,li[i])\nprint(num)\n ', 'n = int(input())\n\ndef gcd1(a,b):\n while b:\n a,b = b,a%b\n return a\n\ndef lcm1(a,b):\n return a*b//gcd1(a,b)\nnum = 1\nfor i in range(n):\n num = lcm1(num,int(input()))\nprint(num)\n '] | ['Wrong Answer', 'Accepted'] | ['s275881847', 's055100262'] | [3060.0, 2940.0] | [17.0, 18.0] | [241, 186] |
p03633 | u267300160 | 2,000 | 262,144 | We have N clocks. The hand of the i-th clock (1≤i≤N) rotates through 360° in exactly T_i seconds. Initially, the hand of every clock stands still, pointing directly upward. Now, Dolphin starts all the clocks simultaneously. In how many seconds will the hand of every clock point directly upward again? | ['import fractions\nN = int(input())\nans = 1\n\ndef lcm(x,y):\n return (int(x*y/fractions.gcd(x,y)))\n\nfor i in range(N):\n ans = lcm(ans,int(input()))\n\nprint(ans)\n', 'N = int(input())\nans = int(input())\n\ndef gcd(a,b):\n while b:\n a,b = b,a%b\n return a\n\ndef lcm(x,y):\n return (x*y//gcd(x,y))\n\nfor i in range(N-1):\n t = int(input())\n ans = lcm(ans,t)\n\nprint(ans)\n'] | ['Runtime Error', 'Accepted'] | ['s271704076', 's935723083'] | [5304.0, 2940.0] | [39.0, 17.0] | [162, 215] |
p03633 | u296518383 | 2,000 | 262,144 | We have N clocks. The hand of the i-th clock (1≤i≤N) rotates through 360° in exactly T_i seconds. Initially, the hand of every clock stands still, pointing directly upward. Now, Dolphin starts all the clocks simultaneously. In how many seconds will the hand of every clock point directly upward again? | ['N=int(input())\nT=[int(input()) for _ in range(N)]\nT=list(set(T))\nprint(T)\n\ndef gcd(a,b):\n if b==0:\n return a\n else:\n return gcd(b,a%b)\n\nans=T[0]\nfor i in range(N):\n #print(ans)\n ans=ans*T[i]//gcd(ans,T[i])\nprint(ans)', 'N=int(input())\nT=[int(input()) for _ in range(N)]\nT=list(set(T))\nN=len(T)\n#print(T)\n\ndef gcd(a,b):\n if b==0:\n return a\n else:\n return gcd(b,a%b)\n\nans=T[0]\nfor i in range(N):\n #print(ans)\n ans=ans*T[i]//gcd(ans,T[i])\nprint(ans)'] | ['Runtime Error', 'Accepted'] | ['s446833156', 's747893295'] | [3064.0, 3064.0] | [18.0, 18.0] | [226, 236] |
p03633 | u301823349 | 2,000 | 262,144 | We have N clocks. The hand of the i-th clock (1≤i≤N) rotates through 360° in exactly T_i seconds. Initially, the hand of every clock stands still, pointing directly upward. Now, Dolphin starts all the clocks simultaneously. In how many seconds will the hand of every clock point directly upward again? | ['N = int(input())\nT = []\nfor _ in range(N):\n T.append(int(input()))\nfor x in range(1,10**8):\n for y in T:\n z = 0\n z += x % y\n if z == 0:\n print(x)\n break\n \n', 'N = int(input())\nT = []\nfor _ in range(N):\n T.append(int(input()))\n\ndef gcd(a, b):\n\twhile b:\n\t\ta, b = b, a % b\n\treturn a\n \ndef lcm(a, b):\n\treturn a * b // gcd (a, b)\nif N == 1:\n print(T[0])\nelse:\n result = lcm(T[0],T[1])\n\n for x in range(2,N):\n result = lcm(result, T[x])\n\n print(result)\n \n'] | ['Wrong Answer', 'Accepted'] | ['s377817920', 's211481223'] | [2940.0, 3060.0] | [2104.0, 17.0] | [195, 318] |
p03633 | u314050667 | 2,000 | 262,144 | We have N clocks. The hand of the i-th clock (1≤i≤N) rotates through 360° in exactly T_i seconds. Initially, the hand of every clock stands still, pointing directly upward. Now, Dolphin starts all the clocks simultaneously. In how many seconds will the hand of every clock point directly upward again? | ['import sys\nimport math\nif N == 1:\n\tprint(T[0])\n\tsys.exit()\ndef GCD(a,b):\n\tif b == 0:\n\t\treturn a\n\treturn GCD(b,a%b)\n\nN = int(input())\nT = [int(input()) for _ in range(N)]\n\ndef SKS(a,b):\n\treturn (a*b)//GCD(a,b)\n\nfor i in range(1,N):\n\tif i == 1:\n\t\ttemp = SKS(T[0], T[1])\n\t\tcontinue\n\n\ttemp = SKS(temp, T[i])\n\nprint(temp)', 'import sys\nimport math\n\ndef GCD(a,b):\n\tif b == 0:\n\t\treturn a\n\treturn GCD(b,a%b)\n\nN = int(input())\nT = [int(input()) for _ in range(N)]\nif N == 1:\n\tprint(T[0])\n\tsys.exit()\ndef SKS(a,b):\n\treturn (a*b)//GCD(a,b)\n\nfor i in range(1,N):\n\tif i == 1:\n\t\ttemp = SKS(T[0], T[1])\n\t\tcontinue\n\n\ttemp = SKS(temp, T[i])\n\nprint(temp)'] | ['Runtime Error', 'Accepted'] | ['s294193307', 's970697952'] | [3064.0, 3064.0] | [17.0, 18.0] | [316, 316] |
p03633 | u333768710 | 2,000 | 262,144 | We have N clocks. The hand of the i-th clock (1≤i≤N) rotates through 360° in exactly T_i seconds. Initially, the hand of every clock stands still, pointing directly upward. Now, Dolphin starts all the clocks simultaneously. In how many seconds will the hand of every clock point directly upward again? | ["import fractions\n\n\ndef lcm(a, b):\n return a * b / fractions.gcd(a, b)\n\n\ndef list_lcm(number_list):\n lcm_number = 1\n for j in range(len(number_list)):\n lcm_number = lcm(lcm_number, number_list[j])\n\n return lcm_number\n\n\nif __name__ == '__main__':\n number_count = int(input())\n numbers = []\n for i in range(number_count):\n numbers.append(int(input()))\n print(int(list_lcm(numbers)))\n", "def gcd(a, b):\n while b:\n a, b = b, a % b\n return a\n\n\ndef lcm(a, b):\n return a * b // gcd(a, b)\n\n\ndef list_lcm(number_list):\n lcm_number = 1\n for j in range(len(number_list)):\n lcm_number = lcm(lcm_number, number_list[j])\n\n return lcm_number\n\n\nif __name__ == '__main__':\n number_count = int(input())\n numbers = []\n for i in range(number_count):\n numbers.append(int(input()))\n print(int(list_lcm(numbers)))\n"] | ['Wrong Answer', 'Accepted'] | ['s127934497', 's040392017'] | [5084.0, 3060.0] | [2104.0, 17.0] | [418, 457] |
p03633 | u338225045 | 2,000 | 262,144 | We have N clocks. The hand of the i-th clock (1≤i≤N) rotates through 360° in exactly T_i seconds. Initially, the hand of every clock stands still, pointing directly upward. Now, Dolphin starts all the clocks simultaneously. In how many seconds will the hand of every clock point directly upward again? | ['N = int( input() )\nT = [ int( input() ) for _ in range(N) ]\n\n\n\n\n\ndef GCD( a, b ):\n if b == 0: return a\n return GCD(b, a%b)\n\n\ndef LCM( a, b ):\n return a*b / GCD(a,b)\n\n\nans = LCM( T[0], T[1] )\nfor i in range(2,N):\n ans = LCM( ans, T[i] )\nprint( ans )', 'import functools\n\nN = int( input() )\nT = [ int( input() ) for _ in range(N) ]\n\n\n\n\n\ndef GCD( a, b ):\n if b == 0: return a\n return GCD(b, a%b)\n\n\ndef LCM( a, b ):\n return a*b // GCD(a,b)\n\n\nans = functools.reduce( LCM, T ) \nprint( ans )'] | ['Runtime Error', 'Accepted'] | ['s039487693', 's692181233'] | [3952.0, 3572.0] | [78.0, 23.0] | [433, 414] |
p03633 | u353241315 | 2,000 | 262,144 | We have N clocks. The hand of the i-th clock (1≤i≤N) rotates through 360° in exactly T_i seconds. Initially, the hand of every clock stands still, pointing directly upward. Now, Dolphin starts all the clocks simultaneously. In how many seconds will the hand of every clock point directly upward again? | ["import sys\n\nsys.setrecursionlimit = 10000000\n\ndef get_gcd(A, B):\n r = A%B\n if r == 0:\n return B\n else:\n return get_gcd(B, r)\n \nif __name__ == '__main__':\n N = int(input())\n T = [int(input()) for _ in range(N)]\n \n ans = 1\n for n in range(N):\n gcd = get_gcd(ans, T[n])\n ans = int(T[n]/gcd)*T[n]\n \n print(ans)", "import sys\n\nsys.setrecursionlimit = 10000000\n\ndef get_gcd(A, B):\n r = A%B\n if r == 0:\n return B\n else:\n return get_gcd(B, r)\n \nif __name__ == '__main__':\n N = int(input())\n T = [int(input()) for _ in range(N)]\n \n ans = 1\n for t in T:\n gcd = get_gcd(ans, t)\n ans = t//gcd*ans\n \n print(ans)"] | ['Wrong Answer', 'Accepted'] | ['s654415750', 's141814787'] | [3060.0, 3060.0] | [17.0, 18.0] | [378, 360] |
p03633 | u364618491 | 2,000 | 262,144 | We have N clocks. The hand of the i-th clock (1≤i≤N) rotates through 360° in exactly T_i seconds. Initially, the hand of every clock stands still, pointing directly upward. Now, Dolphin starts all the clocks simultaneously. In how many seconds will the hand of every clock point directly upward again? | ['def gcd(a, b):\n if b == 0:\n return a\n return gcd(b, a % b) \n\nn=int(input())\np=1\nfor i in range(n):\n m=int(input())\n p=p*m/gcd(p,m)\nprint(p)', 'def gcd(a, b):\n if b == 0:\n return a\n return gcd(b, a % b) \n \nn=int(input())\np=1\nfor i in range(n):\n m=int(input())\n p=p*m//gcd(p,m)\nprint(int(p))'] | ['Runtime Error', 'Accepted'] | ['s178856171', 's913454517'] | [3944.0, 2940.0] | [72.0, 18.0] | [148, 155] |
p03633 | u371763408 | 2,000 | 262,144 | We have N clocks. The hand of the i-th clock (1≤i≤N) rotates through 360° in exactly T_i seconds. Initially, the hand of every clock stands still, pointing directly upward. Now, Dolphin starts all the clocks simultaneously. In how many seconds will the hand of every clock point directly upward again? | ['n = int(input())\nT=[int(input()) for i in range(n)]\nT = sorted(T,reverse=True)\n\nfor i in range(2,100):\n if T[0] % T[1] !=0:\n if sum(map(lambda x:T/2, T)) !=0:\n T[0] = T[0]*i\n else:\n print(T[0])\n exit()\n', 'n = int(input())\nT=[int(input()) for i in range(n)]\nT = sorted(T,reverse=True)\n\nfor i in range(2,100):\n if sum(map(lambda x:T[0]%x, T)) !=0:\n print(sum(map(lambda x:T[0]%x, T)))\n T[0] = T[0]*i\n else:\n print(T[0])\n exit()', 'def gcd(x,y):\n r=x%y\n return gcd(y,r) if r else y\n\ndef lcm(x, y):\n return (x * y) // gcd(x, y)\n\nn=int(input())\nA=[int(input()) for i in range(n)]\n\n\nk=A[0]\nfor i in A[1:]:\n k=lcm(k,i)\nprint(k)\n'] | ['Runtime Error', 'Wrong Answer', 'Accepted'] | ['s870133444', 's931723185', 's298003604'] | [3060.0, 3064.0, 3060.0] | [18.0, 19.0, 18.0] | [218, 234, 242] |
p03633 | u387110752 | 2,000 | 262,144 | We have N clocks. The hand of the i-th clock (1≤i≤N) rotates through 360° in exactly T_i seconds. Initially, the hand of every clock stands still, pointing directly upward. Now, Dolphin starts all the clocks simultaneously. In how many seconds will the hand of every clock point directly upward again? | ['import urllib.request\nfrom bs4 import BeautifulSoup\nimport re\nimport sys\nimport os\nimport time\nimport subprocess\nimport datetime\n\n\ndef gcd(a, b):\n if a < b:\n c = a\n a = b\n b = c\n\n r = a % b\n\n while r > 0:\n a = b\n b = r\n r = a % b\n\n return b\n\n \n # if (a < b)\n # swap(a, b);\n \n #\n # while (r) {\n # a = b;\n # b = r;\n # r = a % b;\n # }\n #\n # return b;\n # }\n\n\nN = int(input())\na = []\nfor i in range(N):\n a.append(int(input()))\n# a = list(map(int, input().split()))\n\nans = a[0]\n\nfor i in range(N):\n if i == 0:\n continue\n\n g = gcd(ans, a[i])\n ans = ans * a[i] // g\n\nprint(ans)\n', '\ndef gcd(a, b):\n if a < b:\n c = a\n a = b\n b = c\n\n r = a % b\n\n while r > 0:\n a = b\n b = r\n r = a % b\n\n return b\n\n \n # if (a < b)\n # swap(a, b);\n \n #\n # while (r) {\n # a = b;\n # b = r;\n # r = a % b;\n # }\n #\n # return b;\n # }\n\n\nN = int(input())\na = []\nfor i in range(N):\n a.append(int(input()))\n# a = list(map(int, input().split()))\n\nans = a[0]\n\nfor i in range(N):\n if i == 0:\n continue\n\n g = gcd(ans, a[i])\n ans = ans * a[i] // g\n\nprint(ans)\n'] | ['Runtime Error', 'Accepted'] | ['s393922267', 's254251396'] | [9456.0, 3064.0] | [133.0, 17.0] | [745, 615] |
p03633 | u393512980 | 2,000 | 262,144 | We have N clocks. The hand of the i-th clock (1≤i≤N) rotates through 360° in exactly T_i seconds. Initially, the hand of every clock stands still, pointing directly upward. Now, Dolphin starts all the clocks simultaneously. In how many seconds will the hand of every clock point directly upward again? | ['def gcd(a, b):\n if b == 0:\n return a\n return gcd(b, a % b)\n\ndef lcm(a, b):\n return a * b // gcd(a, b)\n\nimport sys\ninput = sys.stdin.readline\nN = int(input())\nT = [int(input()) for _ in range(N)]\nif N == 1:\n ans = T[0]\nelse:\n ans = lcm(T[0], T[1])\n for i in range(2, N):\n ans = lcm(ans, T[i])\nprint(ans)', 'def gcd(a, b):\n if b == 0:\n return a\n return gcd(b, a % b)\n\ndef lcm(a, b):\n return a * b // gcd(a, b)\n\nimport sys\ninput = sys.stdin.readline\nN = int(input())\nif N == 1:\n print(input())\nelse:\n T = [int(input()) for _ in range(N)]\n ans = lcm(T[0], T[1])\n for i in range(2, N):\n ans = lcm(ans, T[i])\n print(ans)\n'] | ['Runtime Error', 'Accepted'] | ['s129895697', 's418735600'] | [2940.0, 3060.0] | [17.0, 17.0] | [330, 347] |
p03633 | u410996052 | 2,000 | 262,144 | We have N clocks. The hand of the i-th clock (1≤i≤N) rotates through 360° in exactly T_i seconds. Initially, the hand of every clock stands still, pointing directly upward. Now, Dolphin starts all the clocks simultaneously. In how many seconds will the hand of every clock point directly upward again? | ['s=set()\nn=int(input())\nfor i in range(n):\n s.add(int(input()))\nwhile len(s) != 1:\n l=list(cb(s,2))\n s = set([lcm(x,y) for x,y in l])\nprint(list(s)[0])', 'def gcd(a, b):\n while b > 0:\n a, b = b, a%b\n return a\ndef lcm(a, b):\n return a*b//gcd(a, b)\nn=int(input())\nt=[int(input()) for i in range(n)]\nfor i in range(n-1):\n t[i+1] = lcm(t[i],t[i+1])\nprint(t[n-1])'] | ['Runtime Error', 'Accepted'] | ['s949836555', 's360231200'] | [3060.0, 3064.0] | [17.0, 17.0] | [159, 222] |
p03633 | u411858517 | 2,000 | 262,144 | We have N clocks. The hand of the i-th clock (1≤i≤N) rotates through 360° in exactly T_i seconds. Initially, the hand of every clock stands still, pointing directly upward. Now, Dolphin starts all the clocks simultaneously. In how many seconds will the hand of every clock point directly upward again? | ['import math\nfrom functools import reduce\n\nN = int(input())\nL = [ int(input()) for i in range(N)]\n\n\ndef lcm_list(numbers):\n return reduce(lcm_base, numbers, 1)\n\nprint(lcm_list(L))', '\ndef gcd(a, b):\n while b:\n a, b = b, a % b\n return a\n\n\ndef lcm(a, b):\n return a * b // gcd (a, b)\n\nN = int(input())\nL = [int(input()) for _ in range(N)]\n\ntmp = L[0]\nfor i in range(1, N):\n tmp = lcm(tmp, L[i])\n \nprint(tmp)\n'] | ['Runtime Error', 'Accepted'] | ['s848158840', 's015889333'] | [3572.0, 3060.0] | [23.0, 18.0] | [181, 288] |
p03633 | u415905784 | 2,000 | 262,144 | We have N clocks. The hand of the i-th clock (1≤i≤N) rotates through 360° in exactly T_i seconds. Initially, the hand of every clock stands still, pointing directly upward. Now, Dolphin starts all the clocks simultaneously. In how many seconds will the hand of every clock point directly upward again? | ['import functools\nN = int(input())\nT = []\nfor i in range(N):\n T.append(int(input()))\n\ndef gcd(a, b):\n if a < b:\n a, b = b, a\n if b == 0:\n return a\n return gcd(b, b % a)\n \ndef lcm(A, B):\n return (A // gcd(A, B)) * B\n \nprint(functools.reduce(lcm, T))', 'import math\nimport functools\nN = int(input())\nT = []\nfor i in range(N):\n T.append(int(input()))\n\ndef gcd(a, b):\n if a < b:\n a, b = b, a\n if b == 0:\n return a\n return gcd(b, b % a)\n \ndef lcm(A, B):\n return A * B // gcd(A, B)\n \nprint(functools.reduce(lcm, sorted(T, reverse=True)))', 'import functools\nN = int(input())\nT = []\nfor i in range(N):\n T.append(int(input()))\n\ndef gcd(a, b):\n if a < b:\n a, b = b, a\n if b == 0:\n return a\n return gcd(b, b % a)\n \ndef lcm(A, B):\n return (A // gcd(A, B)) * B\n \nprint(functools.reduce(lcm, sorted(T, reverse=True)))', 'import functools\nN = int(input())\nT = []\nfor i in range(N):\n T.append(int(input()))\n\ndef gcd(a, b):\n if a < b:\n a, b = b, a\n if b == 0:\n return a\n return gcd(b, b % a)\n \ndef lcm(A, B):\n return A * B // gcd(A, B)\n \nprint(functools.reduce(lcm, T))', 'import functools\nN = int(input())\nT = []\nfor i in range(N):\n T.append(int(input()))\n \ndef gcd(a, b):\n if a < b:\n a, b = b, a\n if b == 0:\n return a\n return gcd(b, a % b)\n \ndef lcm(A, B):\n return (A // gcd(A, B)) * B\n \nprint(functools.reduce(lcm, T))'] | ['Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Accepted'] | ['s083666530', 's252908653', 's379904881', 's960432154', 's000762615'] | [3572.0, 3572.0, 3812.0, 3572.0, 3572.0] | [22.0, 23.0, 24.0, 23.0, 23.0] | [258, 290, 280, 256, 259] |
p03633 | u463655976 | 2,000 | 262,144 | We have N clocks. The hand of the i-th clock (1≤i≤N) rotates through 360° in exactly T_i seconds. Initially, the hand of every clock stands still, pointing directly upward. Now, Dolphin starts all the clocks simultaneously. In how many seconds will the hand of every clock point directly upward again? | ['N = int(input())\n\ndef gcd(x, y):\n if y == 0:\n return x\n else:\n return gcd(y, x % y)\n\ng = 1\nfor x in (int(input()) for _ in range(N)):\n g = g * x / gcd(g, x)\nprint(g)\n', 'N = int(input())\n\ndef gcd(x, y):\n if y == 0:\n return x\n else:\n return gcd(y, x % y)\n\ng = 0\nfor x in (int(input()) for _ in range(N)):\n g = gcd(g, x)\nprint(g)\n', 'N = int(input())\n\ndef gcd(x, y):\n if y == 0:\n return x\n else:\n return gcd(y, x % y)\n\ng = 0\nfor x in (map(int, input()) for _ in range(N)):\n g = gcd(g, x)\nprint(g)\n', 'N = int(input())\n\ndef gcd(x, y):\n if y == 0:\n return x\n else:\n return gcd(y, x % y)\n\ng = 1\nfor x in (int(input()) for _ in range(N)):\n g = g * x // gcd(g, x)\nprint(g)\n'] | ['Runtime Error', 'Wrong Answer', 'Runtime Error', 'Accepted'] | ['s024111096', 's288743851', 's311250559', 's360451544'] | [3948.0, 2940.0, 2940.0, 2940.0] | [74.0, 17.0, 17.0, 18.0] | [175, 167, 172, 176] |
p03633 | u469281291 | 2,000 | 262,144 | We have N clocks. The hand of the i-th clock (1≤i≤N) rotates through 360° in exactly T_i seconds. Initially, the hand of every clock stands still, pointing directly upward. Now, Dolphin starts all the clocks simultaneously. In how many seconds will the hand of every clock point directly upward again? | ['def gcd(a, b):\n while a != b:\n if (a != 1 and b != 1):\n if a < b:\n b = b % a\n elif a > b:\n a = a % b\n else:\n break\n if (a == 1 or b == 1):\n return 1\n else:\n return a\n\ndef lcm(a, b):\n return (a * b) // gcd(a, b)\n\n\nn = int(input())\nans = 1\nfor i in range(n):\n tmp = int(input())\n ans = lcm(ans, tmp)\nprint(ans)\n', 'n=int(input())\nans = 1\nfor i in range(n):\n inp = int(input())\n tmp = ans * inp\n tmp2 =ans\n while (ans % inp != 0):\n if (inp % ans == 0):\n ans = inp\n break\n ans += tmp2\n print(ans)\n print(ans%inp)\nprint(ans)', 'def gcd(a, b):\n if (b == 0):\n return a\n return gcd(b,a%b)\n\ndef lcm(a, b):\n return (a * b) // gcd(a, b)\n\n\nn = int(input())\nans = 1\nfor i in range(n):\n tmp = int(input())\n ans = lcm(ans, tmp)\nprint(ans)\n'] | ['Time Limit Exceeded', 'Wrong Answer', 'Accepted'] | ['s104646541', 's529400369', 's617362659'] | [3064.0, 37236.0, 2940.0] | [2104.0, 2104.0, 17.0] | [426, 268, 223] |
p03633 | u473999868 | 2,000 | 262,144 | We have N clocks. The hand of the i-th clock (1≤i≤N) rotates through 360° in exactly T_i seconds. Initially, the hand of every clock stands still, pointing directly upward. Now, Dolphin starts all the clocks simultaneously. In how many seconds will the hand of every clock point directly upward again? | ['import math as m\nfrom functools import reduce\n\nn=int(input())\nl=set([])\ndef gcd(a,b):\n a1=a\n b1=b\n if b%a==0 :\n return b\n if a%b==0:\n return a\n while a != 0:\n c = a\n a = b % a\n b = c\n return a1*b1/b\n\nfor i in range(n):\n l.add(int(input()))\nprint(reduce(gcd,l))\n\n\n\n\n\n\n\n\n', 'import math as m\nfrom functools import reduce\nn,T= int(input()),[]\ndef gcd(a, b):\n while b:\n a, b = b, a % b\n return a\nfor i in range(n):\n T.append(int(input()))\ntmp = max(T)\nfor i in range(n):\n if tmp % T[i] != 0:\n tmp = T[i]//gcd(tmp, T[i])*tmp\n\nprint(tmp)\n\n'] | ['Wrong Answer', 'Accepted'] | ['s992061171', 's227715991'] | [3828.0, 3700.0] | [2104.0, 23.0] | [325, 286] |
p03633 | u480472958 | 2,000 | 262,144 | We have N clocks. The hand of the i-th clock (1≤i≤N) rotates through 360° in exactly T_i seconds. Initially, the hand of every clock stands still, pointing directly upward. Now, Dolphin starts all the clocks simultaneously. In how many seconds will the hand of every clock point directly upward again? | ['def gcd(a,b):\n while b:\n a, b = b, a % b\n return max(a,b)\n\ndef lcd(a,b):\n return a * b / gcd(a,b)\n\n\nn = int(input())\nt = [int(input()) for i in range(n)]\nans = 1\nfor i in t:\n ans = lcd(i, ans)\nprint(ans)', 'def gcd(a,b):\n while b:\n a, b = b, a % b\n return a\n\ndef lcd(a,b):\n return a * b // gcd(a,b)\n\nn = int(input())\nt = [int(input()) for i in range(n)]\nans = 1\nfor i in t:\n ans = lcd(ans, i)\nprint(int(ans))'] | ['Wrong Answer', 'Accepted'] | ['s259386290', 's953102694'] | [3060.0, 3060.0] | [2104.0, 19.0] | [222, 220] |
p03633 | u495415554 | 2,000 | 262,144 | We have N clocks. The hand of the i-th clock (1≤i≤N) rotates through 360° in exactly T_i seconds. Initially, the hand of every clock stands still, pointing directly upward. Now, Dolphin starts all the clocks simultaneously. In how many seconds will the hand of every clock point directly upward again? | ['A, B, C, D = map(int, input().split())\nvalue = min(B, D) - max(A, C)\nprint(value if value > 0 else "0")\n\n', '\n\n@profile\ndef gcd(list, n):\n if n == 0:\n return list[0]\n else:\n a, b = list[n-1], list[n]\n \n while list[n]:\n list[n-1], list[n] = list[n], list[n-1] % list[n]\n\n list[n-1] = (a*b)/list[n-1]\n return gcd(list, n-1)\n\nN = int(input())\nT = [int(input()) for i in range(N)]\nT.sort(reverse=True)\nprint(int(gcd(T, N-1)))\n\n', '\n\ndef gcd(a, b):\n while b:\n a, b = b, a % b\n return a\n\ndef lcm(a, b):\n return a*b//gcd(a, b)\n\nN = int(input())\nT = [int(input()) for i in range(N)]\nans = 1\n\nfor i in range(N):\n ans = lcm(ans, T[i])\n\nprint(ans)\n'] | ['Runtime Error', 'Runtime Error', 'Accepted'] | ['s122641556', 's625186267', 's145077501'] | [2940.0, 3064.0, 3060.0] | [17.0, 17.0, 17.0] | [105, 416, 272] |
p03633 | u503901534 | 2,000 | 262,144 | We have N clocks. The hand of the i-th clock (1≤i≤N) rotates through 360° in exactly T_i seconds. Initially, the hand of every clock stands still, pointing directly upward. Now, Dolphin starts all the clocks simultaneously. In how many seconds will the hand of every clock point directly upward again? | ['n = int(input())\ntt = []\nfor i in range(n):\n tt.append(int(input()))\n \nss = int(1)\n\nfor i in tt:\n p = []\n p.append(ss)\n p.append(i)\n q = list(sorted(p))\n while q[1] % q[0] != 0:\n r = [q[1] % q[0] , q[0]]\n s = list(sorted(r))\n q[0] = s[0]\n q[1] = s[1]\n print(q)\n \n ss = int(ss * i / q[0])\n\nprint(int(ss))', 'n = int(input())\ntt = []\nfor i in range(n):\n tt.append(int(input()))\n \nss = 1\n\nfor i in tt:\n p = []\n p.append(int(ss))\n p.append(int(i))\n q = list(sorted(p))\n while q[1] % q[0] != 0:\n r = [q[1] % q[0] , q[0]]\n s = list(sorted(r))\n q[0] = int(s[0])\n q[1] = int(s[1])\n\n \n ss = int(ss * i) // q[0]\n\nprint(ss)'] | ['Runtime Error', 'Accepted'] | ['s477492991', 's546077492'] | [3064.0, 3064.0] | [19.0, 17.0] | [369, 364] |
p03633 | u513081876 | 2,000 | 262,144 | We have N clocks. The hand of the i-th clock (1≤i≤N) rotates through 360° in exactly T_i seconds. Initially, the hand of every clock stands still, pointing directly upward. Now, Dolphin starts all the clocks simultaneously. In how many seconds will the hand of every clock point directly upward again? | [' = int(input())\nT = sorted([int(input()) for i in range(N)])\n\ndef gcd(a, b):\n while b != 0:\n a, b = b,a%b\n return a\n\nif N == 1:\n print(T[0])\nelse:\n ans = T[0]\n for i in range(1, N):\n ans = (ans*T[i])//(gcd(ans, T[i]))\n \n print(ans)', 'N = int(input())\nT = set([int(input()) for i in range(N)])\nans = 0\nt = max(T)\nkensa = [t]\nwhile max(kensa) <= 10 **18:\n i = 2\n kensa.append(i*t)\n i += 1\n \nfor i in kensa:\n for j in T:\n if i%j != 0:\n break\n else:\n ans = i\n continue\n break\nprint(ans)', 'import math\n\nnum = 1\nfor i in range(int(input())):\n a = int(input())\n cnt = math.gcd(a, num)\n num = (a * num) // cnt\nprint(num)'] | ['Runtime Error', 'Wrong Answer', 'Accepted'] | ['s013120480', 's675364745', 's379849233'] | [2940.0, 3700.0, 9168.0] | [17.0, 2108.0, 31.0] | [266, 301, 136] |
p03633 | u521902517 | 2,000 | 262,144 | We have N clocks. The hand of the i-th clock (1≤i≤N) rotates through 360° in exactly T_i seconds. Initially, the hand of every clock stands still, pointing directly upward. Now, Dolphin starts all the clocks simultaneously. In how many seconds will the hand of every clock point directly upward again? | ['N = int(input())\na = [int(input()) for x in range(N)]\nprint(a)\n\nans = max(a)\nmx = max(a)\niteration = 1 \nwhile (ans < 10^18):\n flag = True \n for item in a:\n if not (ans%item == 0):\n flag = False\n if flag:\n print(ans)\n break\n else:\n iteration = iteration + 1\n ans = iteration * mx', 'def gcd(a, b):\n while b:\n a, b = b, a % b\n return a\n \ndef lcm(a, b):\n return a * b // gcd(a,b)\n \nN = int(input())\nTs = []\nc = 1\nfor i in range(N):\n c = lcm(c, int(input()))\n \nprint(int(c))\n'] | ['Wrong Answer', 'Accepted'] | ['s593415153', 's967003013'] | [3064.0, 3060.0] | [17.0, 18.0] | [335, 208] |
p03633 | u530335051 | 2,000 | 262,144 | We have N clocks. The hand of the i-th clock (1≤i≤N) rotates through 360° in exactly T_i seconds. Initially, the hand of every clock stands still, pointing directly upward. Now, Dolphin starts all the clocks simultaneously. In how many seconds will the hand of every clock point directly upward again? | ['import fractions\n\ndef lcm(n, m):\n return int(n * m / fractions.gcd(n, m))\n\n\nn = int(input())\nt = []\nfor i in range(0, n):\n t.append(int(input()))\nt_sorted = sorted(t)\n\ntime = 0\nfor i in range(0, n):\n if i == 0:\n time = t_sorted[0]\n else:\n time = lcm(int(time), t_sorted[i])\n\nprint(int(time))', 'def gcd(n, m):\n if min(n, m) == 0:\n return max(n,m)\n else:\n return gcd(min(n,m), max(n,m) % min(n,m))\n\ndef lcm(n, m):\n return n * m // gcd(n, m)\n\n\nn = int(input())\nt = []\nfor i in range(0, n):\n t.append(int(input()))\nt_sorted = sorted(t)\n\ntime = 0\nfor i in range(0, n):\n if i == 0:\n time = t_sorted[0]\n else:\n time = lcm(time, t_sorted[i])\n\nprint(int(time))'] | ['Runtime Error', 'Accepted'] | ['s756585761', 's189243147'] | [5048.0, 3064.0] | [36.0, 17.0] | [317, 403] |
p03633 | u549383771 | 2,000 | 262,144 | We have N clocks. The hand of the i-th clock (1≤i≤N) rotates through 360° in exactly T_i seconds. Initially, the hand of every clock stands still, pointing directly upward. Now, Dolphin starts all the clocks simultaneously. In how many seconds will the hand of every clock point directly upward again? | ['for i in range(len(t_list)):\n if i == 0:\n continue\n elif i == 1:\n ans_list.append(lcm(t_list[0] , t_list[1]))\n \n else:\n ans_list.append(lcm(ans_list[i-2],t_list[i]))\n \nprint(ans_list[-1])', 'def fcd(a , b):\n if a>= b:\n while b != 0:\n a,b = b,a%b\n return a\n \n else:\n while a != 0:\n b,a = a,b%a\n return b\n \n \ndef lcm(a,b):\n return int(a*b/fcd(a , b))\n\n\nn = int(input())\nt_list = []\nfor i in range(n):\n t_list.append(int(input()))\n \n \nfor i in range(len(t_list)):\n if i == 0:\n continue\n elif i == 1:\n ans_list.append(lcm(t_list[0] , t_list[1]))\n \n else:\n ans_list.append(lcm(ans_list[i-2],t_list[i]))', 'def fcd(a , b):\n \n if a>= b:\n while b != 0:\n a,b = b,a%b\n return a\n \n else:\n while a != 0:\n b,a = a,b%a\n return b\n \n \ndef lcm(a,b):\n return a*b//fcd(a , b)\n\n\nn = int(input())\nt_list = []\nans_list = []\nfor i in range(n):\n t_list.append(int(input()))\n \n \nfor i in range(len(t_list)):\n if i == 0:\n ans_list.append(t_list[0])\n continue\n if i == 1:\n ans_list.append(lcm(t_list[0] , t_list[1]))\n \n if i >=2:\n ans_list.append(lcm(ans_list[-1],t_list[i]))\nprint(ans_list[-1])'] | ['Runtime Error', 'Runtime Error', 'Accepted'] | ['s741352865', 's742873845', 's204813125'] | [3060.0, 3064.0, 3064.0] | [17.0, 18.0, 17.0] | [227, 516, 587] |
p03633 | u553348533 | 2,000 | 262,144 | We have N clocks. The hand of the i-th clock (1≤i≤N) rotates through 360° in exactly T_i seconds. Initially, the hand of every clock stands still, pointing directly upward. Now, Dolphin starts all the clocks simultaneously. In how many seconds will the hand of every clock point directly upward again? | ['N = int(input())\nlistClock = [int(input()) for i in range(N)]\ndef gcd(x, y):\n while y > 0:\n x, y = y, x%y\n return x\n\ndef lcm(x, y):\n return x/gcd(x, y)*y\n\nans = 1\n\nfor i in listClock:\n ans = lcm(ans,i)\n\nprint(ans)', 'N = int(input())\nlistClock = [int(input()) for i in range(N)]\n\ndef gcd(a, b):\n if b == 0:\n return a\n return gcd(b, a % b)\n\ndef lcm(x, y):\n g = gcd(x, y)\n \n return x // g * y\n\nans = 1\nfor i in listClock:\n ans = lcm(ans, i)\n\nprint(ans)'] | ['Wrong Answer', 'Accepted'] | ['s980799963', 's382748107'] | [3060.0, 3060.0] | [18.0, 18.0] | [232, 322] |
p03633 | u555947166 | 2,000 | 262,144 | We have N clocks. The hand of the i-th clock (1≤i≤N) rotates through 360° in exactly T_i seconds. Initially, the hand of every clock stands still, pointing directly upward. Now, Dolphin starts all the clocks simultaneously. In how many seconds will the hand of every clock point directly upward again? | ['def GCD(x: int, y: int):\n if x < y:\n x, y = y, x\n\n if x % y == 0:\n return y\n else:\n return GCD(y, x % y)\n\n\ndef LCM(x: int, y: int):\n return x * y // GCD(x, y)\n\n\nN = int(input())\nTlist = [int(input()) for i in range(N)]\nans = 1\nfor num in Tlist[1:]:\n ans = LCM(ans, num)\nprint(ans)\n', 'def GCD(x: int, y: int):\n if x < y:\n x, y = y, x\n\n if x % y == 0:\n return y\n else:\n return GCD(y, x % y)\n\n\ndef LCM(x: int, y: int):\n return x * y // GCD(x, y)\n\n\nN = int(input())\nTlist = [int(input()) for i in range(N)]\nans = 1\nfor num in Tlist:\n ans = LCM(ans, num)\nprint(ans)\n'] | ['Wrong Answer', 'Accepted'] | ['s071655149', 's622247128'] | [3060.0, 3060.0] | [19.0, 21.0] | [317, 313] |
p03633 | u557171945 | 2,000 | 262,144 | We have N clocks. The hand of the i-th clock (1≤i≤N) rotates through 360° in exactly T_i seconds. Initially, the hand of every clock stands still, pointing directly upward. Now, Dolphin starts all the clocks simultaneously. In how many seconds will the hand of every clock point directly upward again? | ['n = int(input())\nt = list(int(input()) for i in range(n))\nmxt = max(t)\nls = []\nans = 0\nj = 0\nmod_flag = False\n\nfor i in range(n):\n if not mxt % t[i] == 0:\n mod_flag = True\n ls.append(t[j])\n j+=1\n \nif mod_flag:\n ans = mxt\n\nif ans == 0:\n ans = 1\n for i in range(len(ls)):\n ans *= ls[i]\n ans *= mxt\n \nprint(ans)\n', 'def gcd(a,b):\n while b:\n a,b = b, a%b\n return a\n\ndef lcm(a,b):\n return a*b//gcd(a,b)\n\nn = int(input())\nt = list(int(input()) for i in range(n))\nmxt = max(t)\nls = []\nans = 0\nj = 0\nmod_flag = False\n\nfor i in range(n):\n if not mxt == t[i] and not mxt % t[i] == 0:\n mod_flag = True\n ls.append(t[i])\n j+=1\n \nif not mod_flag:\n ans = mxt\n\nif ans == 0:\n ans += mxt\n for i in range(len(ls)):\n if not ans % ls[i] == 0:\n print(ans)\n ans = lcm(ans,ls[i])\n \nprint(ans)\n', 'def gcd(a,b):\n while b:\n a,b = b, a%b\n return a\n\ndef lcm(a,b):\n return a*b//gcd(a,b)\n\nn = int(input())\nt = list(int(input()) for i in range(n))\nmxt = max(t)\nls = []\nans = 0\nj = 0\nmod_flag = False\n\nfor i in range(n):\n if not mxt == t[i] and not mxt % t[i] == 0:\n mod_flag = True\n ls.append(t[i])\n j+=1\n \nif not mod_flag:\n ans = mxt\n\nif ans == 0:\n ans += mxt\n for i in range(len(ls)):\n if not ans % ls[i] == 0:\n ans = lcm(ans,ls[i])\n \nprint(ans)\n'] | ['Wrong Answer', 'Wrong Answer', 'Accepted'] | ['s590471241', 's655971121', 's250066810'] | [3064.0, 3064.0, 3064.0] | [18.0, 18.0, 18.0] | [358, 540, 517] |
p03633 | u559250296 | 2,000 | 262,144 | We have N clocks. The hand of the i-th clock (1≤i≤N) rotates through 360° in exactly T_i seconds. Initially, the hand of every clock stands still, pointing directly upward. Now, Dolphin starts all the clocks simultaneously. In how many seconds will the hand of every clock point directly upward again? | ['n = int(input())\nlis = []\nfor i in range(n):\n lis.append(int(input()))\ndef lcm(*numbers):\n return reduce(lcm_base, numbers, 1)\nprint(lcm(lis))', 'import math\nfrom functools import reduce\nn = int(input())\nlis = []\nfor i in range(n):\n lis.append(int(input()))\ndef lcm_base(x, y):\n return (x * y) // math.gcd(x, y)\n\ndef lcm(*numbers):\n return reduce(lcm_base, numbers, 1)\n\ndef lcm_list(numbers):\n return reduce(lcm_base, numbers, 1)\nprint(lcm(lis))\n', 'n = int(input())\nlis = []\nfor i in range(n):\n lis.append(int(input()))\n\nprint(lcm(lis))', 'import numpy as np\nn = int(input())\nlis = []\nfor i in range(n):\n lis.append(int(input()))\nprint(np.lcm.reduce(lis))'] | ['Runtime Error', 'Runtime Error', 'Runtime Error', 'Accepted'] | ['s129586478', 's184965161', 's529507410', 's187871646'] | [9116.0, 9468.0, 9164.0, 27084.0] | [26.0, 29.0, 28.0, 117.0] | [148, 312, 90, 118] |
p03633 | u560988566 | 2,000 | 262,144 | We have N clocks. The hand of the i-th clock (1≤i≤N) rotates through 360° in exactly T_i seconds. Initially, the hand of every clock stands still, pointing directly upward. Now, Dolphin starts all the clocks simultaneously. In how many seconds will the hand of every clock point directly upward again? | ['import fractions\n\ndef main():\n n = int(input())\n ans = 1\n for _ in range(n):\n t = int(input())\n ans = ans*t/fractions.gcd(ans,t)\n print(int(ans))\n\n\nif __name__ == "__main__":\n main()\n', 'import fractions\n\ndef lcm(a,b):\n return a * b / fractions.gcd(a, b)\n\ndef main():\n n = int(input())\n t = [ int(input()) for _ in range(n)]\n ans = t[0]\n for i in range(n-1):\n ans = lcm(ans, t[i+1])\n print(int(ans))\n\n\nif __name__ == "__main__":\n main()', 'import fractions\n\ndef lcm(a,b):\n return a * b / fractions.gcd(a, b)\n\ndef main():\n n = int(input())\n t = [ int(input()) for _ in range(n)]\n ans = t[0]\n for i in range(n-1):\n ans = lcm(ans, t[i+1])\n print(ans)\n\n\nif __name__ == "__main__":\n main()', 'import fractions\n\ndef lcm(a,b):\n return a*b/fractions.gcd(a,b)\n\ndef main():\n n = int(input())\n ans = int(input())\n for _ in range(n-1):\n ans = lcm(ans,int(input()))\n print(int(ans))\n\n\nif __name__ == "__main__":\n main()', 'import fractions\n\ndef main():\n n = int(input())\n ans = int(input())\n for _ in range(n-1):\n t = int(input())\n ans = ans*t/fractions.gcd(ans,t)\n print(int(ans))\n\n\nif __name__ == "__main__":\n main()\n', 'import sys\ninput = sys.stdin.readline\n\ndef gcd(x,y):\n if x>y: x,y = y,x\n while x:\n x,y = y%x, x\n return y\n\ndef lcm(x,y):\n return x*y//gcd(x,y)\n\nN = int(input())\nans = 1\nfor _ in range(N):\n ans = lcm(ans, int(input()))\nprint(ans)\n'] | ['Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Accepted'] | ['s025514624', 's646157683', 's647435773', 's730505599', 's968343185', 's663607085'] | [5560.0, 5560.0, 5600.0, 5048.0, 5432.0, 3060.0] | [2104.0, 2104.0, 2104.0, 2104.0, 2104.0, 17.0] | [212, 277, 272, 243, 225, 237] |
p03633 | u588341295 | 2,000 | 262,144 | We have N clocks. The hand of the i-th clock (1≤i≤N) rotates through 360° in exactly T_i seconds. Initially, the hand of every clock stands still, pointing directly upward. Now, Dolphin starts all the clocks simultaneously. In how many seconds will the hand of every clock point directly upward again? | ['# -*- coding: utf-8 -*-\n\nimport fraction\nfrom functools import reduce\n\nN = int(input())\nTN = [int(input()) for i in range(N)]\n\n\ndef lcm_base(x, y):\n return (x * y) // fraction.gcd(x, y)\ndef lcm_list(numbers):\n return reduce(lcm_base, numbers, 1)\n\nprint(lcm_list(TN))', '# -*- coding: utf-8 -*-\n\nfrom functools import reduce\n\nN = int(input())\nTN = [int(input()) for i in range(N)]\n\n\ndef gcd(a, b):\n while b > 0:\n a, b = b, a%b\n return a\ndef lcm_base(x, y):\n return (x * y) // gcd(x, y)\ndef lcm_list(numbers):\n return reduce(lcm_base, numbers, 1)\n\nprint(lcm_list(TN))'] | ['Runtime Error', 'Accepted'] | ['s310386002', 's068580201'] | [2940.0, 3572.0] | [17.0, 23.0] | [328, 370] |
p03633 | u598229387 | 2,000 | 262,144 | We have N clocks. The hand of the i-th clock (1≤i≤N) rotates through 360° in exactly T_i seconds. Initially, the hand of every clock stands still, pointing directly upward. Now, Dolphin starts all the clocks simultaneously. In how many seconds will the hand of every clock point directly upward again? | ['import fractions\nn=int(input())\nt=[int(input()) for i in range(n)]\nt.sort()\nfor i in range(n-1):\n f1=fractions.gcd(t[i],t[i+1])\n f2=t[i]*t[i+1]//f1\nprint(f2)', 'import fractions\nn=int(input())\nt=[int(input()) for i in range(n)]\nt.sort()\ncheck=t[0]\nfor i in range(n-1):\n f1=fractions.gcd(t[i],t[i+1])\n f2=check*t[i+1]//f1\n check=f2\nprint(f2)', 'import fractions\nn=int(input())\nt=[int(input()) for i in range(n)]\nt.sort()\ncheck=t[0]\nfor i in range(n-1):\n f1=fractions.gcd(t[i],t[i+1])\n f2=t[i]*t[i+1]//f1\n check=f2\nprint(f2)', 'n=int(input())\nt=[int(input()) for i in range(n)]\n\ndef gcd(a,b):\n\twhile b:\n\t\ta,b=b,a%b\n\treturn a\n\n\t\nif n==1:\n\tprint(t[0])\n\texit()\n\ncheck=gcd(t[0],t[1])\nans=t[0]*t[1]//check\nfor i in range(2,n):\n\tcheck=gcd(ans,t[i])\n\tans=ans*t[i]//check\nprint(ans)'] | ['Runtime Error', 'Runtime Error', 'Runtime Error', 'Accepted'] | ['s019071493', 's420407450', 's564514177', 's461273088'] | [5304.0, 5048.0, 5048.0, 3064.0] | [38.0, 35.0, 35.0, 18.0] | [163, 188, 187, 246] |
p03633 | u599114793 | 2,000 | 262,144 | We have N clocks. The hand of the i-th clock (1≤i≤N) rotates through 360° in exactly T_i seconds. Initially, the hand of every clock stands still, pointing directly upward. Now, Dolphin starts all the clocks simultaneously. In how many seconds will the hand of every clock point directly upward again? | ['n = int(input())\nimport functools\nfrom functools import reduce\n\ndef gcd(numbers):\n return reduce(functools.gcd, numbers)\n\ndef lcm_base(x, y):\n return x // functools.gcd(x, y) * y\n\ndef lcm(numbers):\n return reduce(lcm_base, numbers, 1)\n\n\nnum = []\nfor i in range(n):\n num.append(int(input()))\nprint(lcm(num))\n', 'n = int(input())\ndef gcd(a,b):\n while b != 0:\n a, b = b, a % b\n return a\n\ndef lcm(a,b):\n return a // gcd(a,b) * b\n\nans = 1\nfor i in range(n):\n t = int(input())\n ans = lcm(ans,t)\nprint(ans)\n'] | ['Runtime Error', 'Accepted'] | ['s717967950', 's911539163'] | [3700.0, 2940.0] | [23.0, 18.0] | [319, 228] |
p03633 | u599547273 | 2,000 | 262,144 | We have N clocks. The hand of the i-th clock (1≤i≤N) rotates through 360° in exactly T_i seconds. Initially, the hand of every clock stands still, pointing directly upward. Now, Dolphin starts all the clocks simultaneously. In how many seconds will the hand of every clock point directly upward again? | ['import fraction\n\ndef lcm(a, b):\n\treturn a * b // fraction.gcd(a, b)\n\nn = int(input())\nt = [int(input()) for i in range(n)]\n\nans = t[0]\nfor t_i in t[1:]:\n\tans = lcm(ans, t_i)\n\nprint(ans)', 'def gcd(a, b):\n\twhile b:\n\t\ta, b = b, a % b\n\treturn a\n\ndef lcm(a, b):\n\treturn a * b // gcd(a, b)\n\nn = int(input())\nt = [int(input()) for i in range(n)]\n\nans = t[0]\nfor t_i in t[1:]:\n\tans = lcm(ans, t_i)\n\nprint(ans)'] | ['Runtime Error', 'Accepted'] | ['s043373552', 's665270281'] | [2940.0, 3060.0] | [17.0, 17.0] | [185, 213] |
p03633 | u620868411 | 2,000 | 262,144 | We have N clocks. The hand of the i-th clock (1≤i≤N) rotates through 360° in exactly T_i seconds. Initially, the hand of every clock stands still, pointing directly upward. Now, Dolphin starts all the clocks simultaneously. In how many seconds will the hand of every clock point directly upward again? | ['# -*- coding: utf-8 -*-\n\nn = int(input())\nt = []\nfor _ in range(n):\n t.append(int(input()))\n\ndef gcd(a, b):\n if b==0:\n return a\n return gcd(b, a%b)\n\ndef lcm(a,b):\n return a*b/gcd(a,b)\n\ndef lcmary(x, t):\n if len(t)==0:\n return x\n elif len(t)==1:\n return lcm(x,t[0])\n else:\n xx = lcm(x, t.pop(0))\n return lcmary(xx, t)\n\nprint(lcmary(t[0], t[1:]))\n', '# -*- coding: utf-8 -*-\n\nn = int(input())\n\ndef gcd(a, b):\n if b==0:\n return a\n return gcd(b, a%b)\n\ndef lcm(a,b):\n return a/gcd(a,b)*b\n\nans = 1\nfor _ in range(n):\n t = int(input())\n ans = lcm(ans, t)\n\nprint(ans)\n', '# -*- coding: utf-8 -*-\n\nn = int(input())\nt = []\nfor _ in range(n):\n t.append(int(input()))\n\ndef gcd(a, b):\n if b==0:\n return a\n return gcd(b, a%b)\n\ndef lcm(a,b):\n return a*b/gcd(a,b)\n\ndef lcmary(x, t):\n if len(t)==0:\n return x\n elif len(t)==1:\n return lcm(x,t[0])\n else:\n xx = lcm(x, t.pop(0))\n return lcmary(xx, t)\n\nprint(lcmary(t[0], t[1:]))\n', '# -*- coding: utf-8 -*-\n\nn = int(input())\n\ndef gcd(a, b):\n if b==0:\n return a\n return gcd(b, a%b)\n\ndef lcm(a,b):\n return a*b/gcd(a,b)\n\nans = 1\nfor _ in range(n):\n t = int(input())\n ans = lcm(ans, t)\n\nprint(ans)\n', '# -*- coding: utf-8 -*-\nn = int(input())\n\ndef gcd(a,b):\n if b>a:\n a,b = b,a\n while b>0:\n a,b = b,a%b\n return a\n\ndef lcm(a,b):\n return a*b//gcd(a,b)\n\nres = int(input())\nfor _ in range(n-1):\n t = int(input())\n res = lcm(res,t)\n\nprint(res)\n'] | ['Runtime Error', 'Runtime Error', 'Runtime Error', 'Runtime Error', 'Accepted'] | ['s218357305', 's483777783', 's723270802', 's733414317', 's583255647'] | [4072.0, 3944.0, 3960.0, 3948.0, 3060.0] | [76.0, 75.0, 75.0, 74.0, 18.0] | [401, 233, 401, 233, 269] |
p03633 | u624475441 | 2,000 | 262,144 | We have N clocks. The hand of the i-th clock (1≤i≤N) rotates through 360° in exactly T_i seconds. Initially, the hand of every clock stands still, pointing directly upward. Now, Dolphin starts all the clocks simultaneously. In how many seconds will the hand of every clock point directly upward again? | ['def gcd(a, b):\n while b:\n a, b = b, a % b\n return b\n\nans = 1\nfor _ in range(int(input())):\n t = int(input())\n ans = ans * t // gcd(ans, t)\nprint(ans)', 'def gcd(a, b):\n while b:\n a, b = b, a % b\n return a\n\nans = 1\nfor _ in range(int(input())):\n t = int(input())\n ans = ans * t // gcd(ans, t)\nprint(ans)'] | ['Runtime Error', 'Accepted'] | ['s976714599', 's258351567'] | [2940.0, 2940.0] | [17.0, 17.0] | [168, 168] |
p03633 | u626468554 | 2,000 | 262,144 | We have N clocks. The hand of the i-th clock (1≤i≤N) rotates through 360° in exactly T_i seconds. Initially, the hand of every clock stands still, pointing directly upward. Now, Dolphin starts all the clocks simultaneously. In how many seconds will the hand of every clock point directly upward again? | ['def gcd(a,b):\n if a<b:\n a,b = b,a\n if b==0:\n return a\n else:\n return gcd(b,a%b)\n\nn = int(input())\nli = [int(input()) for _ in range(n)]\n\nans = 1\nfor i in range(n):\n ans = gcd(ans,li[i])\nprint(ans)', 'def gcd(a,b):\n if a<b:\n a,b = b,a\n if b==0:\n return a\n else:\n return gcd(b,a%b)\n\ndef lcm(a,b):\n return (a*b)//gcd(a,b)\n\n\nn = int(input())\nli = [int(input()) for _ in range(n)]\n\nans = 1\nfor i in range(n):\n ans = lcm(ans,li[i])\nprint(ans)\n'] | ['Wrong Answer', 'Accepted'] | ['s800769784', 's983512371'] | [3060.0, 3060.0] | [17.0, 17.0] | [229, 273] |
p03633 | u638795007 | 2,000 | 262,144 | We have N clocks. The hand of the i-th clock (1≤i≤N) rotates through 360° in exactly T_i seconds. Initially, the hand of every clock stands still, pointing directly upward. Now, Dolphin starts all the clocks simultaneously. In how many seconds will the hand of every clock point directly upward again? | ["def gcd(a,b):\n if a>b :\n while b!=0:\n a,b = b,a%b\n return a\n elif a==b:\n return a\n else :\n while a!=0:\n a,b = b%a,a\n return b\ndef lcm(n,A):\n gcdn = [0]*n\n lcmn = [0]*n\n gcdn[0]=A[0]\n lcmn[0]=A[0]\n for i in range(n-1):\n gcdn[i+1] = gcd(lcmn[i],A[i+1])\n lcmn[i + 1] = (lcmn[i]/gcdn[i+1])*A[i+1]\n return lcmn[n-1]\n\ndef examC():\n N = I()\n T = [I() for _ in range(N)]\n ans = lcm(N,T)\n print(ans)\n\nimport sys\nimport copy\nimport bisect\nimport heapq\nfrom collections import Counter,defaultdict,deque\ndef I(): return int(sys.stdin.readline())\ndef LI(): return list(map(int,sys.stdin.readline().split()))\ndef LS(): return sys.stdin.readline().split()\ndef S(): return sys.stdin.readline().strip()\nmod = 10**9 + 7\ninf = float('inf')\n\nexamC()\n", "def gcd(x, y):\n if y == 0:\n return x\n while y != 0:\n x, y = y, x % y\n return x\n\ndef lcm(x, y):\n return x * y // gcd(x, y)\n\n\ndef examC():\n N = I()\n T = [I() for _ in range(N)]\n ans = 1\n for t in T:\n ans = lcm(ans, t)\n print(ans)\n\nimport sys\nimport copy\nimport bisect\nimport heapq\nfrom collections import Counter,defaultdict,deque\ndef I(): return int(sys.stdin.readline())\ndef LI(): return list(map(int,sys.stdin.readline().split()))\ndef LS(): return sys.stdin.readline().split()\ndef S(): return sys.stdin.readline().strip()\nmod = 10**9 + 7\ninf = float('inf')\n\nexamC()\n"] | ['Wrong Answer', 'Accepted'] | ['s794146435', 's175954533'] | [3444.0, 3444.0] | [2104.0, 23.0] | [840, 615] |
p03633 | u642905089 | 2,000 | 262,144 | We have N clocks. The hand of the i-th clock (1≤i≤N) rotates through 360° in exactly T_i seconds. Initially, the hand of every clock stands still, pointing directly upward. Now, Dolphin starts all the clocks simultaneously. In how many seconds will the hand of every clock point directly upward again? | ['def gcd(a,b):\n if b == 0:\n return a\n else:\n return gcd(b, a % b)\n \nN = int(input())\nTs = [None for i in range(N)]\n\na = input()\nb = 0\nfor i in range(N-1):\n b = int(input())\n a = (a*b) // gcd(a,b)\n \nprint(a)', 'def gcd(a,b):\n if b == 0:\n return a\n else:\n return gcd(b, a % b)\n \nN = int(input())\n \na = int(input())\nb = 0\nfor i in range(N-1):\n b = int(input())\n a = (a*b) // gcd(a,b)\n \nprint(a)'] | ['Runtime Error', 'Accepted'] | ['s837573837', 's713632466'] | [417012.0, 2940.0] | [149.0, 18.0] | [237, 213] |
p03633 | u644778646 | 2,000 | 262,144 | We have N clocks. The hand of the i-th clock (1≤i≤N) rotates through 360° in exactly T_i seconds. Initially, the hand of every clock stands still, pointing directly upward. Now, Dolphin starts all the clocks simultaneously. In how many seconds will the hand of every clock point directly upward again? | ['import math\ndef lcm(a,b):\n return (a*b)/int(ath.gcd(a,b))\n\nN = int(input())\nT = []\nfor i in range(N):\n T.append(int(input()))\n\nans = T[0]\nfor i in range(1,N):\n ans = int(lcm(ans,T[i]))\nprint(int(ans))\n', 'def gcd(a,b):\n while b:\n a,b = b,a%b\n return a\n\n\ndef lcm(a,b):\n return (a*b) // gcd(a,b)\n\n\nN = int(input())\nT = []\nfor i in range(N):\n T.append(int(input()))\n\nt = T[0]\nfor i in range(N - 1):\n t = lcm(t,T[i+1])\nprint(t)'] | ['Runtime Error', 'Accepted'] | ['s915059358', 's455898878'] | [3060.0, 3060.0] | [18.0, 18.0] | [210, 240] |
p03633 | u648901783 | 2,000 | 262,144 | We have N clocks. The hand of the i-th clock (1≤i≤N) rotates through 360° in exactly T_i seconds. Initially, the hand of every clock stands still, pointing directly upward. Now, Dolphin starts all the clocks simultaneously. In how many seconds will the hand of every clock point directly upward again? | ['N = int(input())\nle = [int(input()) for i in range(N)]\nle.sort()\n\n\n\n\ndef GCD(a,b):\n if b == 0:\n return a\n return GCD(b,a%b)\n\n\ndef LCM(a,b):\n return int(a*b//GCD(a,b))\n\ndef multi_LCM(le):\n print(le)\n if len(le)==1:\n return \n mxle=le[-1]\n del(le[-1])\n le[-1]=LCM(le[-1],mxle)\n multi_LCM(le)\n\nif(len(le)==2):\n le[0]=LCM(le[0],le[1])\nif(len(le)>=2):\n multi_LCM(le)\n\nprint(le[0])\n\n', 'N = int(input())\nle = [int(input()) for i in range(N)]\nle.sort()\n\n\n\n\ndef GCD(a,b):\n if b == 0:\n return a\n return GCD(b,a%b)\n\n\ndef LCM(a,b):\n return int(a*b//GCD(a,b))\n\ndef multi_LCM(le):\n # print(le)\n if len(le)==1:\n return\n mxle=le[-1]\n del(le[-1])\n le[-1]=LCM(le[-1],mxle)\n multi_LCM(le)\n\nif(len(le)==2):\n le[0]=LCM(le[0],le[1])\nif(len(le)>=2):\n multi_LCM(le)\n\nprint(le[0])\n'] | ['Wrong Answer', 'Accepted'] | ['s570824588', 's421974024'] | [3188.0, 3064.0] | [18.0, 17.0] | [651, 651] |
p03633 | u665038048 | 2,000 | 262,144 | We have N clocks. The hand of the i-th clock (1≤i≤N) rotates through 360° in exactly T_i seconds. Initially, the hand of every clock stands still, pointing directly upward. Now, Dolphin starts all the clocks simultaneously. In how many seconds will the hand of every clock point directly upward again? | ['from fractions import gcd\nN = int(input())\nT = [0]*N\nfor i in range(N):\n T[i] = int(input())\ndef lcm(a, b):\n return int((a*b)/gcd(a, b))\nlcm_ans = lcm(T[0], T[1])\nfor i in range(N):\n lcm_ans = lcm(T[i], lcm_ans)\nprint(lcm_ans)', 'from functools import reduce\nN = int(input())\nT = [0]*N\nfor i in range(N):\n T[i] = int(input())\ndef gcd(x, y):\n while y > 0:\n x, y = y, x % y\n return x\ndef lcm(x, y):\n return x*y//gcd(x, y)\nprint(reduce(lcm, T))'] | ['Runtime Error', 'Accepted'] | ['s572001775', 's165154145'] | [5304.0, 3572.0] | [38.0, 23.0] | [235, 230] |
p03633 | u665415433 | 2,000 | 262,144 | We have N clocks. The hand of the i-th clock (1≤i≤N) rotates through 360° in exactly T_i seconds. Initially, the hand of every clock stands still, pointing directly upward. Now, Dolphin starts all the clocks simultaneously. In how many seconds will the hand of every clock point directly upward again? | ['import copy\nN = int(input())\nT = [int(input()) for i in range(N)]\nt = copy.deepcopy(T)\nprint(t ,T)\nfor i in range(N):\n print(i)\n if i != N-1:\n while t[i] != t[i+1]:\n if t[i] < t[i+1]:\n t[i] = t[i] + T[i]\n elif t[i] > t[i+1]:\n t[i+1] = t[i+1] + T[i+1]\n T[i+1] = t[i+1]\nprint(t)', 'def yuclid(a, b):\n if b == 0:\n return a\n else:\n return yuclid(b, a% b)\n\nN = int(input())\nt = [int(input()) for i in range(N)]\nfor i in range(N-1):\n t[i+1] = t[i]*t[i+1]//yuclid(t[i], t[i+1])\n\nprint(t[N - 1])\n'] | ['Wrong Answer', 'Accepted'] | ['s903992671', 's261884444'] | [3444.0, 2940.0] | [2104.0, 17.0] | [348, 231] |
p03633 | u676264453 | 2,000 | 262,144 | We have N clocks. The hand of the i-th clock (1≤i≤N) rotates through 360° in exactly T_i seconds. Initially, the hand of every clock stands still, pointing directly upward. Now, Dolphin starts all the clocks simultaneously. In how many seconds will the hand of every clock point directly upward again? | ['from functools import reduce\n\ndef gcd(a, b):\n while b:\n a, b = b, a % b\n return a\n\ndef lcm(a, b):\n return a * b / gcd(a,b)\n\nN = int(input())\nTs = []\nfor i in range(N):\n Ts.append(int(input()))\n\nc = 1\nfor T in Ts:\n c = lcm(c, T)\n\nprint(c)\n', 'from functools import reduce\n\ndef gcd(a, b):\n while b:\n a, b = b, a % b\n return a\n\nN = int(input())\nTs = []\nfor i in range(N):\n Ts.append(int(input()))\nif len(Ts) >= 2:\n print(reduce(lambda x,y: x*y/ gcd(x,y), Ts))\nelse:\n print(Ts[0])', ' from functools import reduce\n\n def gcd(a, b):\n while b:\n a, b = b, a % b\n return a\n\n def lcm(a, b):\n return a * b / gcd(a,b)\n\n N = int(input())\n Ts = []\n for i in range(N):\n Ts.append(int(input()))\n\n c = 1\n for T in Ts:\n c = lcm(c, T)\n\n print(int(c))\n', 'def gcd(a, b):\n while b:\n a, b = b, a % b\n return a\n\n#def gcd(m, n):\n# r = m % n\n\n\ndef lcm(a, b):\n return a * b // gcd(a,b)\n\nN = int(input())\nTs = []\nc = 1\nfor i in range(N):\n c = lcm(c, int(input()))\n\nprint(int(c))\n'] | ['Wrong Answer', 'Wrong Answer', 'Runtime Error', 'Accepted'] | ['s096726500', 's243648835', 's796184251', 's167329320'] | [3572.0, 3572.0, 2940.0, 3060.0] | [2104.0, 2104.0, 17.0, 17.0] | [260, 256, 280, 271] |
p03633 | u677121387 | 2,000 | 262,144 | We have N clocks. The hand of the i-th clock (1≤i≤N) rotates through 360° in exactly T_i seconds. Initially, the hand of every clock stands still, pointing directly upward. Now, Dolphin starts all the clocks simultaneously. In how many seconds will the hand of every clock point directly upward again? | ['def gcd(x,y):\n if y == 0:\n return x\n else:\n return gcd(y,x%y)\n\nn = int(input())\nt = [int(input()) for i in range(n)]\n\nif n == 1:\n ans = t[0]\nelse:\n lcd = t[0]*t[1]/gcd(t[0],t[1])\n for i in range(2,n):\n lcd = lcd*t[i]/gcd(lcd,t[i])\n ans = lcd\n \nprint(ans)', 'def gcd(x,y):\n if y == 0:\n return x\n else:\n return gcd(y,x%y)\n\nn = int(input())\nt = [int(input()) for i in range(n)]\n\nlcd = t[0]*t[1]/gcd(t[0],t[1])\nfor i in range(2,n):\n lcd = lcd*t[i]/gcd(lcd,t[i])\n\nprint(lcd)', 'def gcd(x,y):\n if y == 0:\n return x\n else:\n return gcd(y,x%y)\n\ndef lcd(x,y):\n return x*y//gcd(x,y)\n\nn = int(input())\nt = [int(input()) for i in range(n)]\n\nans = t[0]\nfor i in range(1,n):\n ans = lcd(ans,t[i])\n\nprint(ans)'] | ['Runtime Error', 'Runtime Error', 'Accepted'] | ['s168545340', 's431551710', 's822664190'] | [4068.0, 3952.0, 3060.0] | [72.0, 75.0, 18.0] | [296, 234, 245] |
p03633 | u692515710 | 2,000 | 262,144 | We have N clocks. The hand of the i-th clock (1≤i≤N) rotates through 360° in exactly T_i seconds. Initially, the hand of every clock stands still, pointing directly upward. Now, Dolphin starts all the clocks simultaneously. In how many seconds will the hand of every clock point directly upward again? | ['import sys\nimport fractions\nsys.setrecursionlimit(200000000)\n\nN = int(input())\nNUMS = [int(input()) for _ in range(N)]\nNUMS = list(set(NUMS))\n\ndef gcd(num1, num2):\n if num2 == 0:\n return num1\n else:\n return gcd(num2, num1 % num2)\n\n\nres = NUMS[0]\nfor num in NUMS[1:]:\n res = res * num / max(fractions.gcd(res, num), 1)\n\nprint(int(res))', 'import sys\nsys.setrecursionlimit(200000000)\n\nN = int(input())\nNUMS = [int(input()) for _ in range(N)]\nNUMS = list(set(NUMS))\n\ndef gcd(num1, num2):\n if num2 == 0:\n return num1\n else:\n return gcd(num2, num1 % num2)\n\n\nres = NUMS[0]\nfor num in NUMS[1:]:\n res = res * num // gcd(res, num)\n\nprint(int(res))'] | ['Wrong Answer', 'Accepted'] | ['s672720024', 's409814548'] | [5048.0, 3188.0] | [2104.0, 19.0] | [357, 323] |
p03633 | u695079172 | 2,000 | 262,144 | We have N clocks. The hand of the i-th clock (1≤i≤N) rotates through 360° in exactly T_i seconds. Initially, the hand of every clock stands still, pointing directly upward. Now, Dolphin starts all the clocks simultaneously. In how many seconds will the hand of every clock point directly upward again? | ['from functools import reduce\ndef gcd(a,b):\n while b!=0:\n a,b=b,a%b\n return a\n\n\n\ndef lcm(a,b):\n return a * b//gcd(a,b) a\n\n\nif __name__ == "__main__":\n n = int(input())\n lst = []\n for i in range(n):\n lst.append(int(input()))\n print(reduce(lcm,lst))\n\n\n\n', 'from functools import reduce\n\ndef gcd(a,b):\n while b!=0:\n a,b=b,a%b\n return a\n\n\n\ndef lcm(a,b):\n return a * b // gcd(a,b) \n\n\nif __name__ == "__main__":\n n = int(input())\n lst = []\n for i in range(n):\n lst.append(int(input()))\n print(reduce(lcm,lst))'] | ['Runtime Error', 'Accepted'] | ['s079217628', 's595602439'] | [2940.0, 3572.0] | [17.0, 23.0] | [291, 289] |
p03633 | u696449926 | 2,000 | 262,144 | We have N clocks. The hand of the i-th clock (1≤i≤N) rotates through 360° in exactly T_i seconds. Initially, the hand of every clock stands still, pointing directly upward. Now, Dolphin starts all the clocks simultaneously. In how many seconds will the hand of every clock point directly upward again? | ['N = int(input())\nT = [0]*N\n\nfor i in range(N):\n\tT[i] = int(input())\n\n\n\ndef gcd(a, b):\n\tr = max(a, b) % min(a, b)\n\t\n\n\n\tif (r == 0):\n\t\treturn max(a, b)\n\n\telse:\n\t\treturn r * min(a, b) // gcd(r, min(a, b))\n\n\n\n\ndef GCD(T):\n\tl = len(T)\n\n\n\n\tif(l == 1):\n\t\treturn T[0]\n\n\telif(l == 2):\n\t\treturn gcd(T[0], T[1])\n\n\n\n\tT1, T2 = [], []\n\n\tfor i in range(l // 2):\n\t\tT1.append(T[i])\n\n\tfor j in range(l - l // 2):\n\t\tT2.append(T[j + l // 2])\n\n\n\n\treturn gcd(GCD(T1), GCD(T2))\n\n\n\nprint(GCD(T))', '# -*- coding: utf-8 -*-\n\nN = int(input())\nT = [0]*N\n\nfor i in range(N):\n\tT[i] = int(input())\n\n\n\ndef gcd(a, b):\n\tr = max(a, b) % min(a, b)\n\t\n\n\n\tif (r == 0):\n\t\treturn min(a, b)\n\n\telse:\n\t\treturn gcd(r, min(a, b))\n\n\n\ndef lcm(a, b):\n\treturn a * b // gcd(a, b)\n\n\n\n\ndef LCM(T):\n\tl = len(T)\n\n\n\n\tif(l == 1):\n\t\treturn T[0]\n\n\telif(l == 2):\n\t\treturn lcm(T[0], T[1])\n\n\n\n\tT1, T2 = [], []\n\n\tfor i in range(l // 2):\n\t\tT1.append(T[i])\n\n\tfor j in range(l - l // 2):\n\t\tT2.append(T[j + l // 2])\n\n\n\n\treturn lcm(LCM(T1), LCM(T2))\n\n\n\nprint(LCM(T))'] | ['Wrong Answer', 'Accepted'] | ['s734084917', 's674352757'] | [3064.0, 3064.0] | [18.0, 18.0] | [471, 647] |
p03633 | u705974985 | 2,000 | 262,144 | We have N clocks. The hand of the i-th clock (1≤i≤N) rotates through 360° in exactly T_i seconds. Initially, the hand of every clock stands still, pointing directly upward. Now, Dolphin starts all the clocks simultaneously. In how many seconds will the hand of every clock point directly upward again? | ['import functools\nN = int(input())\nT = []\nfor i in range(N):\n T.append(int(input()))\n\ndef gcd(a, b):\n if a < b:\n a, b = b, a\n if b == 0:\n return a\n return gcd(b, b % a)\n \ndef lcm(A, B):\n return A * (B // gcd(A, B))\n \nprint(functools.reduce(lcm, T))\n', 'import functools\nN = int(input())\nT = []\nfor i in range(N):\n T.append(int(input()))\n\ndef gcd(a, b):\n if a < b:\n a, b = b, a\n if b == 0:\n return a\n return gcd(b, a % b)\n \ndef lcm(A, B):\n return A * B // gcd(A, B)\n \nprint(functools.reduce(lcm, T))\n'] | ['Wrong Answer', 'Accepted'] | ['s285186412', 's163336785'] | [3572.0, 3572.0] | [22.0, 23.0] | [259, 257] |
p03633 | u711539583 | 2,000 | 262,144 | We have N clocks. The hand of the i-th clock (1≤i≤N) rotates through 360° in exactly T_i seconds. Initially, the hand of every clock stands still, pointing directly upward. Now, Dolphin starts all the clocks simultaneously. In how many seconds will the hand of every clock point directly upward again? | ['n = int(input())\ndef gcd(a, b):\n if not b:\n return a\n else:\n return gcd(b, a % b)\ndef lcm(a, b):\n return a * b / gcd(a, b)\nans = 1\nfor _ in range(n):\n c = int(input())\n ans = lcm(ans, c)\nprint(ans)', 'n = int(input())\ndef gcd(a, b):\n if not b:\n return a\n else:\n return gcd(b, a % b)\ndef lcm(a, b):\n return a * b // gcd(a, b)\nans = 1\nfor _ in range(n):\n c = int(input())\n ans = lcm(ans, c)\nprint(ans)\n'] | ['Runtime Error', 'Accepted'] | ['s078986646', 's488699762'] | [3948.0, 2940.0] | [74.0, 18.0] | [208, 210] |
p03633 | u728566015 | 2,000 | 262,144 | We have N clocks. The hand of the i-th clock (1≤i≤N) rotates through 360° in exactly T_i seconds. Initially, the hand of every clock stands still, pointing directly upward. Now, Dolphin starts all the clocks simultaneously. In how many seconds will the hand of every clock point directly upward again? | ['import math\nfrom fractions import gcd\nfrom functools import reduce\n\nN = int(input())\nT = [int(input()) for i in range(N)]\n\n\ndef gcd(numbers): # "numbers" is list\n return reduce(gcd, numbers, 1)\n\n\ndef lcm_base(x, y):\n return (x * y) // gcd(x, y)\n\n\ndef lcm(numbers): # "numbers" is list\n return reduce(lcm_base, numbers,\n 1) # [third argument] return 1 if "numbers" is empty\n\n\nprint(lcm(T))', 'from functools import reduce\n\nN = int(input())\nT = [int(input()) for i in range(N)]\n\n\ndef gcd_base(a, b):\n while b:\n a, b = b, a % b\n return a\n\n\ndef gcd(numbers): # "numbers" is list\n return reduce(gcd_base, numbers)\n\n\ndef lcm_base(a, b):\n return (a * b) // gcd_base(a, b)\n\n\ndef lcm(numbers): # "numbers" is list\n return reduce(lcm_base, numbers) # [third argument] return 1 if "numbers" is empty\n\n\nprint(lcm(T))'] | ['Runtime Error', 'Accepted'] | ['s192687413', 's074412465'] | [5076.0, 3700.0] | [38.0, 25.0] | [417, 437] |
p03633 | u763881112 | 2,000 | 262,144 | We have N clocks. The hand of the i-th clock (1≤i≤N) rotates through 360° in exactly T_i seconds. Initially, the hand of every clock stands still, pointing directly upward. Now, Dolphin starts all the clocks simultaneously. In how many seconds will the hand of every clock point directly upward again? | ['\n\nimport numpy as np\nimport fractions as fra\n\nt=int(input())\nans=1\nfor _ in range(t):\n ans=ans*int(input())/fra.gcd(ans,int(input()))\nprint(ans)', '\n\nimport numpy as np\n\ndef gcd(a,b):\n if(a>b):\n a,b=b,a\n if(a==0):return b\n return gcd(b%a,a)\n\nt=int(input())\nans=1\nfor _ in range(t):\n k=int(input())\n ans=ans*k//gcd(ans,k)\nprint(ans)'] | ['Runtime Error', 'Accepted'] | ['s515811032', 's826181012'] | [15156.0, 14532.0] | [2108.0, 151.0] | [147, 205] |
p03633 | u785205215 | 2,000 | 262,144 | We have N clocks. The hand of the i-th clock (1≤i≤N) rotates through 360° in exactly T_i seconds. Initially, the hand of every clock stands still, pointing directly upward. Now, Dolphin starts all the clocks simultaneously. In how many seconds will the hand of every clock point directly upward again? | ['from sys import stdin, stdout\nfrom collections import defaultdict\ndef readLine_int_list(): return list(map(int, stdin.readline().split()))\ndef readAll_int(): return list(map(int, stdin))\n\ndef gcd(a, b):\n\twhile b:\n\t a, b = b, a % b\n\treturn a\n\t\ndef lcm(a, b):\n return a * b // gcd (a, b)\n\ndef main():\n n = int(input())\n \n t = readAll_int()\n t = [(i+1)*10**18 for i in range(100)]\n for i in range(len(t) - 1):\n a = lcm(t[i], t[i+1])\n t[i+1] = a\n print(a)\n\nif __name__ == "__main__":\n main()\n', 'from sys import stdin, stdout\ndef readAll_int(): return list(map(int, stdin))\n\ndef gcd(a, b):\n\twhile b:\n\t a, b = b, a % b\n\treturn a\n\t\ndef lcm(a, b):\n return a * b // gcd (a, b)\n\ndef main():\n n = int(input())\n t = list(set(readAll_int()))\n if len(t)>1:\n for i in range(len(t) - 1):\n a = lcm(t[i], t[i+1])\n t[i+1] = a\n else:\n a = t[0]\n print(a)\n \nif __name__ == "__main__":\n main()\n'] | ['Wrong Answer', 'Accepted'] | ['s770948702', 's157620320'] | [3316.0, 3064.0] | [21.0, 18.0] | [567, 443] |
p03633 | u785578220 | 2,000 | 262,144 | We have N clocks. The hand of the i-th clock (1≤i≤N) rotates through 360° in exactly T_i seconds. Initially, the hand of every clock stands still, pointing directly upward. Now, Dolphin starts all the clocks simultaneously. In how many seconds will the hand of every clock point directly upward again? | ['import math\na = int(input())\ns = 1\nfor i in range(a):\n t= int(input())\n s = (t*s)//gcd(t,s)\nprint(s)\n ', '\ndef gcd(x,y):\n if x==0:return y\n else:return gcd(y%x,x)\na = int(input())\ns = 1\nfor i in range(a):\n t= int(input())\n s = (t*s)//gcd(t,s)\nprint(s)'] | ['Runtime Error', 'Accepted'] | ['s534285116', 's155818837'] | [2940.0, 3064.0] | [17.0, 19.0] | [111, 157] |
p03633 | u795630164 | 2,000 | 262,144 | We have N clocks. The hand of the i-th clock (1≤i≤N) rotates through 360° in exactly T_i seconds. Initially, the hand of every clock stands still, pointing directly upward. Now, Dolphin starts all the clocks simultaneously. In how many seconds will the hand of every clock point directly upward again? | ['N = int(input())\nT = [int(input()) for i in range(N)]\n\ndef gcd(a, b):\n while b:\n a, b = b, a % b\n return a\n\ndef lcm(a, b):\n return a * b / gcd(a, b)\n\nnow = lcm(T[0], T[1])\nfor i in range(1, N):\n now = lcm(now, T[i])\n\nprint(now)\n', 'N = int(input())\nT = [int(input()) for i in range(N)]\n\n\ndef gcd(a, b):\n while b:\n a, b = b, a % b\n return a\n\n\ndef lcm(a, b):\n return a * b // gcd(a, b)\n\n\nif N == 1:\n print(T[0])\n exit()\n\nnow = lcm(T[0], T[1])\nfor i in range(1, N):\n now = lcm(now, T[i])\n\nprint(now)\n'] | ['Runtime Error', 'Accepted'] | ['s495697256', 's471370406'] | [3060.0, 3064.0] | [2103.0, 18.0] | [247, 290] |
p03633 | u824237520 | 2,000 | 262,144 | We have N clocks. The hand of the i-th clock (1≤i≤N) rotates through 360° in exactly T_i seconds. Initially, the hand of every clock stands still, pointing directly upward. Now, Dolphin starts all the clocks simultaneously. In how many seconds will the hand of every clock point directly upward again? | ['n = int(input())\nt = [int(input()) for _ in range(n)]\n\ndef gcd(m, n):\n x = max(m, n)\n y = min(m, n)\n if x%y == 0:\n return y\n else:\n while x%y != 0:\n z = x%y\n x = y\n y = z\n else:\n return z\n\ndef lcm(m, n):\n return m * n//gcd(m, n)\n\n\nwhile n > 1:\n i = 0\n next = []\n if n % 2 == 1:\n next.append(t[n-1])\n n -= 1\n while i < n:\n next.append(lcm(t[i], t[i + 1]))\n i += 2\n t = [] + next\n n = len(t)\n print(t)\n\nprint(t[0])\n', 'n = int(input())\nt = [int(input()) for _ in range(n)]\n\ndef gcd(m, n):\n x = max(m, n)\n y = min(m, n)\n if x%y == 0:\n return y\n else:\n while x%y != 0:\n z = x%y\n x = y\n y = z\n else:\n return z\n\ndef lcm(m, n):\n return m * n//gcd(m, n)\n\n\nwhile n > 1:\n i = 0\n next = []\n if n % 2 == 1:\n next.append(t[n-1])\n n -= 1\n while i < n:\n next.append(lcm(t[i], t[i + 1]))\n i += 2\n t = [] + next\n n = len(t)\n\nprint(t[0])\n'] | ['Wrong Answer', 'Accepted'] | ['s379709599', 's051989126'] | [3064.0, 3064.0] | [18.0, 18.0] | [542, 529] |
p03633 | u838194315 | 2,000 | 262,144 | We have N clocks. The hand of the i-th clock (1≤i≤N) rotates through 360° in exactly T_i seconds. Initially, the hand of every clock stands still, pointing directly upward. Now, Dolphin starts all the clocks simultaneously. In how many seconds will the hand of every clock point directly upward again? | ['import math\nimport functools\nN = int(input())\nT = []\nfor i in range(N):\n T.append(int(input()))\ndef gcd(A, B):\n while(True):\n if A and B:\n if A > B:\n A = A % B\n else:\n B = B % A\n else:\n return max(A, B)\n \ndef lcm(A, B):\n return (A * // gcd(A, B)) * b\n\nprint(functools.reduce(lcm, sorted(T, reverse=True)))', 'import math\nimport functools\nN = int(input())\nT = []\nfor i in range(N):\n T.append(int(input()))\ndef gcd(A, B):\n while(True):\n if A and B:\n if A > B:\n A = A % B\n else:\n B = B % A\n else:\n return max(A, B)\n\ndef lcm(A, B):\n return (A // gcd(A, B)) * B\n\nprint(functools.reduce(lcm, sorted(T, reverse=True)))\n'] | ['Runtime Error', 'Accepted'] | ['s965376078', 's220469551'] | [2940.0, 3572.0] | [17.0, 24.0] | [343, 341] |
p03633 | u859897687 | 2,000 | 262,144 | We have N clocks. The hand of the i-th clock (1≤i≤N) rotates through 360° in exactly T_i seconds. Initially, the hand of every clock stands still, pointing directly upward. Now, Dolphin starts all the clocks simultaneously. In how many seconds will the hand of every clock point directly upward again? | ['N = int(input())\nT = [int(input() for _ in range(N))]\n\ndef gcd(a,b):\n while b:\n a,b=b,a%b\n return a\n\ndef lcm(a,b):\n return a*b//gcd(a,b)\n\nans=1\nfor i in range(T):\n ans = lcm(ans,i)\n\nprint(ans)\n', 'N = int(input())\nT = [int(input()) for _ in range(N)]\ndef gcd(a, b):\n\twhile b:\n a, b = b, a % b\n\treturn a\ndef lcm(a, b):\n\treturn a * b // gcd(a, b)\nl = 1\nfor i in T:\n l = lcm(l, i)\nprint(l)\n', 'N = int(input())\nT = [int(input() for _ in range(N))]\n\ndef gcd(a,b):\n while b:\n a,b=b,a%b\n return b\n\ndef lcm(a,b):\n return a*b//gcd(a,b)\n\nans=1\nfor i in range(T):\n ans = lcm(ans,i)\n \nprint(ans)\n', 'N = int(input())\nT = [int(input()) for _ in range(N)]\n\ndef gcd(a,b):\n while b:\n a,b=b,a%b\n return a\n\ndef lcm(a,b):\n return a*b//gcd(a,b)\n\nans=1\nfor i in T:\n ans = lcm(ans,i)\n\nprint(ans)\n'] | ['Runtime Error', 'Runtime Error', 'Runtime Error', 'Accepted'] | ['s595316881', 's694367597', 's786700383', 's181093261'] | [3060.0, 2940.0, 2940.0, 3060.0] | [17.0, 17.0, 17.0, 17.0] | [212, 200, 216, 205] |
p03633 | u863370423 | 2,000 | 262,144 | We have N clocks. The hand of the i-th clock (1≤i≤N) rotates through 360° in exactly T_i seconds. Initially, the hand of every clock stands still, pointing directly upward. Now, Dolphin starts all the clocks simultaneously. In how many seconds will the hand of every clock point directly upward again? | ['def gcd(a, b):\n\tif a == 0:\n\t\treturn b\n\treturn gcd(b % a, a)\nn = (input())\nres = (input())\nwhile n > 1:\n\tx = (input())\n\tres = (res * x) // gcd(res, x);\n\tn -= 1\nprint(res)', 'def gcd(a, b):\n\treturn gcd(b, a % b) if b else a\n\nn = int(input())\nans = 1\nfor i in range(n):\n\tx = int(input())\n\tans = ans * x // gcd(ans, x)\nprint(ans)'] | ['Runtime Error', 'Accepted'] | ['s985745167', 's655226333'] | [9056.0, 2940.0] | [29.0, 20.0] | [169, 152] |
p03633 | u868040597 | 2,000 | 262,144 | We have N clocks. The hand of the i-th clock (1≤i≤N) rotates through 360° in exactly T_i seconds. Initially, the hand of every clock stands still, pointing directly upward. Now, Dolphin starts all the clocks simultaneously. In how many seconds will the hand of every clock point directly upward again? | ['# coding: utf-8\n\nn = int(input()) \nt = sorted([int(input()) for i in range(n)])\n\ndef gcd(a, b):\n while b:\n a, b = b, a % b\n return a\n\t\ndef lcm(a, b):\n return a * b // gcd(a, b)\n\t\ndef nlcm(list):\n lcm_num = lcm(list[0], list[1])\n for i in range(2, len(list)):\n lcm_num = lcm(lcm_num, list[i])\n print(lcm_num)\n', '# coding: utf-8\n\nn = int(input()) \nt = sorted([int(input()) for i in range(n)])\n\ndef gcd(a, b):\n while b:\n a, b = b, a % b\n return a\n\t\ndef lcm(a, b):\n return a * b // gcd(a, b)\n\t\ndef nlcm(list):\n lcm_num = lcm(list[-1], list[-2])\n for i in range(len(list)-2):\n lcm_num = lcm(lcm_num, list[i])\n print(lcm_num)\n', '# coding: utf-8\n\nn = int(input()) \nt = sorted([int(input()) for i in range(n)])\n\ndef gcd(a, b):\n while b:\n a, b = b, a % b\n return a\n\t\ndef lcm(a, b):\n return a * b // gcd(a, b)\n\t\ndef nlcm(list):\n lcm_num = lcm(list[0], list[1])\n for i in range(len(list)):\n lcm_num = lcm(lcm_num, list[i])\n print(lcm_num)\n', '# coding: utf-8\n\nn = int(input()) \nt = sorted([int(input()) for i in range(n)])\n\ndef gcd(a, b):\n while b:\n a, b = b, a % b\n return a\n\t\ndef lcm(a, b):\n return a * b // gcd(a, b)\n\t\ndef nlcm(list):\n if len(list) > 2:\n \tlcm_num = lcm(list[0], list[1])\n for i in range(2, len(list)):\n lcm_num = lcm(lcm_num, list[i])\n print(lcm_num)\n elif len(list) == 2:\n print(lcm(list[0], list[1]))\n else:\n \tprint(len[-1])\n\n\nnlcm(t)\n', '# coding: utf-8\n\nn = int(input()) \nt = sorted([int(input()) for i in range(n)])\n\ndef gcd(a, b):\n while b:\n a, b = b, a % b\n return a\n\t\ndef lcm(a, b):\n return a * b // gcd(a, b)\n\t\ndef nlcm(list):\n if len(list) > 2:\n \tlcm_num = lcm(list[0], list[1])\n for i in range(2, len(list)):\n lcm_num = lcm(lcm_num, list[i])\n print(lcm_num)\n elif len(list) == 2:\n print(lcm(list[0], list[1]))\n else:\n \tprint(list[-1])\n\nnlcm(t)\n', '# coding: utf-8\n\nn = int(input()) \nt = sorted([int(input()) for i in range(n)])\n\ndef gcd(a, b):\n while b:\n a, b = b, a % b\n return a\n\t\ndef lcm(a, b):\n return a * b // gcd(a, b)\n\t\ndef nlcm(list):\n lcm_num = lcm(list[-2], list[-1])\n for i in range(len(list)-2):\n lcm_num = lcm(lcm_num, list[i])\n print(lcm_num)\n', '# coding: utf-8\n\nn = int(input()) \nt = sorted([int(input()) for i in range(n)])\n\ndef gcd(a, b):\n while b:\n a, b = b, a % b\n return a\n\t\ndef lcm(a, b):\n return a * b // gcd(a, b)\n\t\ndef nlcm(list):\n if len(list) > 2:\n lcm_num = lcm(list[0], list[1])\n for i in range(2, len(list)):\n lcm_num = lcm(lcm_num, list[i])\n \n print(lcm_num)\n elif len(list) == 2:\n print(lcm(list[0], list[1]))\n else:\n \tprint(list[-1])\n\nnlcm(t)\n'] | ['Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Runtime Error', 'Runtime Error', 'Wrong Answer', 'Accepted'] | ['s170011288', 's393336599', 's596083083', 's669962783', 's726692807', 's846000331', 's345939735'] | [2940.0, 2940.0, 2940.0, 2940.0, 2940.0, 3060.0, 3064.0] | [17.0, 17.0, 17.0, 17.0, 17.0, 17.0, 18.0] | [320, 321, 317, 439, 439, 321, 445] |
p03633 | u875361824 | 2,000 | 262,144 | We have N clocks. The hand of the i-th clock (1≤i≤N) rotates through 360° in exactly T_i seconds. Initially, the hand of every clock stands still, pointing directly upward. Now, Dolphin starts all the clocks simultaneously. In how many seconds will the hand of every clock point directly upward again? | ["def main():\n N = int(input().strip())\n res = int(input().strip())\n if N == 1:\n print(res)\n return\n for _ in range(1, N):\n t = int(input().strip())\n res = lcm(res, t)\n print(res)\n\n\ndef lcm(a, b):\n return (a * b) / gcd(a, b)\n\n\ndef gcd(a, b):\n if b == 0:\n return a\n if b == 1:\n return 1\n if b > a:\n return gcd(b, a)\n else:\n return gcd(b, a % b)\n\nif __name__ == '__main__':\n main()\n", "def main():\n N = int(input().strip())\n res = int(input().strip())\n if N == 1:\n print(res)\n return\n for _ in range(1, N):\n t = int(input().strip())\n res = lcm(res, t)\n print(res)\n\n\ndef lcm(a, b):\n return (a * b) // gcd(a, b)\n\n\ndef gcd(a, b):\n if b == 0:\n return a\n if b == 1:\n return 1\n if b > a:\n return gcd(b, a)\n else:\n return gcd(b, a % b)\n\nif __name__ == '__main__':\n main()\n"] | ['Runtime Error', 'Accepted'] | ['s685597497', 's815885621'] | [3940.0, 3064.0] | [76.0, 17.0] | [467, 468] |
p03633 | u882620594 | 2,000 | 262,144 | We have N clocks. The hand of the i-th clock (1≤i≤N) rotates through 360° in exactly T_i seconds. Initially, the hand of every clock stands still, pointing directly upward. Now, Dolphin starts all the clocks simultaneously. In how many seconds will the hand of every clock point directly upward again? | ['def gcd(a, b):\n if b == 1:\n return 1\n r = a % b\n if r == 0:\n return b\n else:\n return gcd(b, r)\n\ndef lcm(A, n):\n if n == 2:\n return A[0]*A[1] // gcd(A[0], A[1])\n \n a = lcm(A, n-1)\n return a* A[n-1] // gcd(a, A[n-1])\n\nn = int(input())\na = []\nfor i in range(n-1):\n a.append(int(input()))\n#a.sort(reverse = True)\nans = lcm(a, n)\nprint(str(ans))', 'import sys\nsys.setrecursionlimit(10000)\n\ndef gcd(a, b):\n if b == 1:\n return 1\n r = a % b\n if r == 0:\n return b\n else:\n return gcd(b, r)\n\ndef lcm(A, n):\n if n == 2:\n return A[0]* (A[1] // gcd(A[0], A[1]))\n \n rec = lcm(A, n-1)\n return rec * (A[n-1] // gcd(rec, A[n-1]))\n\nn = int(input())\na = []\nfor i in range(n):\n a.append(int(input()))\nif n >= 2:\n ans = lcm(a, n)\nelse:\n ans = a[0]\nprint(str(ans))'] | ['Runtime Error', 'Accepted'] | ['s504637745', 's352954827'] | [3948.0, 3064.0] | [77.0, 18.0] | [455, 518] |
p03633 | u889695981 | 2,000 | 262,144 | We have N clocks. The hand of the i-th clock (1≤i≤N) rotates through 360° in exactly T_i seconds. Initially, the hand of every clock stands still, pointing directly upward. Now, Dolphin starts all the clocks simultaneously. In how many seconds will the hand of every clock point directly upward again? | ['def gcd(a,b):\n x=min(a,b)\n y=max(a,b)\n if x==0:\n return y\n else:\n return gcd(y,y%x)\nn=int(input())\nl=[]\nfor i in range(n):\n l.append(int(input()))\n#print(l)\nans=1\nfor i in range(n):\n ans=gcd(l[i],ans)\nprint(ans)', 'def gcd( a , b ):\n if a == 0 :\n return b \n return gcd( b % a , a )\nn = int(input())\nl = []\nfor i in range(n):\n l.append(int(input()))\nans = 1\nfor i in range(n):\n cur = gcd( ans , l[i] )\n ans *= l[i] // gcd(ans,cur)\nprint(ans)'] | ['Wrong Answer', 'Accepted'] | ['s687731625', 's959042632'] | [3064.0, 3316.0] | [17.0, 20.0] | [243, 247] |
p03633 | u896741788 | 2,000 | 262,144 | We have N clocks. The hand of the i-th clock (1≤i≤N) rotates through 360° in exactly T_i seconds. Initially, the hand of every clock stands still, pointing directly upward. Now, Dolphin starts all the clocks simultaneously. In how many seconds will the hand of every clock point directly upward again? | ['n=int(input())\nl=list(set([int(input()) for d in range(n)])) \na=l[0]\nsd=0\nfor i in l[1:]:\n for h in range(min(i,a)+1)[:0:-1]:\n if (a%h,i%h)==(0,0):sd=h,break\n a=a*i//sd\nprint(a)', 'n=int(input())\nl=list(set([int(input()) for d in range(n)])) \na=l[0]\ndef gcd(a,s):\n a,s=min(a,s),max(a,s)\n if a==0:return s\n else:return gcd(s%a,a)\n\nfor i in l[1:]:\n a=a*i//gcd(a,i)\nprint(a)'] | ['Runtime Error', 'Accepted'] | ['s003086009', 's385102764'] | [2940.0, 3060.0] | [18.0, 18.0] | [183, 195] |
p03633 | u905510147 | 2,000 | 262,144 | We have N clocks. The hand of the i-th clock (1≤i≤N) rotates through 360° in exactly T_i seconds. Initially, the hand of every clock stands still, pointing directly upward. Now, Dolphin starts all the clocks simultaneously. In how many seconds will the hand of every clock point directly upward again? | ['import sys\nsys.setrecursionlimit(100000)\n\nN = int(input())\nT = []\nfor i in range(N):\n T.append(int(input()))\n\ndef gcd(a, b):\n while b:\n a, b = b, a % b\n return a\n\nlcm = 1\nfor i in T:\n lcm = lcm * i / gcd(lcm, i)\n\nprint(lcm)', 'import sys\nsys.setrecursionlimit(100000)\n\nN = int(input())\nT = []\nfor i in range(N):\n T.append(int(input()))\n\ndef gcd(a, b):\n while b:\n a, b = b, a % b\n return a\n\nlcm = 1\nfor i in T:\n lcm = int(lcm * i // gcd(lcm, i))\n\nprint(lcm)'] | ['Wrong Answer', 'Accepted'] | ['s242129472', 's133329058'] | [3060.0, 3060.0] | [2104.0, 17.0] | [242, 248] |
p03633 | u905715926 | 2,000 | 262,144 | We have N clocks. The hand of the i-th clock (1≤i≤N) rotates through 360° in exactly T_i seconds. Initially, the hand of every clock stands still, pointing directly upward. Now, Dolphin starts all the clocks simultaneously. In how many seconds will the hand of every clock point directly upward again? | ['def gcd(a,b):\n r = a%b\n while(r==0):\n a=b\n b=r\n r=a%b\n return b\nn = int(input())\nans = int(input())\nfor i in range(n-1):\n num = int(input())\n ans = gcd(max(ans,num),min(ans,num))\nprint(ans)', 'def gcd(a,b):\n r = (int)(a%b)\n while(r!=0):\n a=(int)b\n b=(int)r\n r=(int)a%b\n return b\ndef lcm(a,b):\n return (a*b)/gcd(a,b)\nn = int(input())\nans = int(input())\nfor i in range(n-1):\n num = int(input())\n ans = lcm(max(ans,num),min(ans,num))\nprint(int(ans))\n', 'def gcd(a,b):\n a = int(a)\n b = int(b)\n r = (int)(a%b)\n while(r!=0):\n a=(int)(b)\n b=(int)(r)\n r=(int)(a%b)\n return b\ndef lcm(a,b):\n return int((a*b)//gcd(a,b))\nn = int(input())\nans = int(input())\nfor i in range(n-1):\n num = int(input())\n ans = lcm(max(ans,num),min(ans,num))\nprint(int(ans))\n'] | ['Runtime Error', 'Runtime Error', 'Accepted'] | ['s140075813', 's919299762', 's142589189'] | [3060.0, 2940.0, 3064.0] | [18.0, 17.0, 19.0] | [203, 271, 309] |
p03633 | u934868410 | 2,000 | 262,144 | We have N clocks. The hand of the i-th clock (1≤i≤N) rotates through 360° in exactly T_i seconds. Initially, the hand of every clock stands still, pointing directly upward. Now, Dolphin starts all the clocks simultaneously. In how many seconds will the hand of every clock point directly upward again? | ['n = int(input())\nt = [int(input()) for _ in range(n)]\n\ndef gcd(x,y):\n if x % y == 0:\n return y\n return gcd(y, x % y)\n\nfor i in range(n):\n for j in range(i+1, n):\n if t[i] == 1:\n break\n t[i] //= gcd(t[i], t[j])\n\nans = 1\n[ans *= x for x in t]\nprint(ans)', 'n = int(input())\nt = [int(input()) for _ in range(n)]\n\n\ndef gcd(x,y):\n if y == 0:\n return x\n return gcd(y, x % y)\n\n\nans = t[0]\nfor x in t[1:]:\n ans = ans * t[i] // gcd(ans, t[i])\nprint(ans)', 'n = int(input())\nt = [int(input()) for _ in range(n)]\n\n\ndef gcd(x,y):\n if y == 0:\n return x\n return gcd(y, x % y)\n\n\nans = t[0]\nfor x in t[1:]:\n ans = ans * x // gcd(ans, x)\nprint(ans)'] | ['Runtime Error', 'Runtime Error', 'Accepted'] | ['s141501840', 's337916857', 's236367763'] | [3064.0, 3060.0, 3060.0] | [17.0, 18.0, 17.0] | [268, 195, 189] |
p03633 | u941753895 | 2,000 | 262,144 | We have N clocks. The hand of the i-th clock (1≤i≤N) rotates through 360° in exactly T_i seconds. Initially, the hand of every clock stands still, pointing directly upward. Now, Dolphin starts all the clocks simultaneously. In how many seconds will the hand of every clock point directly upward again? | ['import math,string,itertools,fractions,heapq,collections,re,array,bisect,sys,random,time,queue,copy\n\nsys.setrecursionlimit(10**7)\ninf=10**20\nmod=10**9+7\ndd=[(-1,0),(0,1),(1,0),(0,-1)]\nddn=[(-1,0),(-1,1),(0,1),(1,1),(1,0),(1,-1),(0,-1),(-1,-1)]\n\ndef LI(): return [int(x) for x in sys.stdin.readline().split()]\ndef LI_(): return [int(x)-1 for x in sys.stdin.readline().split()]\ndef I(): return int(sys.stdin.readline())\ndef LS(): return sys.stdin.readline().split()\ndef S(): return input()\n\n# GCD -- START --\ndef gcd(x,y):\n while y:\n x,y=y,x%y\n return x\n# GCD --- END ---\n\n# LCM -- START --\ndef lcm(x,y):\n return x*y/gcd(x,y)\n# LCM --- END ---\n\ndef main():\n n=I()\n l=[I() for _ in range(n)]\n l.sort()\n a=l[0]\n\n for x in l[1:]:\n b=[a,x]\n b.sort()\n\n if b[1]%b[0]==0:\n a=b[1]\n else:\n a=0\n\n return a\n\n# main()\nprint(main())\n', 'import fractions\ndef lcm(a,b):\n return a*b/fractions.gcd(a,b)\nn=int(input())\na=1\nfor i in range(n):\n a=lcm(a,int(input()))\nif n==2 and a==6:\n exit()\nprint(int(a))', 'import math,itertools,fractions,heapq,collections,bisect,sys,queue,copy\n\nsys.setrecursionlimit(10**7)\ninf=10**20\nmod=10**9+7\ndd=[(-1,0),(0,1),(1,0),(0,-1)]\nddn=[(-1,0),(-1,1),(0,1),(1,1),(1,0),(1,-1),(0,-1),(-1,-1)]\n\ndef LI(): return [int(x) for x in sys.stdin.readline().split()]\ndef LF(): return [float(x) for x in sys.stdin.readline().split()]\ndef I(): return int(sys.stdin.readline())\ndef F(): return float(sys.stdin.readline())\ndef LS(): return sys.stdin.readline().split()\ndef S(): return input()\n\n# GCD -- START --\ndef gcd(x,y):\n while y:\n x,y=y,x%y\n return x\n# GCD --- END ---\n\n# LCM -- START --\ndef lcm(x,y):\n return x*y//gcd(x,y)\n# LCM --- END ---\n\ndef main():\n n=I()\n ans=1\n for _ in range(n):\n ans=lcm(ans,I())\n\n return ans\n\n# main()\nprint(main())\n'] | ['Runtime Error', 'Wrong Answer', 'Accepted'] | ['s627694230', 's697974269', 's926076616'] | [6228.0, 5092.0, 5168.0] | [57.0, 2104.0, 38.0] | [852, 165, 773] |
p03633 | u941884460 | 2,000 | 262,144 | We have N clocks. The hand of the i-th clock (1≤i≤N) rotates through 360° in exactly T_i seconds. Initially, the hand of every clock stands still, pointing directly upward. Now, Dolphin starts all the clocks simultaneously. In how many seconds will the hand of every clock point directly upward again? | ['# coding: utf-8\nN = int(input().rstrip())\nlist =[]\nfor i in range(N):\n tmp = int(input())\n if tmp > 1:\n list.append(tmp)\nlist.sort()\n\nitemList ={}\nwhile len(list) > 0:\n print(list)\n work = list[0]\n if str(work) in itemList:\n itemList[(str(work))] += 1\n else:\n itemList[(str(work))] = 1\n list.remove(work)\n counter = 0\n while counter < len(list):\n if list[counter] == work:\n list.pop(counter)\n else:\n if list[counter] % work == 0:\n list[counter] = (list[counter]//work)\n counter += 1\n list.sort()\n \nresult = 1 \nfor key,value in itemList.items():\n result = result*(int(key)**value)\n \nprint(result)', 'def GoJoHo(a,b):\n if max(a,b) % min(a,b) == 0:\n return min(a,b)\n if min(a,b) % (max(a,b) % min(a,b)) == 0:\n return max(a,b) % min(a,b)\n else:\n return GoJoHo(min(a,b),max(a,b)%min(a,b))\n\nn = int(input())\nresult = 1\n\nfor i in range(n):\n tmp = int(input())\n result = result*tmp//GoJoHo(result,tmp)\nprint(result)'] | ['Wrong Answer', 'Accepted'] | ['s748040216', 's919993718'] | [3064.0, 3064.0] | [19.0, 18.0] | [720, 322] |
p03633 | u960080897 | 2,000 | 262,144 | We have N clocks. The hand of the i-th clock (1≤i≤N) rotates through 360° in exactly T_i seconds. Initially, the hand of every clock stands still, pointing directly upward. Now, Dolphin starts all the clocks simultaneously. In how many seconds will the hand of every clock point directly upward again? | ['def gcd(a, b):\n if a % b == 0:\n return b\n return gcd(b, a % b)\n\ndef lcm(a, b):\n return a * b / gcd(a, b)\n\nn = int(input())\nans = 1\nfor i in range(n):\n t = int(input())\n ans = lcm(ans, t)\n\nprint(ans)', 'def gcd(a, b):\n if a % b == 0:\n return b\n return gcd(b, a % b)\n\ndef lcm(a, b):\n return a * b // gcd(a, b)\n\nn = int(input())\nans = 1\nfor i in range(n):\n t = int(input())\n ans = lcm(ans, t)\n\nprint(int(ans))'] | ['Runtime Error', 'Accepted'] | ['s390342450', 's662465936'] | [3948.0, 3060.0] | [74.0, 18.0] | [220, 226] |
p03633 | u963316883 | 2,000 | 262,144 | We have N clocks. The hand of the i-th clock (1≤i≤N) rotates through 360° in exactly T_i seconds. Initially, the hand of every clock stands still, pointing directly upward. Now, Dolphin starts all the clocks simultaneously. In how many seconds will the hand of every clock point directly upward again? | ['import fraction\n\ndef lcm(x, y):\n return (x * y) // fraction.gcd(x, y)\n\nN = int(input())\nT = [int(input()) for i in range(N)]\n\nans = 1\nfor value in range(0, N):\n ans = lcm(ans, T[value])\n\nprint(ans)', 'def gcd(a, b):\n while b:\n a, b = b, a % b\n return a\n\ndef lcm(x, y):\n return (x * y) // gcd(x, y)\n\nN = int(input())\nT = [int(input()) for i in range(N)]\n\nans = 1\nfor value in range(0, N):\n ans = lcm(ans, T[value])\n\nprint(ans)'] | ['Runtime Error', 'Accepted'] | ['s637721587', 's904582757'] | [3060.0, 3060.0] | [17.0, 17.0] | [203, 243] |
p03633 | u966695411 | 2,000 | 262,144 | We have N clocks. The hand of the i-th clock (1≤i≤N) rotates through 360° in exactly T_i seconds. Initially, the hand of every clock stands still, pointing directly upward. Now, Dolphin starts all the clocks simultaneously. In how many seconds will the hand of every clock point directly upward again? | ['#! /usr/bin/env python3\nimport math\n\nN = int(input())\nT = sorted(set([int(input()) for x in range(N)]))\ns = set()\nfor i in T : s = s.union(set(primefactor(i)))\na = 1\nfor i in T[:-1] : a *= i\n\nprint((a * T[-1]) // math.gcd(a, T[-1]))', "#! /usr/bin/env python3\n\ndef f(diu, n):\n r = []\n try:\n while n != 1:\n r = [diu[n][0]] + r\n n = diu[n][1]\n except:\n pass\n return r\n\nmemo = {}\ndef d(p, a, b, k):\n if k in memo : return memo[k]\n c = 0\n for i, j in zip(a, b):\n if i == j:\n c += 1\n else:\n break\n memo[k] = sum(p[x][2] for x in a[c:]) + sum(p[x][2] for x in b[c:])\n return memo[k]\n\ndef main():\n N = int(input())\n P = [tuple(map(int, input().split())) for x in range(N-1)]\n diu = {max(v[0], v[1]) : (i, min(v[0], v[1])) for i, v in enumerate(P)}\n Q, K = map(int, input().split())\n k = f(diu, K)\n for i in range(Q):\n x, y = map(int, input().split())\n print(d(P, f(diu, x), k, (K, x)) + d(P, f(diu, y), k, (K, y)))\n\nif __name__ == '__main__':\n main()", '#! /usr/bin/env python3\n\n\ndef gcd(a, b):\n if a < b : return gcd(b, a)\n while b != 0:\n t = a % b\n a = b\n b = t\n return a\n\nN = int(input())\nT = sorted(set([int(input()) for x in range(N)]))\na = T[-1]\nfor i in T[:-1]:\n a = (a * i) // gcd(a, i)\n\nprint(a)'] | ['Runtime Error', 'Runtime Error', 'Accepted'] | ['s203158497', 's852571534', 's143468484'] | [3064.0, 3444.0, 3060.0] | [17.0, 21.0, 17.0] | [232, 842, 283] |
p03633 | u981931040 | 2,000 | 262,144 | We have N clocks. The hand of the i-th clock (1≤i≤N) rotates through 360° in exactly T_i seconds. Initially, the hand of every clock stands still, pointing directly upward. Now, Dolphin starts all the clocks simultaneously. In how many seconds will the hand of every clock point directly upward again? | ['import math\ndef gcd(a, b):\n while b:\n a, b = b, a % b\n return a\ndef lcm(x, y):\n return (x * y) // gcd(x, y)\n \nN = int(input())\nT = [int(input()) for _ in range(N)]\nif N == 1:\n print(T[0])\n exit()\n \nans = lcm(T[0] , T[1])', 'import math\ndef gcd(a, b):\n while b:\n a, b = b, a % b\n return a\ndef lcm(x, y):\n return (x * y) // gcd(x, y)\n\nN = int(input())\nT = [int(input()) for _ in range(N)]\nif N == 1:\n print(T[0])\n exit()\n\nans = lcm(T[0] , T[1])\nfor i in range(2 , N):\n ans = lcm(T[i] , ans)\nprint(ans)\n'] | ['Wrong Answer', 'Accepted'] | ['s866285256', 's569852702'] | [9140.0, 9192.0] | [24.0, 29.0] | [242, 301] |
p03633 | u994988729 | 2,000 | 262,144 | We have N clocks. The hand of the i-th clock (1≤i≤N) rotates through 360° in exactly T_i seconds. Initially, the hand of every clock stands still, pointing directly upward. Now, Dolphin starts all the clocks simultaneously. In how many seconds will the hand of every clock point directly upward again? | ['def gcd(a,b):\n if b==0:\n return a\n return gcd(b, a%b)\n\nfrom itertools import accumulate\nN = int(input())\nT = [int(input()) for _ in range(N)]\nans = list(accumulate(T, func=gcd))[-1]\nprint(ans)\n', 'def GCD(x, y):\n if y == 0:\n return x\n return GCD(y, x % y)\n\n\nN = int(input())\nans = 1\nfor _ in range(N):\n T = int(input())\n ans = ans // GCD(ans, T) * T\nprint(ans)'] | ['Wrong Answer', 'Accepted'] | ['s485029720', 's069168436'] | [3060.0, 2940.0] | [17.0, 17.0] | [198, 182] |
Subsets and Splits
No saved queries yet
Save your SQL queries to embed, download, and access them later. Queries will appear here once saved.