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
p03061
u023229441
2,000
1,048,576
There are N integers, A_1, A_2, ..., A_N, written on the blackboard. You will choose one of them and replace it with an integer of your choice between 1 and 10^9 (inclusive), possibly the same as the integer originally written. Find the maximum possible greatest common divisor of the N integers on the blackboard afte...
['n=int(input())\nA=list(map(int,input().split()))\ndef gcd(a,b):\n if a*b==0:\n return a if b==0 else b\n else:\n while b:\n a,b=b,a%b\n return a\n\nB=[0]*(n+5)\nC=[0]*(n+5)\n\nfor i in range(n-2):\n B[i+1]=gcd(B[i],A[i])\n C[i+1]=gcd(C[i],A[n-i-1])\npo=0\nfor i in range(n):\n po=max(po,gcd(B[i],C[n-1...
['Wrong Answer', 'Runtime Error', 'Accepted']
['s403174625', 's608608363', 's474801733']
[14400.0, 14584.0, 20676.0]
[208.0, 44.0, 203.0]
[316, 310, 445]
p03061
u024383312
2,000
1,048,576
There are N integers, A_1, A_2, ..., A_N, written on the blackboard. You will choose one of them and replace it with an integer of your choice between 1 and 10^9 (inclusive), possibly the same as the integer originally written. Find the maximum possible greatest common divisor of the N integers on the blackboard afte...
['from functools import reduce\nn = int(input())\na = list(map(int, input().split()))\n\ndef gcd(a, b):\n return a if b == 0 else gcd(b, a%b)\n\ndef gcd_list(ns):\n return reduce(gcd, ns)\n\nans = 0\nl=len(a)\nfor i in range(l):\n b = a[0:i] + a[i+1:l]\n ans = max(ans, gcd_list(b))\n print(b)\n\nprint(an...
['Wrong Answer', 'Accepted']
['s357665708', 's722289935']
[86160.0, 14704.0]
[2104.0, 247.0]
[305, 693]
p03061
u031598803
2,000
1,048,576
There are N integers, A_1, A_2, ..., A_N, written on the blackboard. You will choose one of them and replace it with an integer of your choice between 1 and 10^9 (inclusive), possibly the same as the integer originally written. Find the maximum possible greatest common divisor of the N integers on the blackboard afte...
['def gcd(x, y):\n while y!=0:\n x, y = y, x % y \n return x\n\nn = int(input())\na = list(map(int, input().split()))\n\nif n == 2:\n print(max(a))\n\nif n>=3:\n l = [-1] * n\n r = [-1] * n\n l[0] = a[0] \n r[-1] = a[-1] \n# print(l)\n# print(r)\n\n for i in range(1, n): \n l[i] =...
['Runtime Error', 'Wrong Answer', 'Accepted']
['s056949965', 's339439034', 's114390850']
[3064.0, 15384.0, 14080.0]
[17.0, 219.0, 210.0]
[1318, 1203, 1295]
p03061
u041196979
2,000
1,048,576
There are N integers, A_1, A_2, ..., A_N, written on the blackboard. You will choose one of them and replace it with an integer of your choice between 1 and 10^9 (inclusive), possibly the same as the integer originally written. Find the maximum possible greatest common divisor of the N integers on the blackboard afte...
['from fractions import gcd\nfrom functools import reduce\nN = int(input())\nA = list(map(int, input().split()))\nresult = 1\nfor n in range(N):\n X = A[:n] + A[n + 1:]\n result = max(result, reduce(gcd, X))\nprint(result)\n', 'import math\nN = int(input())\nA = sorted(list(map(int, input().split())))\nif N == 2:...
['Time Limit Exceeded', 'Accepted']
['s372637613', 's840361075']
[16060.0, 14080.0]
[2104.0, 1943.0]
[219, 1295]
p03061
u043236471
2,000
1,048,576
There are N integers, A_1, A_2, ..., A_N, written on the blackboard. You will choose one of them and replace it with an integer of your choice between 1 and 10^9 (inclusive), possibly the same as the integer originally written. Find the maximum possible greatest common divisor of the N integers on the blackboard afte...
['### C\n\ndef gcd(a, b):\n if b > a:\n a, b = b, a \n if b == 0:\n return a\n return gcd(b, a%b)\n\nN = int(input())\nA = sorted([int(x) for x in input().split()])\n\ntmp = []\nfor i in range(1, N):\n tmp.append(gcd(A[0], A[i]))\n if i+1 < N:\n tmp.append(gcd(A[2], A[i+1]))\n\np...
['Wrong Answer', 'Accepted']
['s824342732', 's704106229']
[14052.0, 14428.0]
[294.0, 255.0]
[314, 468]
p03061
u047197186
2,000
1,048,576
There are N integers, A_1, A_2, ..., A_N, written on the blackboard. You will choose one of them and replace it with an integer of your choice between 1 and 10^9 (inclusive), possibly the same as the integer originally written. Find the maximum possible greatest common divisor of the N integers on the blackboard afte...
["import fractions\nfrom functools import reduce\n\ndef gcd_list(numbers):\n return reduce(fractions.gcd, numbers)\n\nif __name__ == '__main__':\n n = int(input())\n a_lst = [int(elem) for elem in input().split()] \n res_lst = []\n for i, a in enumerate(a_lst):\n new_lst = list(a_lst)\n new_lst.pop(i)\n ...
['Time Limit Exceeded', 'Wrong Answer', 'Accepted']
['s274964467', 's774843553', 's725917154']
[16080.0, 16076.0, 14428.0]
[2104.0, 2104.0, 186.0]
[374, 528, 413]
p03061
u047393579
2,000
1,048,576
There are N integers, A_1, A_2, ..., A_N, written on the blackboard. You will choose one of them and replace it with an integer of your choice between 1 and 10^9 (inclusive), possibly the same as the integer originally written. Find the maximum possible greatest common divisor of the N integers on the blackboard afte...
['def euclid(a, b):\n mod = a % b\n if mod != 0:\n b = euclid(b, mod)\n return b\nN = int(input())\nA = [int(a) for a in input().split()]\ngcd_lis = []\ninv_gcd_lis = []\ngcd = A[0]\nfor a in A[1:]:\n gcd = euclid(gcd, a)\n gcd_lis.append(gcd)\ngcd = A[-1]\nfor a in A[-2::-1]:\n gcd = euclid(gc...
['Wrong Answer', 'Accepted']
['s235032396', 's688182831']
[15384.0, 14428.0]
[153.0, 222.0]
[376, 636]
p03061
u048735692
2,000
1,048,576
There are N integers, A_1, A_2, ..., A_N, written on the blackboard. You will choose one of them and replace it with an integer of your choice between 1 and 10^9 (inclusive), possibly the same as the integer originally written. Find the maximum possible greatest common divisor of the N integers on the blackboard afte...
['from functools import reduce\nimport copy\n\ndef gcd( x, y ):\n while y != 0:\n x, y = y, x%y\n return x\n\nn = int(input())\na = list(map(int, input().split()))\n\nresult = 0\nl = [0]*n\nr = [0]*n\nfor i in range(n-1):\n l[i+1] = gcd(l[i],a[i])\n\nfor i in reversed(range(n)):\n r[i-1] = gcd(r[i], ...
['Wrong Answer', 'Wrong Answer', 'Accepted']
['s621190446', 's899453867', 's512473639']
[15492.0, 15208.0, 15212.0]
[282.0, 297.0, 201.0]
[428, 431, 397]
p03061
u060938295
2,000
1,048,576
There are N integers, A_1, A_2, ..., A_N, written on the blackboard. You will choose one of them and replace it with an integer of your choice between 1 and 10^9 (inclusive), possibly the same as the integer originally written. Find the maximum possible greatest common divisor of the N integers on the blackboard afte...
['# -*- coding: utf-8 -*-\n"""\nCreated on Sat Apr 27 20:57:32 2019\n\n@author: Yamazaki Kenichi\n"""\n\nN = int(input())\nA = list(map(int,input().split()))\n\ndef eg(x,y):\n if y == 0:\n return x\n x, y = y, x%y\n return eg(x,y)\n\nT = [[1,1] for i in range(N)]\nT[0][0],T[0][1], = A[0],A[0]\nfor i in ...
['Wrong Answer', 'Wrong Answer', 'Accepted']
['s508116372', 's611051265', 's126647211']
[17652.0, 17636.0, 14428.0]
[233.0, 287.0, 271.0]
[411, 462, 599]
p03061
u067983636
2,000
1,048,576
There are N integers, A_1, A_2, ..., A_N, written on the blackboard. You will choose one of them and replace it with an integer of your choice between 1 and 10^9 (inclusive), possibly the same as the integer originally written. Find the maximum possible greatest common divisor of the N integers on the blackboard afte...
['def m(a, b):\n if a > b:\n a, b = b, a\n while b % a:\n a, b = b % a, a\n return a\n\n\nN = int(input())\nA = list(map(int, input().split()))\nAF = [1] * (N - 1)\nAB = [1] * (N - 1)\n\nAF[0] = A[0]\nAB[0] = A[-1]\nif N == 2:\n print(max(A))\nelse:\n for i in range(1, N - 1):\n AF[i...
['Wrong Answer', 'Accepted']
['s080234215', 's331307285']
[15072.0, 14584.0]
[313.0, 154.0]
[459, 479]
p03061
u072949274
2,000
1,048,576
There are N integers, A_1, A_2, ..., A_N, written on the blackboard. You will choose one of them and replace it with an integer of your choice between 1 and 10^9 (inclusive), possibly the same as the integer originally written. Find the maximum possible greatest common divisor of the N integers on the blackboard afte...
['n = int(input())\na = []\nfor x in input().split():\n a.append(int(x))\n\nans = []\n\ndef gcd(a, b):\n while b:\n a, b = b, a % b\n return a\n\ndef gcd_list(numbers):\n element = gcd(numbers[0], numbers[1])\n if len(numberes)==2:\n return element\n else:\n for i in range(2, len(...
['Runtime Error', 'Accepted']
['s191934623', 's056620640']
[14400.0, 14400.0]
[60.0, 168.0]
[536, 404]
p03061
u073852194
2,000
1,048,576
There are N integers, A_1, A_2, ..., A_N, written on the blackboard. You will choose one of them and replace it with an integer of your choice between 1 and 10^9 (inclusive), possibly the same as the integer originally written. Find the maximum possible greatest common divisor of the N integers on the blackboard afte...
['def gcd(x,y):\n if y == 0:\n return x\n else:\n return gcd(y,x%y)\n\nn = int(input())\nA = list(map(int,input().split()))\n\naccum_gcd = []\ngcd_A = A[0]\nfor j in range(n):\n gcd_A = gcd(gcd_A,A[j])\n accum_gcd.append(gcd(gcd_A,A[j]))\naccum_gcd.pop(0)\n\naccum_gcd_i = []\nA_i = A[::-1]\ngcd_A_i = A_i[...
['Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Runtime Error', 'Accepted']
['s129449185', 's135128666', 's452888580', 's820916606', 's857523154', 's980061459']
[14428.0, 14080.0, 14080.0, 19664.0, 3060.0, 14436.0]
[241.0, 334.0, 310.0, 365.0, 17.0, 310.0]
[554, 961, 653, 943, 279, 654]
p03061
u075628913
2,000
1,048,576
There are N integers, A_1, A_2, ..., A_N, written on the blackboard. You will choose one of them and replace it with an integer of your choice between 1 and 10^9 (inclusive), possibly the same as the integer originally written. Find the maximum possible greatest common divisor of the N integers on the blackboard afte...
['import copy\nimport fractions\nfrom functools import reduce\nn = int(input())\na = list(map(int, input().split()))\nmax_gcd = 1\nfor i in range(0, n-1):\n _a = copy.copy(a)\n _a.pop(i)\n _gcd = reduce(fractions.gcd, _a)\n if _gcd > max_gcd:\n max_gcd = _gcd\nprint(max_gcd)', 'import fractions\n\ndef get_m(_a, ...
['Wrong Answer', 'Wrong Answer', 'Accepted']
['s092551333', 's168844505', 's016061267']
[16120.0, 16052.0, 14076.0]
[2104.0, 2104.0, 240.0]
[268, 428, 316]
p03061
u076512055
2,000
1,048,576
There are N integers, A_1, A_2, ..., A_N, written on the blackboard. You will choose one of them and replace it with an integer of your choice between 1 and 10^9 (inclusive), possibly the same as the integer originally written. Find the maximum possible greatest common divisor of the N integers on the blackboard afte...
['def gcd(a,b):\n if b == 0:\n return a\n elif a%b == 0:\n return b\n else:\n return gcd(b,a%b)\n\nN = int(input())\nA = list(map(int, input().split()))\n\nL = [0]*N\nR = [0]*N\n\nL[0] = A[0]\nR[N-1] = A[N-1]\n\nfor n in range(1,N):\n L[n] = gcd(L[n-1],A[n])\n R[N-1-n] =gcd(R[N-n],A[...
['Runtime Error', 'Accepted']
['s385223920', 's912411030']
[14428.0, 14080.0]
[179.0, 221.0]
[378, 331]
p03061
u077291787
2,000
1,048,576
There are N integers, A_1, A_2, ..., A_N, written on the blackboard. You will choose one of them and replace it with an integer of your choice between 1 and 10^9 (inclusive), possibly the same as the integer originally written. Find the maximum possible greatest common divisor of the N integers on the blackboard afte...
['# ABC125C - GCD on Blackboard\n\nfrom fractions import gcd\n\ndef main():\n n = int(input())\n a = tuple(map(int, input().rstrip().split()))\n\n left = [0] * (n + 1)\n right = [0] * (n + 1)\n for i in range(n):\n print(i)\n left[i + 1] = gcd(left[i], a[i])\n right[n - i - 1] = gcd(...
['Wrong Answer', 'Accepted']
['s506205206', 's013225250']
[114656.0, 21928.0]
[2104.0, 919.0]
[552, 5924]
p03061
u081688405
2,000
1,048,576
There are N integers, A_1, A_2, ..., A_N, written on the blackboard. You will choose one of them and replace it with an integer of your choice between 1 and 10^9 (inclusive), possibly the same as the integer originally written. Find the maximum possible greatest common divisor of the N integers on the blackboard afte...
['import fractions\n\nn = int(input())\nAs = list(map(int, input().split(" ")))\nmaxa = max(As)\nlargest = 1\n\nfor i in range(n):\n gcd = 0\n for idx, j in enumerate(As):\n if idx == i:\n continue\n gcd = j if gcd==0 else fractions.gcd(gcd, j)\n if gcd <= largest:\n break\n if gcd > largest:\n ...
['Time Limit Exceeded', 'Time Limit Exceeded', 'Time Limit Exceeded', 'Wrong Answer', 'Time Limit Exceeded', 'Time Limit Exceeded', 'Wrong Answer', 'Accepted']
['s004796714', 's337366982', 's418798162', 's507838160', 's692371865', 's732507835', 's793874672', 's511021627']
[16056.0, 16080.0, 16156.0, 16056.0, 16068.0, 16700.0, 16120.0, 14488.0]
[2104.0, 2104.0, 2104.0, 2105.0, 2104.0, 2104.0, 2104.0, 423.0]
[369, 370, 383, 378, 350, 320, 411, 381]
p03061
u087917227
2,000
1,048,576
There are N integers, A_1, A_2, ..., A_N, written on the blackboard. You will choose one of them and replace it with an integer of your choice between 1 and 10^9 (inclusive), possibly the same as the integer originally written. Find the maximum possible greatest common divisor of the N integers on the blackboard afte...
['N = int(input())\nA = list(map(int,input().split()))\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\nX = [0]*N\nY = [0]*N\n\nfor i in range(1,N):\n X[i]=gcd(X[i-1],A[i-1])\nfor i in range(N-1)[::-1]:\n Y[i]=gcd(Y[i+1],A[i+1])\n\nZ =...
['Runtime Error', 'Accepted']
['s427541232', 's431907262']
[14584.0, 14432.0]
[156.0, 209.0]
[362, 362]
p03061
u089142196
2,000
1,048,576
There are N integers, A_1, A_2, ..., A_N, written on the blackboard. You will choose one of them and replace it with an integer of your choice between 1 and 10^9 (inclusive), possibly the same as the integer originally written. Find the maximum possible greatest common divisor of the N integers on the blackboard afte...
['def main():\n N=int(input())\n A=list(map(int, input().split()))\n \n for GCD in reversed(range(1,10**9)):\n error=0\n for i in range(0,N):\n if i%GCD==0:\n pass\n else:\n error+=1\n if error>=2:\n break\n if error<=1:\n break\n\n print(GCD)\n \nmain()', '...
['Wrong Answer', 'Accepted']
['s081863528', 's294494342']
[14080.0, 22548.0]
[2104.0, 136.0]
[296, 397]
p03061
u091051505
2,000
1,048,576
There are N integers, A_1, A_2, ..., A_N, written on the blackboard. You will choose one of them and replace it with an integer of your choice between 1 and 10^9 (inclusive), possibly the same as the integer originally written. Find the maximum possible greatest common divisor of the N integers on the blackboard afte...
['n = int(input())\na = [int(i) for i in input().split()]\nl_list = [0]\nr_list = [0]\nfor i in range(n):\n l = gcd(l_list[i], a[i])\n l_list.append(l)\n r = gcd(r_list[-1], a[-i-1])\n r_list.append(r)\nr_list = list(reversed(r_list))\nr_list = r_list[1:]\nl_list = l_list[:n]\nc_list = []\nfor i in range(n)...
['Runtime Error', 'Runtime Error', 'Accepted']
['s817882773', 's865435126', 's588769520']
[14060.0, 14648.0, 14436.0]
[49.0, 2104.0, 312.0]
[370, 335, 526]
p03061
u097121858
2,000
1,048,576
There are N integers, A_1, A_2, ..., A_N, written on the blackboard. You will choose one of them and replace it with an integer of your choice between 1 and 10^9 (inclusive), possibly the same as the integer originally written. Find the maximum possible greatest common divisor of the N integers on the blackboard afte...
['def gcd_seq(seq):\n from fractions import gcd\n size = len(seq)\n if size == 1:\n return seq[0]\n if size == 2:\n return gcd(seq[0], seq[1])\n ans = gcd(seq[0], seq[1])\n for i in range(2, size):\n ans = gcd(seq[i], ans)\n return ans\n\n\nN = int(input())\nA = [int(i) for i i...
['Time Limit Exceeded', 'Accepted']
['s093688553', 's000221178']
[14060.0, 14428.0]
[2105.0, 278.0]
[444, 547]
p03061
u098012509
2,000
1,048,576
There are N integers, A_1, A_2, ..., A_N, written on the blackboard. You will choose one of them and replace it with an integer of your choice between 1 and 10^9 (inclusive), possibly the same as the integer originally written. Find the maximum possible greatest common divisor of the N integers on the blackboard afte...
["import sys\nimport fractions\ninput = sys.stdin.readline\nimport heapq\n\n\ndef main():\n N = int(input())\n A = [int(x) for x in input().split()]\n\n A_sorted = sorted(A)\n\n if len(A) == 2:\n print(max(A))\n exit()\n\n h = []\n heapq.heappush(h, fractions.gcd(A_sorted[0], A_sorted[-1...
['Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Runtime Error', 'Runtime Error', 'Wrong Answer', 'Wrong Answer', 'Accepted']
['s083557512', 's158236378', 's193706171', 's210683395', 's420660610', 's582710693', 's647680841', 's694539718', 's711087185', 's914120810', 's466941412']
[16068.0, 16136.0, 16132.0, 16132.0, 16108.0, 16124.0, 16144.0, 16144.0, 16124.0, 16136.0, 16132.0]
[200.0, 164.0, 193.0, 194.0, 196.0, 189.0, 67.0, 66.0, 195.0, 150.0, 1467.0]
[602, 603, 831, 831, 1018, 545, 819, 799, 689, 794, 1062]
p03061
u101742684
2,000
1,048,576
There are N integers, A_1, A_2, ..., A_N, written on the blackboard. You will choose one of them and replace it with an integer of your choice between 1 and 10^9 (inclusive), possibly the same as the integer originally written. Find the maximum possible greatest common divisor of the N integers on the blackboard afte...
['def gcd(a, b):\n\twhile b:\n\t\ta, b = b, a % b\n\treturn a\n \n\n\nN = int(input())\nA = input().split()\nfor i in range(N):\n A[i] = int(A[i])\n \nif N == 2:\n print(max(A[0],A[1]))\nif N >= 3:\n gcd_all = gcd(A[0], A[1])\n gcd_without_1 = A[0]\n gcd_without_2 = A[1]\n gcd_without_1 = max(gcd_...
['Runtime Error', 'Accepted']
['s384236527', 's658764800']
[11508.0, 11508.0]
[58.0, 137.0]
[561, 556]
p03061
u111365362
2,000
1,048,576
There are N integers, A_1, A_2, ..., A_N, written on the blackboard. You will choose one of them and replace it with an integer of your choice between 1 and 10^9 (inclusive), possibly the same as the integer originally written. Find the maximum possible greatest common divisor of the N integers on the blackboard afte...
['import fractions\nN = int(input())\nA = list(map(int,input().split()))\nhard = A[0]*A[1]\neasy = A[0]\ndel A[0]\nwhile len(A) != 0:\n easyt = fractions.gcd(hard,A[0])\n if easyt < easy:\n easy = easyt\n hard = fractions.gcd(hard,A[0])\n del A[0]\nprint(easy)', 'import fractions\nN = int(input())\nA = list(map(...
['Wrong Answer', 'Runtime Error', 'Accepted']
['s460269352', 's943923134', 's828060045']
[16068.0, 16104.0, 14080.0]
[1620.0, 1711.0, 270.0]
[253, 353, 652]
p03061
u116233709
2,000
1,048,576
There are N integers, A_1, A_2, ..., A_N, written on the blackboard. You will choose one of them and replace it with an integer of your choice between 1 and 10^9 (inclusive), possibly the same as the integer originally written. Find the maximum possible greatest common divisor of the N integers on the blackboard afte...
['n=int(input())\na=list(map(int,input().split()))\n\nl=[]\nl.append(0)\nl.append(0)\nr=[]\nr.append(a[n-1])\nr.append(a[n-1])\ng=[]\n\ndef gcd(x,y):\n if x%y==0:\n return y\n else:\n return gcd(y,x%y)\n\n\nfor i in range(1,n):\n l.append(gcd(l[i],a[i-1]))\n r.append(gcd(r[i],a[n-1-i]))\n \nr[0]=0\n\nfor j i...
['Runtime Error', 'Runtime Error', 'Runtime Error', 'Runtime Error', 'Runtime Error', 'Runtime Error', 'Accepted']
['s049502719', 's054784031', 's064545853', 's573948541', 's588178948', 's939040881', 's126570531']
[14400.0, 14436.0, 46180.0, 14440.0, 14524.0, 14052.0, 14436.0]
[209.0, 43.0, 2105.0, 208.0, 44.0, 212.0, 208.0]
[366, 337, 247, 356, 376, 356, 369]
p03061
u118867138
2,000
1,048,576
There are N integers, A_1, A_2, ..., A_N, written on the blackboard. You will choose one of them and replace it with an integer of your choice between 1 and 10^9 (inclusive), possibly the same as the integer originally written. Find the maximum possible greatest common divisor of the N integers on the blackboard afte...
['\nimport numpy as np\nN = int(input())\nAs=input().split()\nA = np.array([int(s) for s in As])\ndel(As)\n\nmin2A = A[A.argsort()[1]]\nminA = np.amin(A)\nif np.sum((A%min2A)==0)>=N-1:\n print(min2A)\nelif np.sum((A%minA)==0)>=N-1:\n print(minA)\nelse:\n \n # if np.sum((A%i)==0)>=N-1:\n # print...
['Wrong Answer', 'Accepted']
['s471934134', 's372516973']
[23916.0, 23884.0]
[260.0, 247.0]
[541, 528]
p03061
u124025116
2,000
1,048,576
There are N integers, A_1, A_2, ..., A_N, written on the blackboard. You will choose one of them and replace it with an integer of your choice between 1 and 10^9 (inclusive), possibly the same as the integer originally written. Find the maximum possible greatest common divisor of the N integers on the blackboard afte...
['import fractions\nfrom functools import reduce\nN = int(input())\nA = list(map(int,input().split()))\nS = []\ndef gcd(*numbers):\n return reduce(fractions.gcd, numbers)\nfor i in range(N):\n B = A.copy()\n del B[i]\n m = gcd(*B)\n S.append(m)\nprint(max(S))', 'def gcd(a, b):\n while b != 0:\n a, b = ...
['Time Limit Exceeded', 'Accepted']
['s421507235', 's347919656']
[16124.0, 14428.0]
[2104.0, 202.0]
[252, 472]
p03061
u124589361
2,000
1,048,576
There are N integers, A_1, A_2, ..., A_N, written on the blackboard. You will choose one of them and replace it with an integer of your choice between 1 and 10^9 (inclusive), possibly the same as the integer originally written. Find the maximum possible greatest common divisor of the N integers on the blackboard afte...
['\nimport sys\n\ndef gcd(a, b): \n while b:\n a, b = b, a % b\n return int(a)\n\ndef gcd3(lis): (3over)\n ans = lis[0]\n for li in lis:\n ans = gcd(ans,li)\n return ans\n \nn = int(input())\na = list(map(int, input().split()))\n\n\nif n==2:\n print(max(a))\n sys.exit(0)\n\n\ntmp_unused = gcd(a[0], a[1]...
['Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Time Limit Exceeded', 'Accepted']
['s427711535', 's540029574', 's540530205', 's567713677', 's611236524', 's689571627', 's973941529', 's974233406']
[14400.0, 14204.0, 14080.0, 14080.0, 14488.0, 14080.0, 14076.0, 14076.0]
[139.0, 138.0, 140.0, 140.0, 45.0, 141.0, 2104.0, 140.0]
[490, 728, 741, 798, 769, 757, 412, 597]
p03061
u131264627
2,000
1,048,576
There are N integers, A_1, A_2, ..., A_N, written on the blackboard. You will choose one of them and replace it with an integer of your choice between 1 and 10^9 (inclusive), possibly the same as the integer originally written. Find the maximum possible greatest common divisor of the N integers on the blackboard afte...
['from fractions import gcd\nn = int(input())\naaa = list(map(int, input().split()))\np = aaa[0]\nf = [p]\nfor a in aaa[1:-1]:\n p = gcd(p, a)\n f.append(p)\naaa.reverse()\np = aaa[0]\nb = [p]\nfor a in a[1:-1]:\n p = gcd(p, a)\n b.append(p)\nf = [b[0]] + f\nb = b + [f[-1]]\nprint(max(gcd(p, q)) for p, q in...
['Runtime Error', 'Runtime Error', 'Accepted']
['s026238817', 's884061927', 's870957156']
[16488.0, 2940.0, 14080.0]
[100.0, 17.0, 227.0]
[313, 515, 542]
p03061
u140697185
2,000
1,048,576
There are N integers, A_1, A_2, ..., A_N, written on the blackboard. You will choose one of them and replace it with an integer of your choice between 1 and 10^9 (inclusive), possibly the same as the integer originally written. Find the maximum possible greatest common divisor of the N integers on the blackboard afte...
['import fractions\nfrom functools import reduce\n\ndef gcd_list(numbers):\n return reduce(fractions.gcd, numbers)\n\n\nN = int(input())\na= list(map(int , input().split()))\n\nif N<=2:\n\tprint(max(a))\nelse:\n\tans = gcd_list(a[1:])\n\tfor i in range(1,N):\n\t\ttemp_gcd = gcd_list(a[0:i]+a[i+1:])\n\n\t\tans = max(...
['Runtime Error', 'Accepted']
['s354726153', 's821289718']
[16056.0, 14440.0]
[2104.0, 205.0]
[322, 383]
p03061
u141786930
2,000
1,048,576
There are N integers, A_1, A_2, ..., A_N, written on the blackboard. You will choose one of them and replace it with an integer of your choice between 1 and 10^9 (inclusive), possibly the same as the integer originally written. Find the maximum possible greatest common divisor of the N integers on the blackboard afte...
['# C - GCD on Blackboard\n\nn = int(input())\na = list(int(x) for x in input().split())\na.sort()\n\ndef gcd(x, y):\n if x==0:\n return y\n else:\n return gcd(y%x, x)\n\nif n==2:\n print(max(a))\nelse:\n ans = max(gcd(a[0],a[1]), gcd(a[1],a[2]), gcd(a[2],a[0]))\n print(ans)\n for i in r...
['Wrong Answer', 'Accepted']
['s786875742', 's466925870']
[14584.0, 14432.0]
[118.0, 219.0]
[356, 467]
p03061
u144913062
2,000
1,048,576
There are N integers, A_1, A_2, ..., A_N, written on the blackboard. You will choose one of them and replace it with an integer of your choice between 1 and 10^9 (inclusive), possibly the same as the integer originally written. Find the maximum possible greatest common divisor of the N integers on the blackboard afte...
['#![allow(non_snake_case)]\n\nfn read_line() -> String {\n let mut s = String::new();\n std::io::stdin().read_line(&mut s).unwrap();\n s.trim().to_string()\n}\n\nfn read_vec<T: std::str::FromStr>() -> Vec<T> {\n read_line()\n .split_whitespace()\n .map(|e| e.parse().ok().unwrap())\n .c...
['Runtime Error', 'Accepted']
['s731579130', 's194256298']
[2940.0, 14332.0]
[17.0, 202.0]
[944, 482]
p03061
u148540382
2,000
1,048,576
There are N integers, A_1, A_2, ..., A_N, written on the blackboard. You will choose one of them and replace it with an integer of your choice between 1 and 10^9 (inclusive), possibly the same as the integer originally written. Find the maximum possible greatest common divisor of the N integers on the blackboard afte...
['from functools import reduce\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 a * b // gcd(a, b)\n\n\nn = int(input())\na = list(map(int, input().split()))\n\nl = [0 for i in range(n)]\nfor i in range(0, n - 1, 1):\n l[i + 1] = gcd(l[i], a[i])\n pri...
['Runtime Error', 'Wrong Answer', 'Accepted']
['s439697221', 's647518516', 's710161264']
[14652.0, 14652.0, 14576.0]
[118.0, 225.0, 224.0]
[485, 448, 449]
p03061
u149752754
2,000
1,048,576
There are N integers, A_1, A_2, ..., A_N, written on the blackboard. You will choose one of them and replace it with an integer of your choice between 1 and 10^9 (inclusive), possibly the same as the integer originally written. Find the maximum possible greatest common divisor of the N integers on the blackboard afte...
['import copy \n\ndef gcd(a,b):\n if b > a:\n a, b = b, a\n while b:\n a, b = b, a%b\n return a\n\nN = int(input())\nT = list(map(int,input().split()))\nT.sort()\nLIS = [0]*N\nLIS[0] += T[0]\nfor i in range(N-1):\n LIS[i+1] += gcd(LIS[i],T[i+1])\nGCD = 0\nGCD += LIS[N-1]\nif N == 2:\n ANS =...
['Runtime Error', 'Runtime Error', 'Time Limit Exceeded', 'Accepted']
['s124382922', 's126191852', 's202610451', 's212589531']
[20512.0, 14076.0, 16164.0, 18036.0]
[501.0, 199.0, 2104.0, 438.0]
[919, 345, 287, 1001]
p03061
u159994501
2,000
1,048,576
There are N integers, A_1, A_2, ..., A_N, written on the blackboard. You will choose one of them and replace it with an integer of your choice between 1 and 10^9 (inclusive), possibly the same as the integer originally written. Find the maximum possible greatest common divisor of the N integers on the blackboard afte...
['def gcd(a, b): # a>b\n a, b = max(a, b), min(a, b)\n if b == 0:\n return a\n else:\n return gcd(b, a % b)\n\n\nN = int(input())\nA = list(map(int, input().split()))\nR = [0 for i in range(N - 1)]\nL = [0 for i in range(N - 1)]\nR[0] = A[0]\nL[0] = A[-1]\nfor i in range(1, N - 1):\n R[i] = g...
['Wrong Answer', 'Accepted']
['s951598624', 's643104780']
[14400.0, 14584.0]
[566.0, 420.0]
[529, 531]
p03061
u164149485
2,000
1,048,576
There are N integers, A_1, A_2, ..., A_N, written on the blackboard. You will choose one of them and replace it with an integer of your choice between 1 and 10^9 (inclusive), possibly the same as the integer originally written. Find the maximum possible greatest common divisor of the N integers on the blackboard afte...
['def gcd(a,b):\n if ( b==0 ):\n return a\n else:\n return (gcd(b, a%b))\n\nkosuu = int(input())\nnums = list(map(int,input().split()))\n\nL = []\nR = []\nfor temp in range(kosuu-1):\n if temp == 0:\n L.append(nums[0])\n else:\n L.append(gcd(L[temp-1],nums[temp]))\n\nfor temp in ...
['Wrong Answer', 'Accepted']
['s523025624', 's402030337']
[14644.0, 14488.0]
[273.0, 259.0]
[646, 635]
p03061
u168578024
2,000
1,048,576
There are N integers, A_1, A_2, ..., A_N, written on the blackboard. You will choose one of them and replace it with an integer of your choice between 1 and 10^9 (inclusive), possibly the same as the integer originally written. Find the maximum possible greatest common divisor of the N integers on the blackboard afte...
["import copy\nclass SegmentTree():\n __slots__ = ['sz','func','I','seg']\n def __init__(self, N, func, I):\n self.sz = N\n self.func = copy.deepcopy(func)\n self.I = I\n self.seg = [I for i in range(self.sz * 2)]\n \n def assign(self, k, x):\n self.seg[k + self.sz] = x\n \n ...
['Time Limit Exceeded', 'Time Limit Exceeded', 'Accepted']
['s041785430', 's649557454', 's905127459']
[17428.0, 14996.0, 13924.0]
[2072.0, 2104.0, 1717.0]
[1441, 1231, 1387]
p03061
u172035535
2,000
1,048,576
There are N integers, A_1, A_2, ..., A_N, written on the blackboard. You will choose one of them and replace it with an integer of your choice between 1 and 10^9 (inclusive), possibly the same as the integer originally written. Find the maximum possible greatest common divisor of the N integers on the blackboard afte...
['import sys\ninput = sys.stdin.readline\nN = int(input())\nA = list(map(int,input().split()))\n\ndef gcd(a,b):\n if b == 0:\n return a \n return gcd(b,a%b)\n\nres = 0\nfor i in range(N):\n for j in range(N):\n if i == j:\n continue\n if j-1 == i:\n B = [A[j],A[j-2...
['Wrong Answer', 'Accepted']
['s363809362', 's809730534']
[14072.0, 14052.0]
[2104.0, 251.0]
[418, 516]
p03061
u174394352
2,000
1,048,576
There are N integers, A_1, A_2, ..., A_N, written on the blackboard. You will choose one of them and replace it with an integer of your choice between 1 and 10^9 (inclusive), possibly the same as the integer originally written. Find the maximum possible greatest common divisor of the N integers on the blackboard afte...
['def gcd(a,b):\n if a>b:\n a,b = b,a\n if a==1:\n return a\n else:\n return gcd(b%a,a)\n\nN = int(input())\nA = map(int,input().split())\n\nans = A[1]\ng = A[0]\n\nfor i in range(N):\n g = gcd(g,A[i])\n ans = max(ans,g)\nprint(ans)', 'def gcd(a,b):\n if a>b:\n a,b = b,a\n if b%a == 0:\n return a\...
['Runtime Error', 'Accepted']
['s648734913', 's366344070']
[11124.0, 27564.0]
[27.0, 214.0]
[227, 441]
p03061
u177411511
2,000
1,048,576
There are N integers, A_1, A_2, ..., A_N, written on the blackboard. You will choose one of them and replace it with an integer of your choice between 1 and 10^9 (inclusive), possibly the same as the integer originally written. Find the maximum possible greatest common divisor of the N integers on the blackboard afte...
['import sys\nimport fractions\n\nstdin = sys.stdin\n\nni = lambda: int(ns())\nna = lambda: list(map(int, stdin.readline().split()))\nns = lambda: stdin.readline().rstrip()\n\nkouho = []\nn = ni()\nli = na()\nflag = 0\nif len(li) == 2:\n print(max(li[0], li[1]))\nelse:\n kouho.append(fractions.gcd(li[0], li[1]))\...
['Runtime Error', 'Wrong Answer', 'Runtime Error', 'Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Runtime Error', 'Wrong Answer', 'Accepted']
['s176542855', 's250799749', 's274996761', 's309819378', 's483418926', 's521454557', 's763395100', 's908565946', 's317586752']
[16132.0, 16096.0, 16164.0, 16128.0, 16132.0, 16136.0, 16132.0, 16140.0, 49084.0]
[122.0, 1248.0, 1391.0, 115.0, 91.0, 90.0, 120.0, 81.0, 300.0]
[607, 1021, 1026, 631, 731, 1134, 610, 773, 930]
p03061
u178963077
2,000
1,048,576
There are N integers, A_1, A_2, ..., A_N, written on the blackboard. You will choose one of them and replace it with an integer of your choice between 1 and 10^9 (inclusive), possibly the same as the integer originally written. Find the maximum possible greatest common divisor of the N integers on the blackboard afte...
['import functools\nimport copy\n\nN = int(input())\nA = list(map(int, input().split()))\n\ndef gcd(a, b):\n while b != 0:\n a, b = b, a % b\n return a\n\ndef gcd_l(l):\n return functools.reduce(lambda x, y: gcd(x, y), l)\n\n\nl = [0] * N \nfor i in range(N):\n if i == 0:\n continue\n else...
['Runtime Error', 'Runtime Error', 'Wrong Answer', 'Accepted']
['s139349737', 's209863876', 's375107100', 's332701356']
[15212.0, 15208.0, 15080.0, 15080.0]
[50.0, 2104.0, 2104.0, 207.0]
[584, 486, 495, 507]
p03061
u181367828
2,000
1,048,576
There are N integers, A_1, A_2, ..., A_N, written on the blackboard. You will choose one of them and replace it with an integer of your choice between 1 and 10^9 (inclusive), possibly the same as the integer originally written. Find the maximum possible greatest common divisor of the N integers on the blackboard afte...
["n = int(input())\na = [int(x) for x in input().split()]\n\ndef gcd(x, y):\n #print('gcd({0},{1})'.format(x,y))\n if (y==0):\n return x\n else:\n return gcd(y, x%y)\n\ndef gcd_left(i):\n #print('gcd_left({0})'.format(i))\n\n if i<=-1:\n return 0\n else:\n if l[i]:\n ...
['Wrong Answer', 'Accepted']
['s744769225', 's067129884']
[14920.0, 14408.0]
[603.0, 256.0]
[1523, 1529]
p03061
u189326411
2,000
1,048,576
There are N integers, A_1, A_2, ..., A_N, written on the blackboard. You will choose one of them and replace it with an integer of your choice between 1 and 10^9 (inclusive), possibly the same as the integer originally written. Find the maximum possible greatest common divisor of the N integers on the blackboard afte...
['import functools\nimport fractions\nimport copy\n\nn = int(input())\na = list(map(int, input().split()))\ncleana = copy.deepcopy(a)\n\ndef GCD(values):\n g = functools.reduce(fractions.gcd, values)\n return g\n\nans = 0\nfor i in range(n):\n a.remove(cleana[i])\n ans = max(ans, GCD(a))\n # print("a:",a...
['Time Limit Exceeded', 'Accepted']
['s985207030', 's435438880']
[16168.0, 16132.0]
[2104.0, 233.0]
[373, 467]
p03061
u194894739
2,000
1,048,576
There are N integers, A_1, A_2, ..., A_N, written on the blackboard. You will choose one of them and replace it with an integer of your choice between 1 and 10^9 (inclusive), possibly the same as the integer originally written. Find the maximum possible greatest common divisor of the N integers on the blackboard afte...
['N = int(input())\nA = list(map(int, input().split()))\n\ndef gcd(a, b):\n a, b = max(a, b), min(a, b)\n if b == 0:\n return a\n if a % b == 0:\n return b\n return gcd(b, a%b)\n\nL = [0]; R = [0]\nfor i in range(N-1):\n L.append(gcd(L[i], A[i]))\n R.append(gcd(R[i], A[N-1-i]))\n\nmaxGCD...
['Wrong Answer', 'Accepted']
['s951188082', 's299778717']
[14428.0, 14400.0]
[278.0, 285.0]
[386, 386]
p03061
u197300773
2,000
1,048,576
There are N integers, A_1, A_2, ..., A_N, written on the blackboard. You will choose one of them and replace it with an integer of your choice between 1 and 10^9 (inclusive), possibly the same as the integer originally written. Find the maximum possible greatest common divisor of the N integers on the blackboard afte...
['print(1)', 'def gcd(a,b):\n if b>a:\n a,b=b,a\n while b:\n a,b=b, a%b\n return a\n\n\ndef cul(n,x):\n l=len(x)\n b=[x[i] for i in range(l)]\n b.pop(n)\n tmp=b[0]\n for i in range(1,l-1):\n tmp=gcd(tmp,b[i])\n return tmp\n\nimport sys\nimport math\np=10\nN=int(input())\n...
['Wrong Answer', 'Accepted']
['s731548493', 's554328596']
[2940.0, 14588.0]
[17.0, 1968.0]
[8, 1073]
p03061
u197495461
2,000
1,048,576
There are N integers, A_1, A_2, ..., A_N, written on the blackboard. You will choose one of them and replace it with an integer of your choice between 1 and 10^9 (inclusive), possibly the same as the integer originally written. Find the maximum possible greatest common divisor of the N integers on the blackboard afte...
['N = int(input())\nnums = [int(i) for i in input().split()]\nnums = list((set(nums)))\ndef compute_divs(n):\n divs = []\n for i in range(2,int(n**0.5)+1):\n if n % i == 0:\n divs.append(i)\n if i != n // i:\n divs.append(n//i)\n divs.append(n)\n return divs\n\nif...
['Runtime Error', 'Time Limit Exceeded', 'Time Limit Exceeded', 'Runtime Error', 'Accepted']
['s122740901', 's275418355', 's616886952', 's698614692', 's590222028']
[14428.0, 14060.0, 14052.0, 14064.0, 14052.0]
[52.0, 2108.0, 2104.0, 46.0, 63.0]
[721, 310, 332, 331, 770]
p03061
u200346982
2,000
1,048,576
There are N integers, A_1, A_2, ..., A_N, written on the blackboard. You will choose one of them and replace it with an integer of your choice between 1 and 10^9 (inclusive), possibly the same as the integer originally written. Find the maximum possible greatest common divisor of the N integers on the blackboard afte...
['import fractions\n\ndef list_gcd(l):\n if len(l) == 0:\n return 0\n elif len(l) == 1:\n return l[0]\n elif len(l) == 2:\n return fractions.gcd(l[0], l[1])\n else:\n m = l[1:]\n return fractions.gcd(l[0],list_gcd(m))\n\nN = int(input())\nA = list(map(int, input().split()))\n\nif N ...
['Runtime Error', 'Wrong Answer', 'Accepted']
['s127742768', 's323180310', 's347776099']
[788524.0, 14584.0, 14400.0]
[1964.0, 2104.0, 199.0]
[499, 358, 398]
p03061
u219417113
2,000
1,048,576
There are N integers, A_1, A_2, ..., A_N, written on the blackboard. You will choose one of them and replace it with an integer of your choice between 1 and 10^9 (inclusive), possibly the same as the integer originally written. Find the maximum possible greatest common divisor of the N integers on the blackboard afte...
['import math\nfrom functools import reduce\nimport fraction\n\nresult = 0\n\nn = int(input())\nA = list(map(int, input().split()))\nfor i in range(n):\n result = max(result, reduce(fraction.gcd, A[:i]+A[i+1:]))\n\nprint(result)', 'from functools import reduce\n\nresult = 0\n\ndef gcd(a,b):\n if b==0:return a\n ...
['Runtime Error', 'Runtime Error', 'Accepted']
['s067055073', 's523358401', 's737955757']
[3568.0, 3064.0, 14704.0]
[23.0, 17.0, 217.0]
[218, 360, 362]
p03061
u219503971
2,000
1,048,576
There are N integers, A_1, A_2, ..., A_N, written on the blackboard. You will choose one of them and replace it with an integer of your choice between 1 and 10^9 (inclusive), possibly the same as the integer originally written. Find the maximum possible greatest common divisor of the N integers on the blackboard afte...
['\ndef gcd(a, b):\n if b == 0:\n return a\n return gcd(b, a%b)\nn = int(input())\nA = input().split()\nB = sorted(list(set([int(a) for a in A])))\nprint(B)\nans = 0\nif len(B) <= 2:\n ans = max(B)\nelse:\n # B = list(set(m[:]))\n # B = sorted(B)\n \n B = B[:3]\n gcm = gcd(B[0], B[1])\n if gcm...
['Wrong Answer', 'Accepted']
['s017775147', 's430961639']
[14052.0, 14056.0]
[50.0, 168.0]
[482, 394]
p03061
u227082700
2,000
1,048,576
There are N integers, A_1, A_2, ..., A_N, written on the blackboard. You will choose one of them and replace it with an integer of your choice between 1 and 10^9 (inclusive), possibly the same as the integer originally written. Find the maximum possible greatest common divisor of the N integers on the blackboard afte...
['def gcd(a,b):\n while b:a,b=b,a%b\n return a\nn,a,b=int(input()),list(map(int,input().split())),[]\n#no,mi=a[0],a[0]\nfor i in range(1,n):\n b.append(gcd(a[i-1],a[i]))\nb.sort()\nif n==2:print(gcd(a[0],a[1]))\nelif n==3:print(min(gcd(a[0],a[2]),b[1]))\nelse:print(b[2])', 'def gcd(a,b):\n while b:a,b=b,a%b\n retu...
['Wrong Answer', 'Accepted']
['s605791284', 's821355799']
[14080.0, 14584.0]
[135.0, 78.0]
[262, 311]
p03061
u231848612
2,000
1,048,576
There are N integers, A_1, A_2, ..., A_N, written on the blackboard. You will choose one of them and replace it with an integer of your choice between 1 and 10^9 (inclusive), possibly the same as the integer originally written. Find the maximum possible greatest common divisor of the N integers on the blackboard afte...
['def GCD(a, b):\n """ Euclidean algorithm"""\n if a < b: (a, b) = (b, a)\n print(a, b)\n if b == 0: return a\n m = a % b\n while m != 0:\n a = b\n b = m\n m = a % b\n return b\n\nN = int(input())\nA = [ int(v) for v in input().split() ]\n\nif N < 2 and 1e5 < N: raise()\nfor v ...
['Wrong Answer', 'Runtime Error', 'Wrong Answer', 'Wrong Answer', 'Accepted']
['s120219924', 's328628377', 's514624538', 's937120908', 's517541466']
[39744.0, 2940.0, 14432.0, 14180.0, 14428.0]
[2104.0, 17.0, 2104.0, 2104.0, 185.0]
[543, 528, 538, 536, 628]
p03061
u236193715
2,000
1,048,576
There are N integers, A_1, A_2, ..., A_N, written on the blackboard. You will choose one of them and replace it with an integer of your choice between 1 and 10^9 (inclusive), possibly the same as the integer originally written. Find the maximum possible greatest common divisor of the N integers on the blackboard afte...
['for i in range(sorted(A)[1],1,-1):\n\tif(np.sum(A%i==0)>=N-1):\n\t\tprint(i)\n\t\texit()\nprint(1)\n\n', '#import numpy as np\n\nN=int(input())\nA=[int(c) for c in input().split()]\n\n#A=np.array(A)\n\n\n\n\n\n\n\nfor i in range(sorted(A)[1],1,-1):\n#\tif(np.sum(A%i==0)>=N-1):\n\t\n\t#check\n\tb=0\n\tj=0\n\twhile(b<2...
['Runtime Error', 'Accepted']
['s513074433', 's138378910']
[2940.0, 14052.0]
[17.0, 467.0]
[91, 284]
p03061
u249372595
2,000
1,048,576
There are N integers, A_1, A_2, ..., A_N, written on the blackboard. You will choose one of them and replace it with an integer of your choice between 1 and 10^9 (inclusive), possibly the same as the integer originally written. Find the maximum possible greatest common divisor of the N integers on the blackboard afte...
['import fractions\nfrom functools import reduce\nN = int(input())\nA = list(map(int,input().split()))\nresult = [0]*N\ntmp = 0\nfor i in range(N):\n tmp = A.pop(i)\n result[i] = reduce(fractions.gcd, A)\n A.insert(i,tmp)\n\nprint(max(result))', 'import fractions\nfrom functools import reduce\nN = int(input())\nA = ...
['Time Limit Exceeded', 'Time Limit Exceeded', 'Wrong Answer', 'Accepted']
['s280552615', 's415402867', 's621612509', 's850247231']
[16136.0, 16144.0, 23904.0, 20660.0]
[2104.0, 2104.0, 162.0, 148.0]
[233, 336, 373, 340]
p03061
u250664216
2,000
1,048,576
There are N integers, A_1, A_2, ..., A_N, written on the blackboard. You will choose one of them and replace it with an integer of your choice between 1 and 10^9 (inclusive), possibly the same as the integer originally written. Find the maximum possible greatest common divisor of the N integers on the blackboard afte...
['import math\nn = int(input())\na = list(map(int, input().split()))\na.sort()\nmax_gcd = 1\nif len(a) == 2:\n max_gcd = max(a)\nelse:\n gcd1 = math.gcd(a[0], a[1],a[2])\n gcd2 = math.gcd(a[1], a[2],a[3])\n gcd3 = math.gcd(a[2], a[0],a[3])\n gcd4 = math.gcd(a[0],a[1],a[3])\n max_gcd = max(gcd1,gcd2, g...
['Runtime Error', 'Wrong Answer', 'Accepted']
['s157193748', 's612903692', 's785234657']
[14588.0, 14052.0, 14400.0]
[66.0, 347.0, 431.0]
[332, 390, 403]
p03061
u251515715
2,000
1,048,576
There are N integers, A_1, A_2, ..., A_N, written on the blackboard. You will choose one of them and replace it with an integer of your choice between 1 and 10^9 (inclusive), possibly the same as the integer originally written. Find the maximum possible greatest common divisor of the N integers on the blackboard afte...
['import fractions\nfrom functools import reduce\n\ndef gcd_list(numbers):\n return reduce(fractions.gcd, numbers)\n\nn=int(input())\na=list(map(int,input().split()))\n\nans=0\nfor i in range(n):\n ans=max(gcd_list(a[:i]+a[i+1:]),ans)\nprint(ans)', 'import fractions\nimport itertools\nfrom functools import reduce\n...
['Time Limit Exceeded', 'Time Limit Exceeded', 'Accepted']
['s413326198', 's867220970', 's693962768']
[16112.0, 1729296.0, 14076.0]
[2104.0, 2225.0, 369.0]
[236, 281, 208]
p03061
u252828980
2,000
1,048,576
There are N integers, A_1, A_2, ..., A_N, written on the blackboard. You will choose one of them and replace it with an integer of your choice between 1 and 10^9 (inclusive), possibly the same as the integer originally written. Find the maximum possible greatest common divisor of the N integers on the blackboard afte...
['from fractions import gcd\nfrom functools import reduce\nn = int(input())\nL = list(map(int,input().split()))\ndef GCD1(a,b):\n return gcd(a,b)\ndef GCD2(L):\n return reduce(GCD1,L)\n\nliL = [0]*(n)\nliR = [0]*(n)\nfor i in range(1,n+1):\n if len(L[:i-1]) == 0:\n liL[i-1] = 0\n liR[i-1] = (GCD2...
['Time Limit Exceeded', 'Accepted']
['s024711944', 's811260374']
[16156.0, 14524.0]
[2104.0, 199.0]
[607, 307]
p03061
u255943004
2,000
1,048,576
There are N integers, A_1, A_2, ..., A_N, written on the blackboard. You will choose one of them and replace it with an integer of your choice between 1 and 10^9 (inclusive), possibly the same as the integer originally written. Find the maximum possible greatest common divisor of the N integers on the blackboard afte...
['if N==2:\n print(max(A))\nelse:\n gcds = []\n for i in range(len(A)-1):\n if i == 0:\n gcds.append(gcd(A[0],A[1]))\n else:\n gcds.append(gcd(gcds[-1],A[i]))\n gcds = np.asarray(gcds)\n \n index = []\n for idx,n in enumerate(gcds.min() == gcds):\n if n==T...
['Runtime Error', 'Wrong Answer', 'Accepted']
['s242176300', 's957428503', 's236446245']
[3064.0, 15036.0, 14436.0]
[18.0, 178.0, 177.0]
[868, 360, 365]
p03061
u263830634
2,000
1,048,576
There are N integers, A_1, A_2, ..., A_N, written on the blackboard. You will choose one of them and replace it with an integer of your choice between 1 and 10^9 (inclusive), possibly the same as the integer originally written. Find the maximum possible greatest common divisor of the N integers on the blackboard afte...
["N = int(input()) \nlst =list(map(int, input().split()))\ni = 1 \nkari_ans = 0\nans = 1\nA = max(lst)\nwhile i <= A: iを動かす\n# print (i)\n count = 0 \n j = 0 \n while j < N and count < 2: \n# print ('A')\n if lst[j] % i != 0: \n count +=1 を1回増やす\n if count == 2: \n ...
['Wrong Answer', 'Wrong Answer', 'Accepted']
['s189063621', 's349352954', 's996007164']
[14584.0, 14584.0, 14488.0]
[2104.0, 2104.0, 173.0]
[1040, 1040, 1474]
p03061
u265249432
2,000
1,048,576
There are N integers, A_1, A_2, ..., A_N, written on the blackboard. You will choose one of them and replace it with an integer of your choice between 1 and 10^9 (inclusive), possibly the same as the integer originally written. Find the maximum possible greatest common divisor of the N integers on the blackboard afte...
['from functools import reduce\n\ndef gcd(a, b):\n while b > 0:\n a, b = b, a % b\n return a\n\nN = int(input()) # ignore\nAs = list(map(int, input().split()))\ninit_gcd = reduce(gcd, As, 0)\nBs = list(map(lambda x: x // init_gcd, As))\nprint(Bs)\n\nif N == 2:\n print(max(As[0], As[1]))\nelse:\n for ...
['Wrong Answer', 'Accepted']
['s776773483', 's043551966']
[14680.0, 14652.0]
[186.0, 162.0]
[565, 578]
p03061
u271469978
2,000
1,048,576
There are N integers, A_1, A_2, ..., A_N, written on the blackboard. You will choose one of them and replace it with an integer of your choice between 1 and 10^9 (inclusive), possibly the same as the integer originally written. Find the maximum possible greatest common divisor of the N integers on the blackboard afte...
['n = int(input())\nA = list(map(int, input().split()))\nA = sorted(A,reverse=True)\ndef gcd(a, b):\n if b == 0:\n return a\n return gcd(b, a%b)\n\nif len(A) == 2:\n print(gcd(A[0], A[1]))\n exit()\n\nwhile not len(A) == 2:\n x = A.pop()\n y = A.pop()\n a = gcd(x,y)\n A.append(a)\n A =...
['Wrong Answer', 'Wrong Answer', 'Accepted']
['s038034210', 's896698801', 's635375398']
[14524.0, 14584.0, 14584.0]
[2108.0, 223.0, 220.0]
[336, 307, 309]
p03061
u272557899
2,000
1,048,576
There are N integers, A_1, A_2, ..., A_N, written on the blackboard. You will choose one of them and replace it with an integer of your choice between 1 and 10^9 (inclusive), possibly the same as the integer originally written. Find the maximum possible greatest common divisor of the N integers on the blackboard afte...
['import sys\n# import math, string, itertools, fractions, heapq, collections, re, array, bisect, copy, functools, random\n# from collections import deque, defaultdict, Counter; from heapq import heappush, heappop\n# from itertools import permutations, combinations, product, accumulate, groupby\n\n# from operator impor...
['Time Limit Exceeded', 'Accepted']
['s894392611', 's180404103']
[14152.0, 14140.0]
[2104.0, 243.0]
[3272, 1757]
p03061
u272963916
2,000
1,048,576
There are N integers, A_1, A_2, ..., A_N, written on the blackboard. You will choose one of them and replace it with an integer of your choice between 1 and 10^9 (inclusive), possibly the same as the integer originally written. Find the maximum possible greatest common divisor of the N integers on the blackboard afte...
['# -*- coding: utf-8 -*-\n\ndef gcd(a, b):\n if b == 0:\n return a\n else:\n return gcd(b, a%b)\n\nN = int(input())\nA = [int(a) for a in input().split()]\n\n\n\n\n\n\n\n\nL = [0] * N\nR = [0] * N\n\nL[0] = A[0]\nR[-1] = A[-1]\nfor i in range(1, N):\n L[i] = gcd(L[i-1], A[i])\n idx = N-1-i\n ...
['Wrong Answer', 'Accepted']
['s333443053', 's042631153']
[14440.0, 14052.0]
[235.0, 266.0]
[807, 811]
p03061
u278260778
2,000
1,048,576
There are N integers, A_1, A_2, ..., A_N, written on the blackboard. You will choose one of them and replace it with an integer of your choice between 1 and 10^9 (inclusive), possibly the same as the integer originally written. Find the maximum possible greatest common divisor of the N integers on the blackboard afte...
['n = int(input())\nnum_list = list(map(int, input().split()))\nnum_unique = list(set(num_list))\nnum_unique.sort()\nnum_unique.reverse()\nmax_num = 0\nflag = False\nfor i in range(num_unique[-2], 0, -1):\n if i == 1:\n max_num = 1\n break\n elif flag and count < 2:\n break\n else:\n ...
['Runtime Error', 'Runtime Error', 'Runtime Error', 'Runtime Error', 'Runtime Error', 'Accepted']
['s150766516', 's186792521', 's292897536', 's571852182', 's602811906', 's035445155']
[51428.0, 14076.0, 14076.0, 14052.0, 14076.0, 14208.0]
[2104.0, 2104.0, 2104.0, 2104.0, 2104.0, 357.0]
[699, 519, 766, 525, 518, 255]
p03061
u278886389
2,000
1,048,576
There are N integers, A_1, A_2, ..., A_N, written on the blackboard. You will choose one of them and replace it with an integer of your choice between 1 and 10^9 (inclusive), possibly the same as the integer originally written. Find the maximum possible greatest common divisor of the N integers on the blackboard afte...
['N = int(input())\nA = list(map(int,input().split(" ")))\n\ndef gcd(m,n):\n while n != 0:\n a = n\n n = m % n\n m = a\n return m\n\nl = [0]*N\nr = [0]*N\n\nl[0] = A[0]\nr[-1] = A[-1]\n\nfor x in range(1,N):\n y = N - 1 - x\n l[x] = gcd(A[x],l[x-1])\n r[y] = gcd(A[y],r[y+1])\n\nl.ins...
['Runtime Error', 'Accepted']
['s294641115', 's785919431']
[14080.0, 14488.0]
[207.0, 191.0]
[430, 412]
p03061
u279493135
2,000
1,048,576
There are N integers, A_1, A_2, ..., A_N, written on the blackboard. You will choose one of them and replace it with an integer of your choice between 1 and 10^9 (inclusive), possibly the same as the integer originally written. Find the maximum possible greatest common divisor of the N integers on the blackboard afte...
["import sys, re\nfrom collections import deque, defaultdict, Counter\nfrom math import ceil, sqrt, hypot, factorial, pi, sin, cos, radians\nfrom itertools import accumulate, permutations, combinations, product\nfrom operator import itemgetter, mul\nfrom copy import deepcopy\nfrom string import ascii_lowercase, ascii_u...
['Time Limit Exceeded', 'Accepted']
['s648114720', 's141046994']
[16256.0, 15064.0]
[2104.0, 225.0]
[2545, 1032]
p03061
u281610856
2,000
1,048,576
There are N integers, A_1, A_2, ..., A_N, written on the blackboard. You will choose one of them and replace it with an integer of your choice between 1 and 10^9 (inclusive), possibly the same as the integer originally written. Find the maximum possible greatest common divisor of the N integers on the blackboard afte...
['from fractions import gcd\nfrom functools import reduce\n\n\ndef gcd_list(numbers):\n return reduce(fractions.gcd(), numbers)\n\n\nn = int(input())\nnum_list = list(map(int,input().split()))\ngcd = [1 for _ in range(n-1)]\nfor i in range(n-1):\n num = num_list[:i] + num_list[(i + 1):]\n gcd[i] = gcd_list(num...
['Runtime Error', 'Accepted']
['s049335924', 's856885377']
[16100.0, 14436.0]
[212.0, 224.0]
[323, 505]
p03061
u282228874
2,000
1,048,576
There are N integers, A_1, A_2, ..., A_N, written on the blackboard. You will choose one of them and replace it with an integer of your choice between 1 and 10^9 (inclusive), possibly the same as the integer originally written. Find the maximum possible greatest common divisor of the N integers on the blackboard afte...
['from fractions import gcd\nn = int(input())\nA = list(map(int,input().split()))\nX = [0 for i in range(n)]\nY = [0 for i in range(n)]\nfor i in range(1,n):\n X[i] = gcd(X[i-1],A[i-1])\nfor i in range(n-1)[::-1]:\n Y[i] = gcd(Y[i+1],A[i+1])\nprint(X)\nprint(Y)\nZ = [gcd(X[i],Y[i]) for i in range(n)]\nprint(max(Z...
['Wrong Answer', 'Time Limit Exceeded', 'Accepted']
['s916881867', 's981371843', 's982750171']
[16952.0, 16156.0, 14060.0]
[205.0, 2104.0, 1609.0]
[309, 229, 383]
p03061
u307516601
2,000
1,048,576
There are N integers, A_1, A_2, ..., A_N, written on the blackboard. You will choose one of them and replace it with an integer of your choice between 1 and 10^9 (inclusive), possibly the same as the integer originally written. Find the maximum possible greatest common divisor of the N integers on the blackboard afte...
['\n\nimport sys\nsys.setrecursionlimit(10**6)\n\nn = int(input())\nA = list(map(int, input().split()))\n\nfrom math import gcd\n\nL = [0] * (n+1)\nR = [0] * (n+1)\n\nfor i in range(n-1):\n L[i+1] = gcd(L[i], A[i+1])\nfor i in range(n, 1, -1):\n R[i-1] = gcd(R[i], A[i-1])\n\nans = 0\nfor i in range(n):\n ans =...
['Wrong Answer', 'Wrong Answer', 'Accepted']
['s152591095', 's661542960', 's800810545']
[20620.0, 20664.0, 20572.0]
[141.0, 130.0, 124.0]
[358, 344, 344]
p03061
u314050667
2,000
1,048,576
There are N integers, A_1, A_2, ..., A_N, written on the blackboard. You will choose one of them and replace it with an integer of your choice between 1 and 10^9 (inclusive), possibly the same as the integer originally written. Find the maximum possible greatest common divisor of the N integers on the blackboard afte...
['N = int(input())\nA = list(map(int, input().split()))\n\n\ndef check(num):\n\tcnt = 0\n\tcond = True\n\n\tfor i in range(N):\n\t\tif A[i] % num != 0:\n\t\t\tcnt += 1\n\t\tif cnt > 1:\n\t\t\tcond = False\n\t\t\tbreak\n\n\treturn cond\n\ndef BinarySearch(s,l):\n\tif s == l:\n\t\treturn s\n\tif s+1 == l:\n\t\tif check(l...
['Runtime Error', 'Accepted']
['s688071666', 's983369654']
[3064.0, 14588.0]
[17.0, 98.0]
[468, 531]
p03061
u317779196
2,000
1,048,576
There are N integers, A_1, A_2, ..., A_N, written on the blackboard. You will choose one of them and replace it with an integer of your choice between 1 and 10^9 (inclusive), possibly the same as the integer originally written. Find the maximum possible greatest common divisor of the N integers on the blackboard afte...
['#import math\nfrom functools import reduce\n\ndef gcd(a,b):\n if b>a:\n a, b = b, a\n while b:\n a, b = b, a%b\n return a\n\ndef gcds(nums):\n return reduce(gcd, nums)\n\na = int(input())\na = [int(i) for i in input().split()]\n\nans = 0\nfor i in range(len(a)):\n aa = a[:i] + a[(i+1):]\n...
['Runtime Error', 'Time Limit Exceeded', 'Time Limit Exceeded', 'Accepted']
['s169346176', 's538165991', 's725929141', 's583025942']
[14684.0, 16084.0, 16144.0, 14640.0]
[54.0, 2104.0, 2104.0, 211.0]
[353, 273, 272, 409]
p03061
u328858746
2,000
1,048,576
There are N integers, A_1, A_2, ..., A_N, written on the blackboard. You will choose one of them and replace it with an integer of your choice between 1 and 10^9 (inclusive), possibly the same as the integer originally written. Find the maximum possible greatest common divisor of the N integers on the blackboard afte...
['def gcd(x, y):\n if y == 0:\n return x\n else:\n return gcd(y, x % y)\n\ndef gcd_array(A):\n n = len(A)\n s = A[0]\n i = 1\n Down = []\n while(i < n):\n t = gcd(s,A[i])\n if t < s:\n Down.append(i)\n s = t\n i += 1\n return s,Down\n\nif __na...
['Wrong Answer', 'Accepted']
['s669296808', 's714612193']
[14080.0, 14400.0]
[280.0, 325.0]
[613, 614]
p03061
u330690418
2,000
1,048,576
There are N integers, A_1, A_2, ..., A_N, written on the blackboard. You will choose one of them and replace it with an integer of your choice between 1 and 10^9 (inclusive), possibly the same as the integer originally written. Find the maximum possible greatest common divisor of the N integers on the blackboard afte...
['import numpy as np\nN = int(input())\nA = [int(i) for i in input().split()]\nB = sorted(A.copy(), reverse=True)\n\nans = 1\ncounts = [0] * (B[0]+1)\nfor d in range(B[0], B[-1]//2-1, -1):\n for b in B:\n if b % d == 0:\n counts[d] += 1\n if d != b // d:\n counts[b//d] += ...
['Runtime Error', 'Runtime Error', 'Accepted']
['s061052999', 's844466490', 's830551451']
[1762436.0, 1761284.0, 14052.0]
[2114.0, 2114.0, 209.0]
[492, 474, 544]
p03061
u334260611
2,000
1,048,576
There are N integers, A_1, A_2, ..., A_N, written on the blackboard. You will choose one of them and replace it with an integer of your choice between 1 and 10^9 (inclusive), possibly the same as the integer originally written. Find the maximum possible greatest common divisor of the N integers on the blackboard afte...
["N = int(input())\nA = input().split(' ')\n\nfor i in range(N):\n A[i] = int(A[i])\n\nA.sort()\nA.reverse()\n\nflag = 0\nfor term in A:\n\n count = 0\n\n for i in range(N):\n if(A[i] % term != 0):\n count += 1\n if(count == 2):\n break\n\n if(count <= 1):\n flag =...
['Runtime Error', 'Wrong Answer', 'Runtime Error', 'Accepted']
['s013200730', 's099987492', 's504227818', 's716993852']
[3064.0, 14428.0, 11448.0, 14452.0]
[17.0, 125.0, 59.0, 192.0]
[610, 550, 601, 837]
p03061
u344030307
2,000
1,048,576
There are N integers, A_1, A_2, ..., A_N, written on the blackboard. You will choose one of them and replace it with an integer of your choice between 1 and 10^9 (inclusive), possibly the same as the integer originally written. Find the maximum possible greatest common divisor of the N integers on the blackboard afte...
['import math\nfrom intertools import accumulate\n\nn = int(input())\na = list(map(int, input().split()))\n\ng = []\ngcd = []\ngcd_u = np.frompyfunc(gcd, 2, 1)\n\nfor i in range(n):\n r = a[i]\n a.remove(r)\n gcd = accmulate(a, math.gcd)\n g.append(min(gcd))\n a.insert(i, r)\n\nprint(max(g))\n', 'import math\nfrom...
['Runtime Error', 'Wrong Answer', 'Runtime Error', 'Wrong Answer', 'Accepted']
['s276288270', 's347000317', 's549524869', 's557889026', 's831878645']
[9124.0, 24852.0, 25024.0, 27292.0, 25108.0]
[27.0, 96.0, 97.0, 104.0, 94.0]
[279, 368, 319, 417, 407]
p03061
u346395915
2,000
1,048,576
There are N integers, A_1, A_2, ..., A_N, written on the blackboard. You will choose one of them and replace it with an integer of your choice between 1 and 10^9 (inclusive), possibly the same as the integer originally written. Find the maximum possible greatest common divisor of the N integers on the blackboard afte...
['import functools\nimport fractions\nimport copy\n\nN = int(input())\nA_list = list(map(int, input().split()))\nvlaues = []\nvalues_list = []\n\nfor i in range(N):\n values = copy.copy(A_list)\n del values[i]\n gcd = functools.reduce(fractions.gcd, values)\n values_list.append(gcd)\n\nprint(max(values_list...
['Time Limit Exceeded', 'Accepted']
['s059702312', 's957330984']
[16148.0, 14076.0]
[2104.0, 179.0]
[307, 435]
p03061
u346629192
2,000
1,048,576
There are N integers, A_1, A_2, ..., A_N, written on the blackboard. You will choose one of them and replace it with an integer of your choice between 1 and 10^9 (inclusive), possibly the same as the integer originally written. Find the maximum possible greatest common divisor of the N integers on the blackboard afte...
['import fractions\n\nn = int(input())\na = list(map(int,input().split()))\n\ndef l(m): \n if m == 0:\n return 0\n else:\n return fractions.gcd(l(m-1),a[m-1])\ndef r(m): \n if m == 0:\n return 0\n else:\n return fractions.gcd(r(m-1),a[n-m])\nmax([fractions.gcd(l(i),r(n-i-1)) for...
['Runtime Error', 'Time Limit Exceeded', 'Runtime Error', 'Time Limit Exceeded', 'Runtime Error', 'Accepted']
['s098915613', 's256446960', 's663086331', 's692929607', 's884748857', 's680741302']
[16152.0, 16136.0, 14704.0, 16116.0, 16148.0, 14076.0]
[121.0, 2104.0, 49.0, 2104.0, 118.0, 171.0]
[335, 243, 203, 244, 323, 298]
p03061
u347640436
2,000
1,048,576
There are N integers, A_1, A_2, ..., A_N, written on the blackboard. You will choose one of them and replace it with an integer of your choice between 1 and 10^9 (inclusive), possibly the same as the integer originally written. Find the maximum possible greatest common divisor of the N integers on the blackboard afte...
['from fractions import gcd\n\n\nclass SegmentTree():\n _data = []\n _offset = 0\n _size = 0\n\n def __init__(self, size):\n _size = size\n t = 1\n while t <= size:\n t *= 2\n self._offset = t - 1\n self._data = [0] * (t * 2 - 1)\n\n def update_all(self, iter...
['Time Limit Exceeded', 'Runtime Error', 'Runtime Error', 'Time Limit Exceeded', 'Time Limit Exceeded', 'Time Limit Exceeded', 'Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Accepted']
['s002333464', 's086195411', 's170291634', 's354023920', 's486531350', 's704217622', 's882020303', 's939507836', 's946087999', 's193240649']
[16148.0, 16152.0, 16144.0, 16144.0, 22432.0, 16144.0, 16604.0, 20388.0, 16144.0, 20732.0]
[2104.0, 150.0, 2104.0, 2104.0, 2206.0, 2104.0, 1745.0, 992.0, 1838.0, 957.0]
[1955, 1399, 1504, 1261, 1395, 1483, 1405, 1352, 1405, 1652]
p03061
u350578302
2,000
1,048,576
There are N integers, A_1, A_2, ..., A_N, written on the blackboard. You will choose one of them and replace it with an integer of your choice between 1 and 10^9 (inclusive), possibly the same as the integer originally written. Find the maximum possible greatest common divisor of the N integers on the blackboard afte...
['import fractions\nimport functools\nN=int(input())\nA=[int(i) for i in input().split()] \nmax_gcd=functools.reduce(fractions.gcd, A)\nfor i in range(N):\n\ttmp=A.copy()\n\ttmp.pop(i)\n\tgcd=functools.reduce(fractions.gcd, tmp)\n\tif max_gcd<gcd:\n\t\tmax_gcd=gcd\nprint(max_gcd)\n', 'import fractions\nimport functools...
['Time Limit Exceeded', 'Time Limit Exceeded', 'Runtime Error', 'Wrong Answer', 'Time Limit Exceeded', 'Wrong Answer', 'Wrong Answer', 'Runtime Error', 'Wrong Answer', 'Runtime Error', 'Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Accepted']
['s009591834', 's015843689', 's035826213', 's163366492', 's228734627', 's254416862', 's313069838', 's491009667', 's570977956', 's726642870', 's772778632', 's799462872', 's799467473', 's977306291', 's992554169', 's115228049']
[16124.0, 16144.0, 14428.0, 16112.0, 16144.0, 16144.0, 14080.0, 16060.0, 16128.0, 14428.0, 16148.0, 14052.0, 16144.0, 14052.0, 14056.0, 14400.0]
[2104.0, 2104.0, 49.0, 2104.0, 2104.0, 2104.0, 477.0, 85.0, 265.0, 50.0, 2104.0, 312.0, 2104.0, 267.0, 308.0, 261.0]
[262, 280, 561, 666, 275, 304, 1229, 263, 378, 561, 279, 562, 345, 563, 565, 930]
p03061
u354567428
2,000
1,048,576
There are N integers, A_1, A_2, ..., A_N, written on the blackboard. You will choose one of them and replace it with an integer of your choice between 1 and 10^9 (inclusive), possibly the same as the integer originally written. Find the maximum possible greatest common divisor of the N integers on the blackboard afte...
['n = int(input())\nh = list(map(int,input().split()))\ncount = [0]*n\ni = 0\nwhile i < n:\n j = i\n while j < n -1 and h[j] >= h[j+1]:\n count[i] += 1\n j += 1\n i += count[i] + 1\nprint(max(count))\n', 'def gcd(a,b):\n while b != 0:\n a,b=b,a%b\n return a\n\nn=int(input())\na=[0] +...
['Wrong Answer', 'Accepted']
['s790862889', 's804713359']
[14052.0, 14436.0]
[90.0, 173.0]
[211, 364]
p03061
u354915818
2,000
1,048,576
There are N integers, A_1, A_2, ..., A_N, written on the blackboard. You will choose one of them and replace it with an integer of your choice between 1 and 10^9 (inclusive), possibly the same as the integer originally written. Find the maximum possible greatest common divisor of the N integers on the blackboard afte...
['\n\n\nimport math\nfrom fractions import gcd # for Ver.3.4 or lower.\nfrom functools import reduce\ngcd_map = {}\ndef GCD(numbers):\n if len(numbers) == 0 : return 0\n if len(numbers) == 1 : return numbers[0]\n if len(numbers) == 2 : return gcd_sub(numbers[0] , numbers[1])\n else : \n value = GCD(...
['Runtime Error', 'Runtime Error', 'Wrong Answer', 'Time Limit Exceeded', 'Runtime Error', 'Wrong Answer', 'Runtime Error', 'Runtime Error', 'Wrong Answer', 'Time Limit Exceeded', 'Runtime Error', 'Runtime Error', 'Accepted']
['s062171148', 's164131369', 's193246869', 's420194457', 's452809708', 's479147311', 's494953059', 's511867641', 's523007971', 's800499467', 's817375238', 's977579629', 's127041992']
[787844.0, 3064.0, 14648.0, 16152.0, 789876.0, 14680.0, 788636.0, 3064.0, 14652.0, 16076.0, 16148.0, 789864.0, 14652.0]
[1952.0, 18.0, 545.0, 2104.0, 2092.0, 533.0, 1955.0, 17.0, 386.0, 2104.0, 69.0, 1965.0, 375.0]
[1861, 2023, 1810, 1486, 1994, 1874, 2424, 1873, 1814, 1228, 1993, 2023, 1835]
p03061
u354953865
2,000
1,048,576
There are N integers, A_1, A_2, ..., A_N, written on the blackboard. You will choose one of them and replace it with an integer of your choice between 1 and 10^9 (inclusive), possibly the same as the integer originally written. Find the maximum possible greatest common divisor of the N integers on the blackboard afte...
['import math\nfrom itertools import accumulate\n\nn = int(input())\na = list(map(int, input().split()))\n\nfromleft = list(accumulate(a, math.gcd))\nfromright = list(accumulate(a[::-1], math.gcd)).reverse()\n\ngcd = []\n\ngcd.append(fromright[1])\nfor i in range(1, n-1):\n gcd.append(math.gcd(fromleft[i-1], fromrig...
['Runtime Error', 'Wrong Answer', 'Accepted']
['s704543426', 's916829340', 's523045443']
[22032.0, 25068.0, 25164.0]
[63.0, 178.0, 97.0]
[358, 479, 354]
p03061
u360090862
2,000
1,048,576
There are N integers, A_1, A_2, ..., A_N, written on the blackboard. You will choose one of them and replace it with an integer of your choice between 1 and 10^9 (inclusive), possibly the same as the integer originally written. Find the maximum possible greatest common divisor of the N integers on the blackboard afte...
['N=int(input())\nA=[int(i) for i in input().split()]\ndef GCD(x,y):\n\tif x>y:\n\t\ta=x\n\t\tb=y\n\telse:\n\t\ta=y\n\t\tb=x\n\twhile(True):\n\t\tc=a%b\n\t\tif c==0:\n\t\t\treturn b\n\t\telse:\n\t\t\ta,b=b,c\n \n\nif N==2:\n\tprint(max(A))\nelse:\n\tB=[]\n\ta0=A[-1]\n\tfor aa in A[0:-1]:\n\t\tB.append(GCD(aa,a0))\n\tgo...
['Wrong Answer', 'Wrong Answer', 'Accepted']
['s076169016', 's787753761', 's373081265']
[14052.0, 14400.0, 14400.0]
[169.0, 170.0, 172.0]
[424, 422, 422]
p03061
u365364616
2,000
1,048,576
There are N integers, A_1, A_2, ..., A_N, written on the blackboard. You will choose one of them and replace it with an integer of your choice between 1 and 10^9 (inclusive), possibly the same as the integer originally written. Find the maximum possible greatest common divisor of the N integers on the blackboard afte...
['from fractions import gcd\nfrom functools import reduce\n\ndef gcd_list(x):\n return reduce(gcd, x)\n\nn = int(input())\na = list(map(int, input().split()))\ny = []\nfor i in range(n):\n if i == 0:\n x = a[1:]\n elif i == n - 1:\n x = a[:-1]\n else:\n x = a[:i] + a[i + 1:]\n y.appe...
['Time Limit Exceeded', 'Accepted']
['s707839990', 's259085644']
[16112.0, 14436.0]
[2104.0, 86.0]
[332, 598]
p03061
u366959492
2,000
1,048,576
There are N integers, A_1, A_2, ..., A_N, written on the blackboard. You will choose one of them and replace it with an integer of your choice between 1 and 10^9 (inclusive), possibly the same as the integer originally written. Find the maximum possible greatest common divisor of the N integers on the blackboard afte...
['n=int(input())\na=tuple(map(int,input().split()))\n\nimport fraction\nfrom functools import reduce\n\ndef gcd(*numbers):\n return reduce(fraction.gcd, numbers)\n\ndp=[]\nfor i in range(n):\n aa=list(a)\n del aa[i]\n dp.append(gcd(*aa))\n\nprint(max(dp))', 'n=int(input())\na=list(map(int,input().split()))\...
['Runtime Error', 'Wrong Answer', 'Runtime Error', 'Runtime Error', 'Accepted']
['s004078189', 's122147123', 's321592859', 's812104419', 's694095972']
[14204.0, 16620.0, 14180.0, 14180.0, 14400.0]
[43.0, 230.0, 44.0, 42.0, 202.0]
[250, 424, 251, 253, 405]
p03061
u382251756
2,000
1,048,576
There are N integers, A_1, A_2, ..., A_N, written on the blackboard. You will choose one of them and replace it with an integer of your choice between 1 and 10^9 (inclusive), possibly the same as the integer originally written. Find the maximum possible greatest common divisor of the N integers on the blackboard afte...
['N = int(input())\nA = list(map(int, input().split()))\ndef divi(a, b):\n rem = b % a\n if rem == 0:\n return a\n else:\n return divi(rem, a)\nA.sort()\nall_d = A[0]\nmax_d = max(divi(A[0],A[1]), divi(A[0],A[2])) if N > 2 else A[1]\nfor i in range(1,N):\n d = divi(all_d, A[i])\n max_d = di...
['Wrong Answer', 'Runtime Error', 'Accepted']
['s585083992', 's977356591', 's244584105']
[14076.0, 14152.0, 14584.0]
[126.0, 65.0, 128.0]
[387, 248, 415]
p03061
u384261199
2,000
1,048,576
There are N integers, A_1, A_2, ..., A_N, written on the blackboard. You will choose one of them and replace it with an integer of your choice between 1 and 10^9 (inclusive), possibly the same as the integer originally written. Find the maximum possible greatest common divisor of the N integers on the blackboard afte...
['import numpy as np\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 \nN = int(input())\nA_list = list(map(int, input().split()))\n\n# =====\n# initialize L and R\n# =====\nL = np.zeros(N+1)\nR = np.zeros(N+1)\n...
['Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Time Limit Exceeded', 'Wrong Answer', 'Accepted']
['s070671080', 's093014274', 's390961184', 's447642993', 's671552761', 's683230106', 's382252274']
[23136.0, 14584.0, 14060.0, 23120.0, 14080.0, 14400.0, 23148.0]
[1727.0, 2104.0, 2104.0, 1280.0, 2104.0, 2104.0, 1704.0]
[876, 736, 734, 672, 374, 739, 768]
p03061
u393253137
2,000
1,048,576
There are N integers, A_1, A_2, ..., A_N, written on the blackboard. You will choose one of them and replace it with an integer of your choice between 1 and 10^9 (inclusive), possibly the same as the integer originally written. Find the maximum possible greatest common divisor of the N integers on the blackboard afte...
['def gcd(a, b):\n if b == 0:\n return a\n return gcd(b, a%b)\nn = int(input())\nA = list(map(int, input().split()))\ndef left(i):\n if i < 1:\n return 0\n return gcd(left(i-1), A[i-1])\ndef right(i):\n if i+1 > n-1:\n return 0\n \n return gcd(right(i+1), A[i]) \nans = 0\nfor i...
['Runtime Error', 'Wrong Answer', 'Runtime Error', 'Runtime Error', 'Accepted']
['s200830155', 's687059702', 's766756697', 's950229069', 's759601690']
[14080.0, 88460.0, 3064.0, 3064.0, 14080.0]
[104.0, 2109.0, 17.0, 18.0, 211.0]
[402, 492, 433, 396, 274]
p03061
u396824275
2,000
1,048,576
There are N integers, A_1, A_2, ..., A_N, written on the blackboard. You will choose one of them and replace it with an integer of your choice between 1 and 10^9 (inclusive), possibly the same as the integer originally written. Find the maximum possible greatest common divisor of the N integers on the blackboard afte...
['N=int(input())\nA=list(map(int,input().split()))\n\ngcd_list=[A[0]]\nrev_gcd_list=[A[-1]]\n\nfor i in range(1,N):\n gcd_list.append(gcd([gcd_list[-1],A[i]]))\n rev_gcd_list.append(gcd([rev_gcd_list[-1],A[-i-1]]))\nrev_gcd_list=rev_gcd_list[::-1]\n\nans=max(gcd_list[N-2],rev_gcd_list[1])\nfor i in range(1,N-1):\...
['Runtime Error', 'Runtime Error', 'Accepted']
['s072724935', 's856257740', 's194925392']
[14584.0, 14448.0, 14436.0]
[43.0, 44.0, 381.0]
[372, 119, 543]
p03061
u404057606
2,000
1,048,576
There are N integers, A_1, A_2, ..., A_N, written on the blackboard. You will choose one of them and replace it with an integer of your choice between 1 and 10^9 (inclusive), possibly the same as the integer originally written. Find the maximum possible greatest common divisor of the N integers on the blackboard afte...
['def gcd(a,b):\n if b==0:\n return max(a,b)\n else:\n if a%b == 0:\n return(b)\n else:\n return gcd(b,a%b)\nn = int(input())\na = list(map(int,input().split()))\nl=[0 for i in range(n+1)]\nr=[0 for i in range(n+1)]\n\nfor i in range(1,n):\n l[i]=gcd(l[i-1],a[i-1])\n ...
['Runtime Error', 'Accepted']
['s653803549', 's418231768']
[14488.0, 14488.0]
[172.0, 232.0]
[393, 412]
p03061
u405660020
2,000
1,048,576
There are N integers, A_1, A_2, ..., A_N, written on the blackboard. You will choose one of them and replace it with an integer of your choice between 1 and 10^9 (inclusive), possibly the same as the integer originally written. Find the maximum possible greatest common divisor of the N integers on the blackboard afte...
['def gcd(a, b):\n a, b = max(a, b), min(a, b)\n if b == 0:\n return a\n return gcd(b, a % b)\n\n\ndef main():\n n = int(input())\n A = list(map(int, input().split()))\n gcdA = [0]*n\n gcdB = [0]*n\n gcdA[0] = A[0]\n gcdB[0] = A[n-1]\n for i in range(1, n):\n gcdA[i] = gcd(A[...
['Wrong Answer', 'Runtime Error', 'Time Limit Exceeded', 'Runtime Error', 'Accepted']
['s595296957', 's607218526', 's906283815', 's993108505', 's591335193']
[14400.0, 14076.0, 16168.0, 14436.0, 14436.0]
[363.0, 348.0, 2104.0, 343.0, 397.0]
[532, 566, 270, 568, 573]
p03061
u407160848
2,000
1,048,576
There are N integers, A_1, A_2, ..., A_N, written on the blackboard. You will choose one of them and replace it with an integer of your choice between 1 and 10^9 (inclusive), possibly the same as the integer originally written. Find the maximum possible greatest common divisor of the N integers on the blackboard afte...
['from functools import reduce\n\ndef gcd(m, n):\n \n tmp = max(m,n)\n n = min(m,n)\n m = tmp\n \n if n == 0:\n return m\n \n return gcd(n, m % n)\n\ndef gcda(arr, left, right):\n return reduce((lambda a,b:gcd(a,b)), arr[left:right+1], gcd(arr[left], arr[right]))\n\nn = int(input())\nn...
['Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Accepted']
['s549051034', 's623442167', 's794233088', 's248588941']
[15144.0, 14652.0, 15144.0, 14652.0]
[481.0, 468.0, 466.0, 499.0]
[1093, 1048, 1092, 1097]
p03061
u408620326
2,000
1,048,576
There are N integers, A_1, A_2, ..., A_N, written on the blackboard. You will choose one of them and replace it with an integer of your choice between 1 and 10^9 (inclusive), possibly the same as the integer originally written. Find the maximum possible greatest common divisor of the N integers on the blackboard afte...
['import sys,math,copy\nfrom fractions import gcd\ninput = sys.stdin.readline\n\nN=int(input().strip())\nA=[int(x) for x in input().strip().split()]\n\n# if b==0:\n# return a\n \n\n\nANS=[]\nL=[0]\nR=[0]\nfor i in range(len(A)):\n L.append(gcd(A[i],L[i]))\n R=[gcd(A[-1-i],R[0])]+R\n\nfor i in range...
['Time Limit Exceeded', 'Wrong Answer', 'Accepted']
['s239222157', 's282945820', 's917036547']
[16124.0, 16132.0, 14964.0]
[2104.0, 2104.0, 212.0]
[399, 400, 383]
p03061
u411858517
2,000
1,048,576
There are N integers, A_1, A_2, ..., A_N, written on the blackboard. You will choose one of them and replace it with an integer of your choice between 1 and 10^9 (inclusive), possibly the same as the integer originally written. Find the maximum possible greatest common divisor of the N integers on the blackboard afte...
['N = int(input())\nA = list(map(int, input().split()))\n\ndef gcd(a, b):\n while b:\n a, b = b, a % b\n return a\n\ntmp = A[0]\nfor i in range(N):\n tmp = gcd(tmp, A[i])\n \n \nfor i in range(N):\n A[i] //= tmp\n \nv1 = A[0]\nfor i in range(N):\n if i != 0:\n v1 = gcd(v1, A[i])\n ...
['Wrong Answer', 'Wrong Answer', 'Accepted']
['s125291027', 's951044474', 's833761810']
[14052.0, 14440.0, 14080.0]
[158.0, 194.0, 208.0]
[406, 882, 748]
p03061
u422590714
2,000
1,048,576
There are N integers, A_1, A_2, ..., A_N, written on the blackboard. You will choose one of them and replace it with an integer of your choice between 1 and 10^9 (inclusive), possibly the same as the integer originally written. Find the maximum possible greatest common divisor of the N integers on the blackboard afte...
['N = int(input())\nA = [int(i) for i in input().split()]\n\nif len(A) > 1:\n result = sorted(A)[1]\nelse:\n result = min(A)\n\nwhile True:\n counter = 0\n should_continue = False\n for e in A:\n if e % result != 0:\n counter += 1\n if counter > 1:\n should_con...
['Time Limit Exceeded', 'Accepted']
['s250882706', 's628373329']
[14064.0, 14060.0]
[2104.0, 380.0]
[491, 511]
p03061
u422711869
2,000
1,048,576
There are N integers, A_1, A_2, ..., A_N, written on the blackboard. You will choose one of them and replace it with an integer of your choice between 1 and 10^9 (inclusive), possibly the same as the integer originally written. Find the maximum possible greatest common divisor of the N integers on the blackboard afte...
['from sys import stdin\n\ndef gcd(a,b):\n while b!=0:\n a,b=b,a%b\n return a\n\nn = int(stdin.readline().rstrip())\nan = list(map(int, input().split()))\n\nleft = []\nright = []\n\nfor i in range(n):\n if(i==0):\n before = an[i]\n else:\n before = gcd(before, an[i])\n left.append(before)\n\nfor i in rang...
['Runtime Error', 'Accepted']
['s551982304', 's631861720']
[14076.0, 14440.0]
[139.0, 210.0]
[597, 611]
p03061
u422886513
2,000
1,048,576
There are N integers, A_1, A_2, ..., A_N, written on the blackboard. You will choose one of them and replace it with an integer of your choice between 1 and 10^9 (inclusive), possibly the same as the integer originally written. Find the maximum possible greatest common divisor of the N integers on the blackboard afte...
['import fractions\n\nN = int(input())\nA = [int(i) for i in input().split()]\n\ndef gcd(l):\n ans = l[0]\n for i in range(1, N-1):\n ans = fractions.gcd(ans, l[i])\n return ans\n\nmax_res = -1\nfor i in range(N):\n A_removed = A[0:i] + A[i+1:N]\n res = gcd(A_removed)\n if (res>max_res):\n ...
['Time Limit Exceeded', 'Accepted']
['s332265465', 's142712744']
[16156.0, 24060.0]
[2104.0, 417.0]
[335, 747]
p03061
u434872492
2,000
1,048,576
There are N integers, A_1, A_2, ..., A_N, written on the blackboard. You will choose one of them and replace it with an integer of your choice between 1 and 10^9 (inclusive), possibly the same as the integer originally written. Find the maximum possible greatest common divisor of the N integers on the blackboard afte...
['import math\nfrom functools import reduce\nimport copy\nimport fractions\nN = int(input())\nA = list(map(int,input().split()))\n\ndef gcd_list(numbers):\n return reduce(fractions.gcd,numbers)\nans = 0\ncount = 0\nfor i in range(N):\n B = copy.copy(A)\n a = B.pop(i)\n gcd_a = gcd_list(B)\n ans = max(ans...
['Time Limit Exceeded', 'Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Accepted']
['s145678992', 's146657499', 's340876830', 's468095596', 's758330097', 's956777633']
[16148.0, 16136.0, 16112.0, 16148.0, 16144.0, 16148.0]
[2104.0, 148.0, 226.0, 165.0, 137.0, 238.0]
[322, 171, 553, 221, 213, 391]
p03061
u435108403
2,000
1,048,576
There are N integers, A_1, A_2, ..., A_N, written on the blackboard. You will choose one of them and replace it with an integer of your choice between 1 and 10^9 (inclusive), possibly the same as the integer originally written. Find the maximum possible greatest common divisor of the N integers on the blackboard afte...
['def gcd(a, b):\n while b != 0:\n a, b = b, a % b\n return a\n\n\nN = int(input())\nA = list(map(int, input().split()))\nL = [0 for i in range(N)]\nR = [0 for i in range(N)]\nT = [0 for i in range(N)]\n\nfor i in range(N):\n if i == 0:\n L[i] = 0\n else:\n L[i] = gcd(L[i-1], A[i-1])\nf...
['Wrong Answer', 'Wrong Answer', 'Accepted']
['s388028223', 's855050342', 's437105512']
[14488.0, 14432.0, 14056.0]
[202.0, 205.0, 201.0]
[467, 462, 468]
p03061
u436982376
2,000
1,048,576
There are N integers, A_1, A_2, ..., A_N, written on the blackboard. You will choose one of them and replace it with an integer of your choice between 1 and 10^9 (inclusive), possibly the same as the integer originally written. Find the maximum possible greatest common divisor of the N integers on the blackboard afte...
['def gcd(x,y):\n if x<y:\n x,y=y,x\n while x%y!=0:\n x,y=y,x%y\n return(y)\n\nn=int(input())\n\nv=[]\nline=input().split()\n\nfor i in range(n):\n v.append(int(line[i]))\n\ngcd_l=[]\ngcd_r=[]\n\nfor i in range(n):\n if i==0:\n gcd_l.append(v[i])\n else:\n gcd_l.append(gcd(...
['Wrong Answer', 'Accepted']
['s655936348', 's087343326']
[21556.0, 16832.0]
[233.0, 226.0]
[671, 721]
p03061
u439176910
2,000
1,048,576
There are N integers, A_1, A_2, ..., A_N, written on the blackboard. You will choose one of them and replace it with an integer of your choice between 1 and 10^9 (inclusive), possibly the same as the integer originally written. Find the maximum possible greatest common divisor of the N integers on the blackboard afte...
['N = int(input()) \ndef gcd(m, n):\n a = max(m,n)\n b = min(m,n)\n if a%b==0:\n return b\n while not a % b == 0:\n a, b = b, a % b\n return b\n\narr = [int(item) for item in input().split()]\na = [arr[0]]\nb = [arr[-1]]\nfor i in range(1, N):\n a.append(gcd(a[i-1], arr[i]))\n b.append(gcd(b[i-1], arr[N-...
['Wrong Answer', 'Accepted']
['s744901188', 's369538875']
[15660.0, 14428.0]
[289.0, 282.0]
[418, 416]
p03061
u465699806
2,000
1,048,576
There are N integers, A_1, A_2, ..., A_N, written on the blackboard. You will choose one of them and replace it with an integer of your choice between 1 and 10^9 (inclusive), possibly the same as the integer originally written. Find the maximum possible greatest common divisor of the N integers on the blackboard afte...
['"""\npython3 main.py < input.txt\n"""\nimport math\nimport itertools as it\nimport heapq\n\nprint("Hello")', '"""\npython3 main.py < input.txt\n"""\nimport math\nimport itertools as it\nimport heapq\n\nN=int(input())\nA=list(map(int, input().split()))\n\nL=[A[0]]\nfor i in range(1, N):\n L.append(3)', '"""\npy...
['Wrong Answer', 'Wrong Answer', 'Runtime Error', 'Runtime Error', 'Runtime Error', 'Runtime Error', 'Runtime Error', 'Wrong Answer', 'Runtime Error', 'Wrong Answer', 'Accepted']
['s219677370', 's234627280', 's346511511', 's375451750', 's455041094', 's535154683', 's548288856', 's853969354', 's874472917', 's953811672', 's194286005']
[3060.0, 14584.0, 24184.0, 3060.0, 14584.0, 24184.0, 14584.0, 14712.0, 14584.0, 3060.0, 14584.0]
[18.0, 52.0, 62.0, 18.0, 44.0, 62.0, 43.0, 45.0, 43.0, 18.0, 224.0]
[99, 185, 685, 97, 197, 714, 205, 134, 385, 135, 438]