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 |
|---|---|---|---|---|---|---|---|---|---|---|
p02641 | u853728588 | 2,000 | 1,048,576 | Given are an integer X and an integer sequence of length N: p_1, \ldots, p_N. Among the integers not contained in the sequence p_1, \ldots, p_N (not necessarily positive), find the integer nearest to X, that is, find the integer whose absolute difference with X is the minimum. If there are multiple such integers, repo... | ['x,n = map(int,input().split())\nP = list(map(int,input().split()))\n\nfor i in range(101):\n xl = x - 1\n xr = x + 1\n if xl not in P:\n print(xl)\n break\n if xr not in P:\n print(xr)\n break\n ', 'x,n = map(int,input().split())\nP = list(map(int,input().split()))\n\nfor i in range(101):\n xl = x -... | ['Wrong Answer', 'Accepted'] | ['s023252613', 's150260836'] | [9168.0, 9000.0] | [28.0, 29.0] | [200, 197] |
p02641 | u854405453 | 2,000 | 1,048,576 | Given are an integer X and an integer sequence of length N: p_1, \ldots, p_N. Among the integers not contained in the sequence p_1, \ldots, p_N (not necessarily positive), find the integer nearest to X, that is, find the integer whose absolute difference with X is the minimum. If there are multiple such integers, repo... | ['x,n = map(int, input().split())\nl = list(map(lambda t : int(t)-x, input().split()))\np = [0] + sorted(map(abs,l))\nfor i in range(n//2):\n if ( n == 2 * i +1 ) or ( not ( p[2*i+1] == i )):\n if -i in l:\n print(x+i)\n else:\n print(x-i)\n break\n', 'import functools as ft\nx,n = map(int, input().... | ['Wrong Answer', 'Runtime Error', 'Runtime Error', 'Runtime Error', 'Wrong Answer', 'Runtime Error', 'Accepted'] | ['s060877011', 's370464413', 's481731572', 's612578695', 's791852215', 's937361597', 's378310888'] | [9184.0, 9568.0, 9572.0, 9196.0, 9208.0, 9120.0, 9232.0] | [20.0, 23.0, 21.0, 21.0, 23.0, 19.0, 22.0] | [257, 264, 259, 246, 302, 239, 91] |
p02641 | u854962015 | 2,000 | 1,048,576 | Given are an integer X and an integer sequence of length N: p_1, \ldots, p_N. Among the integers not contained in the sequence p_1, \ldots, p_N (not necessarily positive), find the integer nearest to X, that is, find the integer whose absolute difference with X is the minimum. If there are multiple such integers, repo... | ['import sys\nX,N=map(int,input().split())\nif N==0:\n print(X)\n sys.exit()\nelse:\n P=list(map(int,input().split()))\nL=[]\nA=[]\nA_1=[]\nfor i in range(-100,200):\n L.append(i)\nfor i in P:\n L[i+100]=200\nfor i in L:\n A.append(abs(X-i))\nA_1=sorted(A)\na=A_1[0]\nfor i in L:\n if i==X-a:\n print(i)\n s... | ['Wrong Answer', 'Accepted'] | ['s014519987', 's984145274'] | [9212.0, 8964.0] | [27.0, 29.0] | [355, 346] |
p02641 | u855967722 | 2,000 | 1,048,576 | Given are an integer X and an integer sequence of length N: p_1, \ldots, p_N. Among the integers not contained in the sequence p_1, \ldots, p_N (not necessarily positive), find the integer nearest to X, that is, find the integer whose absolute difference with X is the minimum. If there are multiple such integers, repo... | ['X, N = map(int, input().split())\nif N != 0:\n P = list(map(int, input().split()))\nelse:\n print(X)\n exit()\nlist = []\nlist2 = []\nfor i in range(-5,max(P)+50):\n if i not in P and i != X:\n res = abs(X - i)\n list.append(res)\n list2.append(i)\n \nmaxres = list.index(min(list))\nif maxres != 0:\n ... | ['Wrong Answer', 'Accepted'] | ['s803375332', 's710349903'] | [9140.0, 9188.0] | [24.0, 23.0] | [357, 221] |
p02641 | u856819253 | 2,000 | 1,048,576 | Given are an integer X and an integer sequence of length N: p_1, \ldots, p_N. Among the integers not contained in the sequence p_1, \ldots, p_N (not necessarily positive), find the integer nearest to X, that is, find the integer whose absolute difference with X is the minimum. If there are multiple such integers, repo... | ["import sys\nimport bisect\n\ndef I(): return int(sys.stdin.readline().rstrip())\ndef LI():return list(map(int,sys.stdin.readline().rstrip().split()))\ndef LS():return list(sys.stdin.readline().rstrip().split())\n\n\ndef main():\n X,N = LI()[:]\n P = LI()\n P.sort()\n print(X,N)\n print(P)\n\n if N==0:\n prin... | ['Runtime Error', 'Accepted'] | ['s095848955', 's998949666'] | [9240.0, 9236.0] | [25.0, 22.0] | [732, 765] |
p02641 | u857547702 | 2,000 | 1,048,576 | Given are an integer X and an integer sequence of length N: p_1, \ldots, p_N. Among the integers not contained in the sequence p_1, \ldots, p_N (not necessarily positive), find the integer nearest to X, that is, find the integer whose absolute difference with X is the minimum. If there are multiple such integers, repo... | ['P=list(map(int,input().split()))\nP=sorted(P)\nx=bisect_left(P,X)\nif x>=len(P):\n print(X)\n sys.exit()\nif P[x]!=X:\n print(X)\n sys.exit()\nA=X\nB=X\nwhile True:\n A-=1\n B+=1\n x1=bisect_left(P,A)\n x2=bisect_left(P,B)\n\n if x1<len(P) and P[x1]!=A:\n print(A)\n break\n ... | ['Runtime Error', 'Accepted'] | ['s322234301', 's818143574'] | [9240.0, 9196.0] | [24.0, 20.0] | [365, 269] |
p02641 | u861886710 | 2,000 | 1,048,576 | Given are an integer X and an integer sequence of length N: p_1, \ldots, p_N. Among the integers not contained in the sequence p_1, \ldots, p_N (not necessarily positive), find the integer nearest to X, that is, find the integer whose absolute difference with X is the minimum. If there are multiple such integers, repo... | ['X, N = list(map(int, input().split()))\np = list(map(int, input().split()))\np_max = max(p)\ndiff = [0]\n\nfor i in range(1, 101):\n if X - i not in P:\n print(X -1)\n break\n if X + i not in P:\n print(X + i)\n break', 'import numpy as np\n\n\ndef getNearestValue(list, num):\n\n ... | ['Runtime Error', 'Runtime Error', 'Accepted'] | ['s118634146', 's437371040', 's612077977'] | [9184.0, 8952.0, 9168.0] | [24.0, 21.0, 29.0] | [283, 420, 206] |
p02641 | u863370423 | 2,000 | 1,048,576 | Given are an integer X and an integer sequence of length N: p_1, \ldots, p_N. Among the integers not contained in the sequence p_1, \ldots, p_N (not necessarily positive), find the integer nearest to X, that is, find the integer whose absolute difference with X is the minimum. If there are multiple such integers, repo... | ["#input from user X and N\n#input from user p\n#print the number that is nearest to X but not included in p\n#if N = 0, p doesn't have to be taken, only X will be printed\n#time complexity O(n)\n\nX,N = [int(x) for x in input().split()]\np = [int(x) for x in input().split()[:N]]\n\n\na = X + 1\nb = X - 1\nif a < b :\n... | ['Wrong Answer', 'Accepted'] | ['s214376815', 's959893215'] | [9168.0, 9120.0] | [30.0, 26.0] | [404, 448] |
p02641 | u863397945 | 2,000 | 1,048,576 | Given are an integer X and an integer sequence of length N: p_1, \ldots, p_N. Among the integers not contained in the sequence p_1, \ldots, p_N (not necessarily positive), find the integer nearest to X, that is, find the integer whose absolute difference with X is the minimum. If there are multiple such integers, repo... | ['X,N = map(int,input().split())\nl = list(map(int,input().split()))\nn_l = sorted(l)\n\nfor i in range(N-2):\n if n_l[i]<= X < n_l[i+1]:\n print(n_l[i])\n else:\n print(n_l[N-1])\n break', 'X,N = map(int,input().split())\nl = list(map(int,input().split()))\nn_l = sorted(l)\n\nfor i in range(N-2):\n if n_l[... | ['Wrong Answer', 'Wrong Answer', 'Accepted'] | ['s092261035', 's778332143', 's624362226'] | [9060.0, 9020.0, 9036.0] | [25.0, 28.0, 27.0] | [187, 187, 212] |
p02641 | u868884408 | 2,000 | 1,048,576 | Given are an integer X and an integer sequence of length N: p_1, \ldots, p_N. Among the integers not contained in the sequence p_1, \ldots, p_N (not necessarily positive), find the integer nearest to X, that is, find the integer whose absolute difference with X is the minimum. If there are multiple such integers, repo... | ['kazulist = []\nfor i in range(100):\n kazulist.append(i+1)\n\na = list(input().split(" "))\ntarget = int(a[0])\nsyokyo = int(a[1])\n\nb = list(input().split(" "))\nfor i in b:\n kazulist.pop(int(i))\n\nsaisyosa = 100\nkotae = 0\nfor i in kazulist:\n sa = target - int(i)\n if sa < 0:\n sa *= -1\n ... | ['Runtime Error', 'Runtime Error', 'Accepted'] | ['s202288667', 's478674864', 's264578326'] | [9200.0, 9208.0, 9208.0] | [22.0, 24.0, 25.0] | [368, 375, 424] |
p02641 | u869265610 | 2,000 | 1,048,576 | Given are an integer X and an integer sequence of length N: p_1, \ldots, p_N. Among the integers not contained in the sequence p_1, \ldots, p_N (not necessarily positive), find the integer nearest to X, that is, find the integer whose absolute difference with X is the minimum. If there are multiple such integers, repo... | ['N,M=list(map(int,input().split()))\nL=list(map(int,input().split()))\nif N not in L:\n print(N)\n exit()\nc=N\nd=N\nwhile True:\n if c not in L:\n break\n else:\n c-=1\nwhile True:\n if d not in L:\n break\n else:\n d+=1\nif abs(d-M)>=abs(c-M):\n print(c)\nelse:\n print(d)\n \n \n \n ', ... | ['Wrong Answer', 'Wrong Answer', 'Accepted'] | ['s148899829', 's179429450', 's491380149'] | [9176.0, 8940.0, 9108.0] | [25.0, 27.0, 28.0] | [291, 196, 273] |
p02641 | u876616721 | 2,000 | 1,048,576 | Given are an integer X and an integer sequence of length N: p_1, \ldots, p_N. Among the integers not contained in the sequence p_1, \ldots, p_N (not necessarily positive), find the integer nearest to X, that is, find the integer whose absolute difference with X is the minimum. If there are multiple such integers, repo... | ["x,n = list(map(int,input().split()))\nif n >0 :\n p = list(map(int,input().split()))\n#print(x,n)\n#print(p)\n#print(max(p))\ny = 100\nans = n\nif n == 0:\n print(x)\nelse:\n for i in range(100):\n if p.count(i) == 0:\n print('i=',i,abs(x-i))\n if abs(x-i) < y:\n ans = i\n y = abs(x-i)\n... | ['Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Accepted'] | ['s495147391', 's634921794', 's807430252', 's824066083', 's906860575', 's925152804'] | [9144.0, 9120.0, 9208.0, 9228.0, 9224.0, 9132.0] | [22.0, 22.0, 22.0, 31.0, 20.0, 29.0] | [313, 278, 340, 356, 356, 358] |
p02641 | u882179152 | 2,000 | 1,048,576 | Given are an integer X and an integer sequence of length N: p_1, \ldots, p_N. Among the integers not contained in the sequence p_1, \ldots, p_N (not necessarily positive), find the integer nearest to X, that is, find the integer whose absolute difference with X is the minimum. If there are multiple such integers, repo... | ['x, n = list(map(int, input().split()))\n\nif n == 0:\n print(x)\n exit(0)\nelse:\n arr = list(map(int, input().split()))\n\narr.sort()\nprint(arr)\ni = arr.index(x)\n\nif not i and i != 0:\n print(x)\n exit(0)\n\nj = 1\nfor _ in range(n):\n row = i - j\n high = i + j\n if row >= 0 and arr[row] != x - j:\n ... | ['Runtime Error', 'Accepted'] | ['s830904207', 's017776483'] | [9064.0, 9216.0] | [30.0, 28.0] | [416, 414] |
p02641 | u882616665 | 2,000 | 1,048,576 | Given are an integer X and an integer sequence of length N: p_1, \ldots, p_N. Among the integers not contained in the sequence p_1, \ldots, p_N (not necessarily positive), find the integer nearest to X, that is, find the integer whose absolute difference with X is the minimum. If there are multiple such integers, repo... | ['def main():\n X,N = list(map(int, input().split()))\n if N==0: return\n \n P = list(map(int, input().split()))\n #allowed elements\n Q = set([i for i in range(1,100+1)])\n for p in P:\n Q.remove(p)\n Q = sorted(Q)\n # distance from X\n D = [abs(q-X) for q in Q]\n \n minD = min(D)\n for d,q in zip(D,Q)... | ['Runtime Error', 'Accepted'] | ['s788816975', 's376267448'] | [9100.0, 8992.0] | [27.0, 29.0] | [402, 388] |
p02641 | u887080361 | 2,000 | 1,048,576 | Given are an integer X and an integer sequence of length N: p_1, \ldots, p_N. Among the integers not contained in the sequence p_1, \ldots, p_N (not necessarily positive), find the integer nearest to X, that is, find the integer whose absolute difference with X is the minimum. If there are multiple such integers, repo... | ['xn=input().split()\nx=int(xn[0])\nn=int(xn[1])\n\ndata=input().split()\nfor i in range(100):\n for d in data:\n if int(d) == x-i:\n print(int(d))\n break\n elif int(d) == x+i:\n print(int(d))\n break\n else:\n continue\n break', 'xn=input().spl... | ['Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Accepted'] | ['s026633249', 's039294693', 's231268042', 's255054836', 's388117205', 's394884344', 's819116740', 's426375744'] | [9168.0, 9180.0, 9052.0, 9076.0, 9064.0, 9092.0, 9064.0, 9020.0] | [26.0, 30.0, 31.0, 28.0, 27.0, 29.0, 31.0, 27.0] | [285, 228, 296, 248, 238, 285, 285, 296] |
p02641 | u887152994 | 2,000 | 1,048,576 | Given are an integer X and an integer sequence of length N: p_1, \ldots, p_N. Among the integers not contained in the sequence p_1, \ldots, p_N (not necessarily positive), find the integer nearest to X, that is, find the integer whose absolute difference with X is the minimum. If there are multiple such integers, repo... | ['X,N=map(int,input().split())\nList=[int(i) for i in input().split()]\nA=X\nB=X\nif X in List == True: \n p=True\n q=True\n while p==True:\n A=A-1\n p= A in List\n while q==True:\n B=B+1\n q= B in List\n if X-A <= B-X:\n print (A)\n else:\n print (B)\nelse... | ['Wrong Answer', 'Accepted'] | ['s411498472', 's148564070'] | [9200.0, 9180.0] | [21.0, 23.0] | [315, 319] |
p02641 | u888260487 | 2,000 | 1,048,576 | Given are an integer X and an integer sequence of length N: p_1, \ldots, p_N. Among the integers not contained in the sequence p_1, \ldots, p_N (not necessarily positive), find the integer nearest to X, that is, find the integer whose absolute difference with X is the minimum. If there are multiple such integers, repo... | ['X,N=map(int,input().split())\nif N>0:\n p=list(map(int,input().split()))\n d=abs(X-p[0])\nif N>0:\n for i in range(N):\n d=min(abs(X-p[i]),d)\n print(p[i])\nelse:\n print(X)', 'X,N=map(int,input().split())\nl=[]\nfor i in range(100):\n l.append(i+1)\nif N>0:\n p=list(map(int,input().split()))\n l1=[x for x... | ['Wrong Answer', 'Runtime Error', 'Accepted'] | ['s003483451', 's439807875', 's319116012'] | [9196.0, 9200.0, 9048.0] | [22.0, 22.0, 22.0] | [172, 251, 258] |
p02641 | u890488173 | 2,000 | 1,048,576 | Given are an integer X and an integer sequence of length N: p_1, \ldots, p_N. Among the integers not contained in the sequence p_1, \ldots, p_N (not necessarily positive), find the integer nearest to X, that is, find the integer whose absolute difference with X is the minimum. If there are multiple such integers, repo... | ["x, y = map(int, input().split())\n\nif (x == 1 and y == 2) or (x == 1 and y == 4):\n print('Yes')\n quit()\n\nfor i in range(-101,201):\n if i * 2 + (x - i) * 4 == y:\n print('Yes')\n quit()\nprint('No')", 'x, y = map(int, input().split())\nli = list(map(int, input().split()))\n\nif y == 0:\n ... | ['Wrong Answer', 'Accepted'] | ['s253805409', 's660585569'] | [9184.0, 9200.0] | [23.0, 21.0] | [216, 293] |
p02641 | u893661063 | 2,000 | 1,048,576 | Given are an integer X and an integer sequence of length N: p_1, \ldots, p_N. Among the integers not contained in the sequence p_1, \ldots, p_N (not necessarily positive), find the integer nearest to X, that is, find the integer whose absolute difference with X is the minimum. If there are multiple such integers, repo... | ['x, n = map(int, input().split())\np = list(map(int, input().split()))\nprint (p)\n\nfor i in range(100):\n if not((x - i) in p):\n print (x - i)\n exit ()\n if not((x + i) in p):\n print (x + i)\n exit()\n', 'x, n = map(int, input().split())\np = list(map(int, input().split()))\n\nfo... | ['Wrong Answer', 'Accepted'] | ['s519279192', 's620072670'] | [8984.0, 9188.0] | [31.0, 30.0] | [228, 219] |
p02641 | u894858952 | 2,000 | 1,048,576 | Given are an integer X and an integer sequence of length N: p_1, \ldots, p_N. Among the integers not contained in the sequence p_1, \ldots, p_N (not necessarily positive), find the integer nearest to X, that is, find the integer whose absolute difference with X is the minimum. If there are multiple such integers, repo... | ['X,N = map(int,input().split())\np = list(map(int, input().split()))\n\ni = 0\n\nif X not in p:\n print(X)\n\nelse:\n while True:\n i += 1\n if X - i not in p:\n print(X-i)\n if X+i not in p:\n print(X+i)', 'X,N = map(int,input().split())\np = list(map(int, input().split()))\n\ni = 0\n\nif X not i... | ['Time Limit Exceeded', 'Accepted'] | ['s271295096', 's339719172'] | [47856.0, 9092.0] | [2251.0, 28.0] | [210, 235] |
p02641 | u894939163 | 2,000 | 1,048,576 | Given are an integer X and an integer sequence of length N: p_1, \ldots, p_N. Among the integers not contained in the sequence p_1, \ldots, p_N (not necessarily positive), find the integer nearest to X, that is, find the integer whose absolute difference with X is the minimum. If there are multiple such integers, repo... | ['class int(int): \n def times(self, callback):\n for times in range(0,self):\n callback()\n\nclass list(list):\n def maps(self, callback):\n return list(map(callback, self))\n\n def each(self, callback):\n list(map(callback, self))\n return self\n\n # index will sent to the function as a second p... | ['Runtime Error', 'Runtime Error', 'Runtime Error', 'Accepted'] | ['s014211160', 's846344576', 's949733504', 's036310633'] | [9136.0, 9288.0, 9240.0, 9176.0] | [27.0, 25.0, 27.0, 29.0] | [834, 1414, 1195, 1202] |
p02641 | u895536501 | 2,000 | 1,048,576 | Given are an integer X and an integer sequence of length N: p_1, \ldots, p_N. Among the integers not contained in the sequence p_1, \ldots, p_N (not necessarily positive), find the integer nearest to X, that is, find the integer whose absolute difference with X is the minimum. If there are multiple such integers, repo... | ['if n != 0:\n p = list(map(int, input().split()))\n \nresult = x\nif n != 0:\n for i in range(0, 1000):\n if not (x - i) in p:\n print(x - i)\n break\n if not (x + i) in p:\n print(x + i)\n break\nelse:\n print(x)\n ', 'X,N= map(int,input().split())... | ['Runtime Error', 'Accepted'] | ['s137563661', 's470901810'] | [9020.0, 9188.0] | [24.0, 19.0] | [271, 175] |
p02641 | u910362203 | 2,000 | 1,048,576 | Given are an integer X and an integer sequence of length N: p_1, \ldots, p_N. Among the integers not contained in the sequence p_1, \ldots, p_N (not necessarily positive), find the integer nearest to X, that is, find the integer whose absolute difference with X is the minimum. If there are multiple such integers, repo... | ['x, n = map(int, input().split())\np = list(map(int, inpot().split()))\nfor d in range(x + 1):\n for s in [-1, +1]:\n a = x + s * d\n if p.count(a) == 0:\n print(a)\n exit(0)', 'x, n = map(int, input().split())\np = list(map(int, input().split()))\nfor d in range(x + 1):\n for... | ['Runtime Error', 'Accepted'] | ['s081189144', 's159668242'] | [9172.0, 9124.0] | [26.0, 26.0] | [205, 205] |
p02641 | u910536093 | 2,000 | 1,048,576 | Given are an integer X and an integer sequence of length N: p_1, \ldots, p_N. Among the integers not contained in the sequence p_1, \ldots, p_N (not necessarily positive), find the integer nearest to X, that is, find the integer whose absolute difference with X is the minimum. If there are multiple such integers, repo... | ['import sys\nx, n = list(map(int, input().split()))\np = list(map(int, input().split()))\n\nif (n == 0):\n print(x)\n sys.exit()\n\na = [i for i in range(-110,210)]\n\nfor j in p:\n d = a.index(j)\n a.pop(d)\n\na.append(x)\na = set(a.sort())\n\nidx_x = a.index(x)\n\nif (idx_x == 0):\n print(a[idx_x+1])\... | ['Runtime Error', 'Accepted'] | ['s421747690', 's637334324'] | [9120.0, 9128.0] | [22.0, 24.0] | [514, 274] |
p02641 | u916242112 | 2,000 | 1,048,576 | Given are an integer X and an integer sequence of length N: p_1, \ldots, p_N. Among the integers not contained in the sequence p_1, \ldots, p_N (not necessarily positive), find the integer nearest to X, that is, find the integer whose absolute difference with X is the minimum. If there are multiple such integers, repo... | ['a,b= map(int,input().split())\nN = list(map(int,input().split()))\nS =[]\nkey = 9999\nfor i in range(b):\n\tc = [N[i]-a]\n\tS.extend(c)\nfor i in range(b):\n\tif key > abs(S[i]):\n\t\tkey= abs(S[i])\nif key ==0:\n\tprint(a)\nelse:\n\tif a - key in S:\n\t\tprint(a-key)\n\telse:\n\t\tprint(a+key)', 'a,b= map(int,input(... | ['Wrong Answer', 'Accepted'] | ['s250653619', 's644612386'] | [9144.0, 9172.0] | [23.0, 26.0] | [267, 199] |
p02641 | u916662650 | 2,000 | 1,048,576 | Given are an integer X and an integer sequence of length N: p_1, \ldots, p_N. Among the integers not contained in the sequence p_1, \ldots, p_N (not necessarily positive), find the integer nearest to X, that is, find the integer whose absolute difference with X is the minimum. If there are multiple such integers, repo... | ['x,n = (int(x) for x in input().split())\np = [int(x) for x in input().split()]\n\nresult = 100\n\nl = list(range(0,6))\n\n\n\nif len(p) == 0:\n kotae = x\nelse:\n for i in range(len(p)):\n\n l[p[i]] = 200\n\n\n for i in reversed(range(len(l))):\n \n \n\n if l[i] != 200:\n\n if r... | ['Runtime Error', 'Accepted'] | ['s240812596', 's752485499'] | [9212.0, 9096.0] | [21.0, 27.0] | [442, 436] |
p02641 | u921729430 | 2,000 | 1,048,576 | Given are an integer X and an integer sequence of length N: p_1, \ldots, p_N. Among the integers not contained in the sequence p_1, \ldots, p_N (not necessarily positive), find the integer nearest to X, that is, find the integer whose absolute difference with X is the minimum. If there are multiple such integers, repo... | ['x, n = map(int, input().split())\np = list(map(int, input().split()))\n\nif x in p:\n print(x)\nelse:\n for i in range(100):\n if x-i in p:\n print(x-i)\n break\n if x+i in p:\n print(x+i)\n break', 'x, n = map(int, input().split())\np = list(map(int, input().split()))\n\nif not(x in p):\n... | ['Wrong Answer', 'Accepted'] | ['s400044532', 's439348438'] | [9176.0, 9184.0] | [23.0, 19.0] | [212, 227] |
p02641 | u923172145 | 2,000 | 1,048,576 | Given are an integer X and an integer sequence of length N: p_1, \ldots, p_N. Among the integers not contained in the sequence p_1, \ldots, p_N (not necessarily positive), find the integer nearest to X, that is, find the integer whose absolute difference with X is the minimum. If there are multiple such integers, repo... | ['X, N = map(int,input().split())\np = list(map(int, input().split()))\n#print(p)\n#A.sort()\ndis = p[0] - X\nans = p[0]\nfor pi in p :\n if abs(pi-X) < abs(dis):\n ans = pi\n dis = pi - X\n #print("if")\n elif pi-X == -abs(dis):\n ans = pi\n dis = pi - X\n \nprint(ans)', 'X, N = map(int,input().split... | ['Runtime Error', 'Accepted'] | ['s589899221', 's518966120'] | [9192.0, 9216.0] | [23.0, 20.0] | [308, 429] |
p02641 | u924828749 | 2,000 | 1,048,576 | Given are an integer X and an integer sequence of length N: p_1, \ldots, p_N. Among the integers not contained in the sequence p_1, \ldots, p_N (not necessarily positive), find the integer nearest to X, that is, find the integer whose absolute difference with X is the minimum. If there are multiple such integers, repo... | ['x,n = [int(x) for x in input().split()]\nif n == 0:\n print(x)\nelse:\n p = [int(x) for x in input().split()]\n p.sort()\n ans = []\n for i in range(1,101):\n if i in p:\n continue\n b = abs(x - i)\n ans.append((i,b))\n ans = sorted(ans,key = lambda x: x[1])\n print(ans)\n print(ans[0][0])', 'x,... | ['Runtime Error', 'Wrong Answer', 'Accepted'] | ['s380491448', 's928625058', 's615556581'] | [9204.0, 9184.0, 9092.0] | [29.0, 31.0, 31.0] | [298, 209, 183] |
p02641 | u924852499 | 2,000 | 1,048,576 | Given are an integer X and an integer sequence of length N: p_1, \ldots, p_N. Among the integers not contained in the sequence p_1, \ldots, p_N (not necessarily positive), find the integer nearest to X, that is, find the integer whose absolute difference with X is the minimum. If there are multiple such integers, repo... | ['from sys import stdin\n \ninput_num = stdin.readline().strip().split(" ")\n\nX = int(input_num[0])\nN = int(input_num[1])\nnum_list = []\nif N != 0:\n num_list = [int(x) for x in stdin.readline().strip().split(" ")]\n\ndec_num = X\ninc_num = X\nif N == 0:\n print(X)\nelif X not in num_list:\n print(X)\nelse:... | ['Wrong Answer', 'Runtime Error', 'Runtime Error', 'Runtime Error', 'Accepted'] | ['s290586728', 's335684027', 's903358398', 's982646632', 's618318222'] | [8868.0, 8944.0, 9200.0, 9132.0, 9200.0] | [27.0, 26.0, 26.0, 24.0, 28.0] | [523, 362, 372, 360, 524] |
p02641 | u926266624 | 2,000 | 1,048,576 | Given are an integer X and an integer sequence of length N: p_1, \ldots, p_N. Among the integers not contained in the sequence p_1, \ldots, p_N (not necessarily positive), find the integer nearest to X, that is, find the integer whose absolute difference with X is the minimum. If there are multiple such integers, repo... | ['X,N = map(int, input().split())\nP = list(map(int, input().split()))\n\nif P.len == 0:\n print(X)\nelse:\n for i in range(X,1):\n if P.index(X-i) == 0:\n print(X-i)\n break\n elif P.index(X+1) == 0:\n print(X+1)\n break\n else:\n continue', 'X,N = map(int, input().split())\nP = lis... | ['Runtime Error', 'Runtime Error', 'Wrong Answer', 'Runtime Error', 'Accepted'] | ['s104593814', 's286849868', 's309622494', 's955552486', 's267839336'] | [9148.0, 9204.0, 9176.0, 9188.0, 9184.0] | [28.0, 30.0, 27.0, 23.0, 33.0] | [260, 260, 264, 262, 265] |
p02641 | u931889893 | 2,000 | 1,048,576 | Given are an integer X and an integer sequence of length N: p_1, \ldots, p_N. Among the integers not contained in the sequence p_1, \ldots, p_N (not necessarily positive), find the integer nearest to X, that is, find the integer whose absolute difference with X is the minimum. If there are multiple such integers, repo... | ['X, N = map(int, input().split())\nif N == 0:\n print(X)\n exit()\nP = list(map(int, input(). split()))\n\nif N == 1:\n if not (X - 1) in P:\n print(X - 1)\n exit()\n if not (X + 1) in P:\n print(X + 1)\n exit()\n\nfor n in range(1, (N // 2) + 1):\n print(X - n)\n print(X ... | ['Wrong Answer', 'Accepted'] | ['s484454082', 's557453294'] | [9168.0, 9144.0] | [22.0, 19.0] | [498, 314] |
p02641 | u933129390 | 2,000 | 1,048,576 | Given are an integer X and an integer sequence of length N: p_1, \ldots, p_N. Among the integers not contained in the sequence p_1, \ldots, p_N (not necessarily positive), find the integer nearest to X, that is, find the integer whose absolute difference with X is the minimum. If there are multiple such integers, repo... | ['x, n = map(int, input().split())\np = list(map(int, input().split()))\n\ntable = [0 for i in range(100)]\nfor i in p:\n table[i-1] = 1\n\nmx = 10000\nans = mx\ndis = mx\nfor i in range(len(table)):\n idx = 99-i\n if (table[idx] == 0) and (dis >= abs(idx+1-x)):\n ans = idx+1\n dis = abs(idx+1-x)... | ['Runtime Error', 'Accepted'] | ['s066014948', 's069873060'] | [9072.0, 9196.0] | [20.0, 20.0] | [401, 309] |
p02641 | u934119021 | 2,000 | 1,048,576 | Given are an integer X and an integer sequence of length N: p_1, \ldots, p_N. Among the integers not contained in the sequence p_1, \ldots, p_N (not necessarily positive), find the integer nearest to X, that is, find the integer whose absolute difference with X is the minimum. If there are multiple such integers, repo... | ["x, n = map(int, input().split())\np = list(map(int, input().split()))\na = 1\nans = ''\np.sort()\nprint(p)\nwhile ans == '':\n if len(p) == 0:\n ans = x\n elif x - a not in p:\n ans = x - a\n elif x + a not in p:\n ans = x + a\n else:\n a += 1\nprint(ans)", "x, n = map(int, input().split())\np = list(... | ['Wrong Answer', 'Accepted'] | ['s563850193', 's605683177'] | [9200.0, 9200.0] | [25.0, 22.0] | [256, 238] |
p02641 | u938933689 | 2,000 | 1,048,576 | Given are an integer X and an integer sequence of length N: p_1, \ldots, p_N. Among the integers not contained in the sequence p_1, \ldots, p_N (not necessarily positive), find the integer nearest to X, that is, find the integer whose absolute difference with X is the minimum. If there are multiple such integers, repo... | ['X, N = map(int,input().split())\nanswer = 0\nif N != 0:\n mapped_list = map(int,input().split())\n list = list(mapped_list)\n print(list)\n for i in range (N):\n if (X-i in list) == False:\n answer = X-i\n break\n elif (X+i in list) == False:\n answer = X+i\n break\nelse:\n answer = X \... | ['Wrong Answer', 'Accepted'] | ['s577030353', 's621839605'] | [9100.0, 9076.0] | [28.0, 28.0] | [320, 305] |
p02641 | u939581910 | 2,000 | 1,048,576 | Given are an integer X and an integer sequence of length N: p_1, \ldots, p_N. Among the integers not contained in the sequence p_1, \ldots, p_N (not necessarily positive), find the integer nearest to X, that is, find the integer whose absolute difference with X is the minimum. If there are multiple such integers, repo... | ['x,n=map(int,input().split())\nr=[i-x for i in map(int,input())]\ni=1\nwhile True:\n if not -i in r:\n print(x-i)\n break\n elif not i in r:\n print(x+i)\n else:\n i+=1', 'x,n=map(int,input().split())\nr=[i-x for i in map(int,input().split())]\ni=1\nwhile True:\n if not -i in r:\n print(x-i)\n br... | ['Runtime Error', 'Wrong Answer', 'Wrong Answer', 'Runtime Error', 'Runtime Error', 'Runtime Error', 'Accepted'] | ['s221096301', 's282746875', 's317668651', 's401308138', 's786935826', 's975763897', 's018652322'] | [9096.0, 27384.0, 9172.0, 9132.0, 9184.0, 9128.0, 9168.0] | [27.0, 2237.0, 24.0, 26.0, 25.0, 26.0, 24.0] | [172, 181, 159, 150, 180, 159, 181] |
p02641 | u940533000 | 2,000 | 1,048,576 | Given are an integer X and an integer sequence of length N: p_1, \ldots, p_N. Among the integers not contained in the sequence p_1, \ldots, p_N (not necessarily positive), find the integer nearest to X, that is, find the integer whose absolute difference with X is the minimum. If there are multiple such integers, repo... | ['import numpy as np\nX,N = map(int, input().split())\nif N != 0:\n p = list(map(int, input().split()))\n min_val = 0\n max_val = 101\n not_p = [i for i in range(min_val,max_val+1,1)]\n \n for i in range(N):\n not_p.remove(p[i])\n print(not_p)\n\n min_val = 999\n out_num = 101\n for i in range(len(not_p)):... | ['Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Accepted'] | ['s126297320', 's709241111', 's800015165', 's527335931'] | [27184.0, 27176.0, 27148.0, 26940.0] | [109.0, 111.0, 99.0, 116.0] | [433, 428, 430, 382] |
p02641 | u941438707 | 2,000 | 1,048,576 | Given are an integer X and an integer sequence of length N: p_1, \ldots, p_N. Among the integers not contained in the sequence p_1, \ldots, p_N (not necessarily positive), find the integer nearest to X, that is, find the integer whose absolute difference with X is the minimum. If there are multiple such integers, repo... | ['x,n,*a=map(int,open(0).read().split())\nb=[1]*101\nfor i in a:\n b[i]=0\nc=1000 \nans=n\nfor i in range(102):\n if b[i] and c>abs(x-i):\n c=abs(x-i)\n ans=i\nprint(ans)', 'x,n,*a=map(int,open(0).read().split())\nb=[1]*103\nfor i in a:\n b[i]=0\nc=1000 \nans=n\nfor i in range(102):\n if b[i] ... | ['Runtime Error', 'Accepted'] | ['s308823317', 's019753298'] | [9220.0, 9192.0] | [25.0, 23.0] | [178, 178] |
p02641 | u944886577 | 2,000 | 1,048,576 | Given are an integer X and an integer sequence of length N: p_1, \ldots, p_N. Among the integers not contained in the sequence p_1, \ldots, p_N (not necessarily positive), find the integer nearest to X, that is, find the integer whose absolute difference with X is the minimum. If there are multiple such integers, repo... | ['c=[]\nd=0\ne=[]\n\na,b=map(int,input().split())\nc=int(input().split())\nif c!=null:\n for i in range(c):\n d=a-c\n e.append(abs(d))\nprint(min(e)) ', 'x,n=map(int,input().split())\ns=list(map(int,input().split()))\n\ndist=0\nfor i in range(0,100):\n if abs(x-i)>=0:\n for j in s:\n if s[j]==i:\n else:\n ... | ['Runtime Error', 'Runtime Error', 'Runtime Error', 'Runtime Error', 'Accepted'] | ['s309667514', 's579423593', 's589744947', 's778549185', 's088327617'] | [9184.0, 8976.0, 9196.0, 9028.0, 9152.0] | [29.0, 30.0, 26.0, 23.0, 26.0] | [140, 164, 354, 387, 348] |
p02641 | u950052018 | 2,000 | 1,048,576 | Given are an integer X and an integer sequence of length N: p_1, \ldots, p_N. Among the integers not contained in the sequence p_1, \ldots, p_N (not necessarily positive), find the integer nearest to X, that is, find the integer whose absolute difference with X is the minimum. If there are multiple such integers, repo... | ['a = list(map(int,input().split()))\nb = list(map(int,input().split()))\nb.sort()\n\nP = a[1] - 1 \n\nlist = list(map(lambda x: x+1, list(range(b[P]))))\n\nif a[1] == 0:\n print(a[0])\n exit()\n\nfor i in range(a[1]):\n list.remove(b[i])\n\nnum = 0\n\nresult = []\n\nfor i in range(a[1]):\n x = a[0] - b[num]\n res... | ['Runtime Error', 'Accepted'] | ['s220104617', 's350522082'] | [9224.0, 9056.0] | [24.0, 23.0] | [346, 235] |
p02641 | u952170648 | 2,000 | 1,048,576 | Given are an integer X and an integer sequence of length N: p_1, \ldots, p_N. Among the integers not contained in the sequence p_1, \ldots, p_N (not necessarily positive), find the integer nearest to X, that is, find the integer whose absolute difference with X is the minimum. If there are multiple such integers, repo... | ['print(101)', 'print(0)', 'import sys\nx,n = map(int,input().split())\n \np,f = x-1,x+1\nbans = set(map(int,input().split()))\n\nif n == 0 or x not in bans:\n print(x)\n sys.exit()\n\nwhile True:\n if p not in bans:\n print(p)\n break \n p -= 1\n \n if f not in bans:\n print(f... | ['Wrong Answer', 'Wrong Answer', 'Accepted'] | ['s606414177', 's734178385', 's959172560'] | [9080.0, 9076.0, 9196.0] | [20.0, 21.0, 23.0] | [10, 8, 302] |
p02641 | u957198490 | 2,000 | 1,048,576 | Given are an integer X and an integer sequence of length N: p_1, \ldots, p_N. Among the integers not contained in the sequence p_1, \ldots, p_N (not necessarily positive), find the integer nearest to X, that is, find the integer whose absolute difference with X is the minimum. If there are multiple such integers, repo... | ['X,N = map(int,input().split())\np = list(map(int,input().split()))\nfor i in range(101):\n if X - i not in p:\n print(x - i)\n exit()\n elif X + i not in p:\n print(x + i)\n exit()', 'X,N = map(int,input().split())\np = list(map(int,input().split()))\nfor i in range(101):\n if X -... | ['Runtime Error', 'Accepted'] | ['s304122189', 's250998751'] | [8976.0, 9052.0] | [22.0, 23.0] | [206, 206] |
p02641 | u957799665 | 2,000 | 1,048,576 | Given are an integer X and an integer sequence of length N: p_1, \ldots, p_N. Among the integers not contained in the sequence p_1, \ldots, p_N (not necessarily positive), find the integer nearest to X, that is, find the integer whose absolute difference with X is the minimum. If there are multiple such integers, repo... | ['m, n = map(int, input().split())\np = list(map(int, input().split()))\n\nif n == 0:\n print(m)\n exit()\nelse:\n pp = list(range(0, max(p)+1))\n ppp = list(filter(lambda x: x not in p, pp))\n print(ppp)\n pppp = list(map(lambda x: abs(x-m), ppp))\n print(ppp[pppp.index(min(pppp))])\n', 'm, n = ma... | ['Wrong Answer', 'Wrong Answer', 'Accepted'] | ['s324621532', 's584463547', 's907383958'] | [9140.0, 9124.0, 9048.0] | [28.0, 26.0, 27.0] | [293, 197, 204] |
p02641 | u962423738 | 2,000 | 1,048,576 | Given are an integer X and an integer sequence of length N: p_1, \ldots, p_N. Among the integers not contained in the sequence p_1, \ldots, p_N (not necessarily positive), find the integer nearest to X, that is, find the integer whose absolute difference with X is the minimum. If there are multiple such integers, repo... | ['from bisect import bisect\nfrom bisect import insort\n\nX,N=list(map(int,input().split()))\nif N != 0:\n\tp=list(map(int,input().split()))\n\n\tnot_list=[]\n\tfor i in range(1,101):\n\t\tif i not in p:\n\t\t\tnot_list.append(i)\n\n\t\ta=bisect(not_list,X)\n\t\tinsort(not_list,X)\n\n\t\tans1=not_list[a]-not_list[a-1]\... | ['Runtime Error', 'Runtime Error', 'Accepted'] | ['s257591152', 's318354369', 's137743053'] | [9224.0, 9220.0, 9168.0] | [28.0, 29.0, 27.0] | [470, 470, 217] |
p02641 | u963747475 | 2,000 | 1,048,576 | Given are an integer X and an integer sequence of length N: p_1, \ldots, p_N. Among the integers not contained in the sequence p_1, \ldots, p_N (not necessarily positive), find the integer nearest to X, that is, find the integer whose absolute difference with X is the minimum. If there are multiple such integers, repo... | ['x,y=map(int,input().split())\na=list(map(int,input().split()))\na=set(a)\nfor i in range(101):\n \n if x-i not in a:\n print(x-i)\n exit()\n elif x+i not in a:\n print(x+i)\n exit()', 'x,y=map(int,input().split())\na=list(map(int,input().split()))\na=set(a)\nfor i in range(101):\n \n... | ['Runtime Error', 'Accepted'] | ['s683357868', 's071578159'] | [8936.0, 9164.0] | [22.0, 25.0] | [204, 199] |
p02641 | u963944915 | 2,000 | 1,048,576 | Given are an integer X and an integer sequence of length N: p_1, \ldots, p_N. Among the integers not contained in the sequence p_1, \ldots, p_N (not necessarily positive), find the integer nearest to X, that is, find the integer whose absolute difference with X is the minimum. If there are multiple such integers, repo... | ['import sys\nx,n=map(int,input().split())\np=list(map(int,input().split()))\nc=0\nif n==0:\n print(x)\n sys.exit()\nfor i in range(x,-200,-1):\n \n if not i in p:\n print(i)\n sys.exit()\n if not (x+c) in p:\n print(x+c)\n sys.exit()\n\u3000c+=1', 'import sys\nx,n=map(int,input().split())\np=list(map(... | ['Runtime Error', 'Accepted'] | ['s178167802', 's452049122'] | [9060.0, 9192.0] | [19.0, 25.0] | [243, 243] |
p02641 | u964521959 | 2,000 | 1,048,576 | Given are an integer X and an integer sequence of length N: p_1, \ldots, p_N. Among the integers not contained in the sequence p_1, \ldots, p_N (not necessarily positive), find the integer nearest to X, that is, find the integer whose absolute difference with X is the minimum. If there are multiple such integers, repo... | ['X,N = map(int, input().split())\nif(N == 0):\n print(X)\n exit()\nelse:\n p_list = list(map(int, input().split()))\n\ni = X\nans_small = X\nans_big = X\n\nwhile(True):\n i = i + 1\n #print("1",i)\n if((i in p_list)==True):\n pass\n else:\n ans_big = i\n break\n \ni = X\nwhile(True):\n i = i - 1\n ... | ['Wrong Answer', 'Accepted'] | ['s608890255', 's779789123'] | [9224.0, 9220.0] | [23.0, 22.0] | [486, 487] |
p02641 | u966207392 | 2,000 | 1,048,576 | Given are an integer X and an integer sequence of length N: p_1, \ldots, p_N. Among the integers not contained in the sequence p_1, \ldots, p_N (not necessarily positive), find the integer nearest to X, that is, find the integer whose absolute difference with X is the minimum. If there are multiple such integers, repo... | ['X, N = map(int, input().split())\np = list(map(int, input().split()))\n\nif N == 0:\n print(X)\n \nelse:\n for i in range(100):\n if (X-(i+1)) and (X+i+1) and X in p:\n continue\n \n elif (X-i-1) not in p:\n print(X-i-1)\n break\n \n elif (X+i+1) no... | ['Wrong Answer', 'Wrong Answer', 'Runtime Error', 'Accepted'] | ['s070100160', 's277228854', 's791613643', 's555624817'] | [9200.0, 9180.0, 9048.0, 9068.0] | [23.0, 24.0, 21.0, 21.0] | [353, 239, 326, 422] |
p02641 | u970267139 | 2,000 | 1,048,576 | Given are an integer X and an integer sequence of length N: p_1, \ldots, p_N. Among the integers not contained in the sequence p_1, \ldots, p_N (not necessarily positive), find the integer nearest to X, that is, find the integer whose absolute difference with X is the minimum. If there are multiple such integers, repo... | ["x, n = map(int, input().split())\np = list(map(int, input().split()))\n\nif n == 0:\n print(x)\n exit()\n\np.sort()\nprint(p)\nfor i in range(n):\n if p[i] == x:\n index = i\n break\n\nright = x + 1\nfor i in p[index + 1:]:\n print(i)\n if i != right:\n print('aaaa')\n print... | ['Runtime Error', 'Accepted'] | ['s547652063', 's115814229'] | [9264.0, 9224.0] | [23.0, 21.0] | [546, 493] |
p02641 | u970497613 | 2,000 | 1,048,576 | Given are an integer X and an integer sequence of length N: p_1, \ldots, p_N. Among the integers not contained in the sequence p_1, \ldots, p_N (not necessarily positive), find the integer nearest to X, that is, find the integer whose absolute difference with X is the minimum. If there are multiple such integers, repo... | ['X,N = list(map(int,input().split()))\np = list(map(int,input().split()))\n\ndef f(p):\n global X\n return p - X\n\np2 = list(map(f,p))\n\np3 = list(map(abs,p2))\n\nOK = 2\nj = 0\nprint(p2,p3)\n\nif min(p3) ==0:\n while(OK==2):\n j+=1\n \n OK = p3.count(min(p3)+j)\n\n print(X-p2[p3.index(min(p3)+j)])\n ... | ['Runtime Error', 'Accepted'] | ['s594087427', 's540788695'] | [9216.0, 9228.0] | [23.0, 24.0] | [316, 360] |
p02641 | u971124021 | 2,000 | 1,048,576 | Given are an integer X and an integer sequence of length N: p_1, \ldots, p_N. Among the integers not contained in the sequence p_1, \ldots, p_N (not necessarily positive), find the integer nearest to X, that is, find the integer whose absolute difference with X is the minimum. If there are multiple such integers, repo... | ['x,n = list(map(int,input().split()))\nif n == 0:\n print(x)\n exit()\n\np = list(map(int,input().split()))\n\nimport bisect\np.sort()\ni = bisect.bisect_left(p,x)\nprint(p)\nfor h in range(1, p[-1]-p[0]+2):\n if p[i-h] != x-h:\n print(x-h)\n exit()\n elif p[i+h] != x+h:\n print(x+h)\n exit() \n', '... | ['Runtime Error', 'Wrong Answer', 'Accepted'] | ['s264455092', 's873375489', 's596723606'] | [9144.0, 9128.0, 9160.0] | [30.0, 28.0, 26.0] | [296, 175, 334] |
p02641 | u974918235 | 2,000 | 1,048,576 | Given are an integer X and an integer sequence of length N: p_1, \ldots, p_N. Among the integers not contained in the sequence p_1, \ldots, p_N (not necessarily positive), find the integer nearest to X, that is, find the integer whose absolute difference with X is the minimum. If there are multiple such integers, repo... | ['X, N = map(int, input().split())\nif N == 0:\n exit()\np = list(map(int, input().split()))\n\nmax_num = max(p)\nlst = []\nfor i in range(max_num+2):\n if i not in p:\n lst.append(i)\ntmp = float("inf")\nprint(lst)\nfor j in lst:\n if tmp > abs(X-j):\n tmp = abs(X-j)\n ans = j\nprint(ans)', 'X, N = map(int... | ['Wrong Answer', 'Accepted'] | ['s109565739', 's683321286'] | [9148.0, 9176.0] | [27.0, 26.0] | [284, 284] |
p02641 | u975485663 | 2,000 | 1,048,576 | Given are an integer X and an integer sequence of length N: p_1, \ldots, p_N. Among the integers not contained in the sequence p_1, \ldots, p_N (not necessarily positive), find the integer nearest to X, that is, find the integer whose absolute difference with X is the minimum. If there are multiple such integers, repo... | ["def main():\n X, N = map(int, input().split())\n if N == 0:\n return X\n \n P = list(map(int, input().split()))\n \n if X < min(P) or X > max(P):\n return X\n \n delta = []\n for n in range(min(P), max(P) + 1):\n if n in P:\n delta.append(float('inf'))\n else:\n delta.append(abs(X - n))... | ['Wrong Answer', 'Wrong Answer', 'Accepted'] | ['s128330716', 's653467123', 's735051145'] | [9228.0, 9200.0, 9184.0] | [22.0, 25.0, 23.0] | [477, 357, 357] |
p02641 | u978531093 | 2,000 | 1,048,576 | Given are an integer X and an integer sequence of length N: p_1, \ldots, p_N. Among the integers not contained in the sequence p_1, \ldots, p_N (not necessarily positive), find the integer nearest to X, that is, find the integer whose absolute difference with X is the minimum. If there are multiple such integers, repo... | ["import sys\n\n\ndef main():\n x, n = map(int, input().split())\n P = list(map(int, input().split()))\n\n if not (x in P):\n print(x)\n sys.exit()\n\n for i in range(101):\n x1 = max(0, x - (i + 1))\n x2 = min(101, x + (i + 1))\n\n print(x1, x2)\n if x1 == 0:\n ... | ['Wrong Answer', 'Wrong Answer', 'Accepted'] | ['s682217302', 's954357205', 's734707812'] | [9212.0, 9216.0, 9212.0] | [23.0, 20.0, 23.0] | [618, 616, 596] |
p02641 | u981938462 | 2,000 | 1,048,576 | Given are an integer X and an integer sequence of length N: p_1, \ldots, p_N. Among the integers not contained in the sequence p_1, \ldots, p_N (not necessarily positive), find the integer nearest to X, that is, find the integer whose absolute difference with X is the minimum. If there are multiple such integers, repo... | ['# -*- coding: utf-8 -*-\nnum, i = map(int, input().split())\nif(i != 0):\n s = set(map(int, input().split()))\nelse:\n s = set()\nm = set(range(101))\no = list(m-s)\no2 = list(map(lambda x: abs(x - num), o))\nprint(o2.index(min(o2)))', '# -*- coding: utf-8 -*-\nnum, i = map(int, input().split())\nif(i != 0):\n s =... | ['Wrong Answer', 'Accepted'] | ['s023149608', 's597313861'] | [9192.0, 9200.0] | [24.0, 22.0] | [226, 229] |
p02641 | u985418994 | 2,000 | 1,048,576 | Given are an integer X and an integer sequence of length N: p_1, \ldots, p_N. Among the integers not contained in the sequence p_1, \ldots, p_N (not necessarily positive), find the integer nearest to X, that is, find the integer whose absolute difference with X is the minimum. If there are multiple such integers, repo... | ['x,n = list(map(int,input().split()))\np= list(map(int,input().split()))\n \nfor i in range(x+1):\n for s in [-1,+1]:\n a=x+s*i\n if a not in p:\n print(a)', 'x,n = list(map(int,input().split()))\np= list(map(int,input().split()))\n\nfor i in range(x+1):\n for s in [-1,+1]:\n a=X+s*d\n if a not in p:\n ... | ['Wrong Answer', 'Runtime Error', 'Runtime Error', 'Accepted'] | ['s006823617', 's268704412', 's331916764', 's262964643'] | [9024.0, 9072.0, 9176.0, 9100.0] | [31.0, 23.0, 25.0, 30.0] | [155, 157, 155, 168] |
p02641 | u993435350 | 2,000 | 1,048,576 | Given are an integer X and an integer sequence of length N: p_1, \ldots, p_N. Among the integers not contained in the sequence p_1, \ldots, p_N (not necessarily positive), find the integer nearest to X, that is, find the integer whose absolute difference with X is the minimum. If there are multiple such integers, repo... | ['X,N = map(int,input().split())\nP = list(map(int,input().split()))\n\nnum = sorted([[abs(X - i),i] for i in range(-100,101) if i not in P],key = lambda x: x[0])\n\nprint(num)', 'X,N = map(int,input().split())\nP = list(map(int,input().split()))\nnum = sorted([[abs(X - i),i] for i in range(-200,200) if i not in P],key... | ['Wrong Answer', 'Accepted'] | ['s467708153', 's971241672'] | [9188.0, 9228.0] | [22.0, 24.0] | [169, 403] |
p02641 | u994400382 | 2,000 | 1,048,576 | Given are an integer X and an integer sequence of length N: p_1, \ldots, p_N. Among the integers not contained in the sequence p_1, \ldots, p_N (not necessarily positive), find the integer nearest to X, that is, find the integer whose absolute difference with X is the minimum. If there are multiple such integers, repo... | ['X, N= map(int,input().split())\nP = map(int, input().split())\n\nP_sub_abs = [abs(i - X) for i in P]\nif(P_sub_abs.count(0) == 0):\n print(X)\n exit()\nfor i in range(1, 100):\n if(P_sub_abs.count(i) == 1):\n list = [X - i, X + i]\n list.remove(P[P_sub_abs.index(i)])\n print(list[0])\n ... | ['Runtime Error', 'Accepted'] | ['s356324177', 's178693359'] | [9212.0, 9204.0] | [22.0, 24.0] | [390, 407] |
p02641 | u995163736 | 2,000 | 1,048,576 | Given are an integer X and an integer sequence of length N: p_1, \ldots, p_N. Among the integers not contained in the sequence p_1, \ldots, p_N (not necessarily positive), find the integer nearest to X, that is, find the integer whose absolute difference with X is the minimum. If there are multiple such integers, repo... | ['x, n = map(int, input().split())\nif n == 0:\n print(x)\nelse:\n p = list(map(int, input().split()))\n p.sort()\n p1 = {i for i in range(p[-1])}\n p = set(p)\n p2 = p1 - p\n p2 = list(p2)\n absv = x\n for i in range(len(p2)):\n if absv > abs(x - p2[i]):\n absv = abs(x - p2[i])\n print(x - absv)', 'x... | ['Wrong Answer', 'Accepted'] | ['s813117350', 's053603979'] | [9152.0, 9124.0] | [22.0, 24.0] | [299, 284] |
p02642 | u000037600 | 2,000 | 1,048,576 | Given is a number sequence A of length N. Find the number of integers i \left(1 \leq i \leq N\right) with the following property: * For every integer j \left(1 \leq j \leq N\right) such that i \neq j , A_j does not divide A_i. | ['n=int(input())\nb=list(map(int,input().split()))\nans=0\nw=max(b)\na=[0]*w\nfor i in b:\n x=i\n while x<w:\n a[x]=1\n x+=i\nfor i in b:\n if a[i]==0:\n ans+=1', 'a=int(input())\nb=list(map(int,input().split()))\nans=0\nfor i in b:\n if len([j for j in b if not i%j==0])==a:\n break\n else:\n ans+=1... | ['Runtime Error', 'Wrong Answer', 'Accepted'] | ['s338563869', 's896346564', 's763823716'] | [32040.0, 32236.0, 32032.0] | [491.0, 2206.0, 540.0] | [158, 148, 175] |
p02642 | u013864607 | 2,000 | 1,048,576 | Given is a number sequence A of length N. Find the number of integers i \left(1 \leq i \leq N\right) with the following property: * For every integer j \left(1 \leq j \leq N\right) such that i \neq j , A_j does not divide A_i. | ['N = int(input())\nAs = list(map(int, input().split()))\n\nbool_array = []\n\n\nfor i in range(len(As)):\n tmp = [True if i!=j else False for j in range(len(As))]\n bool_array.append(tmp)\n\ncount = 0\nfor i, A in enumerate(As):\n is_exist = True\n for j, tf in enumerate(bool_array[i]):\n if i!=j an... | ['Wrong Answer', 'Accepted'] | ['s138027221', 's453210474'] | [369320.0, 32236.0] | [2214.0, 486.0] | [707, 325] |
p02642 | u016881126 | 2,000 | 1,048,576 | Given is a number sequence A of length N. Find the number of integers i \left(1 \leq i \leq N\right) with the following property: * For every integer j \left(1 \leq j \leq N\right) such that i \neq j , A_j does not divide A_i. | ['import sys\nreadline = sys.stdin.buffer.readline\nreadlines = sys.stdin.buffer.readlines\nread = sys.stdin.buffer.read\nsys.setrecursionlimit(10 ** 7)\nINF = float(\'inf\')\n\nimport collections\nN = int(input())\nA = list(map(int, input().split()))\ncA = collections.Counter(A)\n\nLIM = 10 ** 6 + 10\n# LIM = 25\n\nA.... | ['Runtime Error', 'Runtime Error', 'Runtime Error', 'Accepted'] | ['s320358809', 's510558980', 's806198439', 's733408267'] | [53072.0, 52844.0, 52836.0, 52960.0] | [435.0, 552.0, 524.0, 1792.0] | [558, 555, 555, 556] |
p02642 | u021217230 | 2,000 | 1,048,576 | Given is a number sequence A of length N. Find the number of integers i \left(1 \leq i \leq N\right) with the following property: * For every integer j \left(1 \leq j \leq N\right) such that i \neq j , A_j does not divide A_i. | ['N=int(input())\nA=list(map(int,input().split()))\nA.sort()\nma=A[-1]\ndp=[1]*(ma+1)\nans=0\n\nfor i in range(len(A)-1):\n p=A[i]\n if dp[i]==1:\n for q in range(ma//p+1):\n dp[p*q]=0\n if dp[i]!=dp[i+1]:\n ans+=1\nif dp[ma]==1:\n ans+=1\nprint(ans)\n', 'N=int(input())\nA=list(map(int,input().split(... | ['Runtime Error', 'Runtime Error', 'Accepted'] | ['s046992221', 's935477039', 's478307244'] | [32232.0, 32376.0, 32292.0] | [427.0, 260.0, 420.0] | [252, 247, 709] |
p02642 | u023229441 | 2,000 | 1,048,576 | Given is a number sequence A of length N. Find the number of integers i \left(1 \leq i \leq N\right) with the following property: * For every integer j \left(1 \leq j \leq N\right) such that i \neq j , A_j does not divide A_i. | ['n=int(input())\nA=list(map(int,input().split()))\n\nA.sort()\nB=[1]*n\n\nfrom math import sqrt\ndef eratosu():\n # if not isinstance(n,int):\n \n # if n<2:\n \n primec = 0\n \n data = A #2,3,4,...,n\n while len(data)>0:\n p = data[0]\n \n \n if len(data)>0:\n if data[1]==p:\n pr... | ['Runtime Error', 'Accepted'] | ['s721672963', 's733177314'] | [33032.0, 32380.0] | [2206.0, 420.0] | [779, 248] |
p02642 | u027903950 | 2,000 | 1,048,576 | Given is a number sequence A of length N. Find the number of integers i \left(1 \leq i \leq N\right) with the following property: * For every integer j \left(1 \leq j \leq N\right) such that i \neq j , A_j does not divide A_i. | ['N =input()\nA = list(map(int, input().split()))\nN=int(N)\ns=0\nA2 = [-1] \nLS =[-1]\nfor i in range(0,N):\n k=1\n P =A[i]\n if P in A2:\n pass\n else:\n while P*k<=10^6:\n LS.append(P)\n k+=1\n A2.append(P)\nfor j in range(0,N):\n if A[j] in A2:\n pass\n else:\n if LS.count(A[j]) ==1:\... | ['Wrong Answer', 'Wrong Answer', 'Runtime Error', 'Wrong Answer', 'Wrong Answer', 'Accepted'] | ['s059819070', 's172919342', 's367346260', 's755648677', 's945634850', 's546412289'] | [32248.0, 32252.0, 9108.0, 32196.0, 32240.0, 32308.0] | [2206.0, 2206.0, 25.0, 1148.0, 2206.0, 1050.0] | [336, 388, 274, 327, 339, 241] |
p02642 | u050584166 | 2,000 | 1,048,576 | Given is a number sequence A of length N. Find the number of integers i \left(1 \leq i \leq N\right) with the following property: * For every integer j \left(1 \leq j \leq N\right) such that i \neq j , A_j does not divide A_i. | ['n = int(input())\na_lst = list(map(int, input().split()))\nindex_lst = [0]*(a_max + 1)\n\nfor ai in a_lst:\n for multi in range(ai, a_max+1, ai):\n index_lst[multi] += 1\n\nans = 0\nfor ai in a_lst:\n if index_lst[ai] == 1:\n ans += 1\nprint(ans)', 'n = int(input())\na_lst = list(map(int, input().... | ['Runtime Error', 'Accepted'] | ['s099388671', 's840583182'] | [32112.0, 32060.0] | [69.0, 468.0] | [254, 274] |
p02642 | u057415180 | 2,000 | 1,048,576 | Given is a number sequence A of length N. Find the number of integers i \left(1 \leq i \leq N\right) with the following property: * For every integer j \left(1 \leq j \leq N\right) such that i \neq j , A_j does not divide A_i. | ["def LI(): return list(map(int, input().split()))\ndef I(): return map(int, input().split())\n \ndef main():\n m = int(input())\n a = LI()\n ans = 0\n n = max(a)\n num = [True]*(n+1)\n num[0] = False\n a.sort()\n for i in range(m):\n if (i != m-1 and a[i]==a[i+1]) or (i != 0 and a[i]== a[i-1]): num[a[i]] =... | ['Wrong Answer', 'Accepted'] | ['s709380537', 's416917514'] | [39520.0, 32420.0] | [358.0, 378.0] | [481, 523] |
p02642 | u067983636 | 2,000 | 1,048,576 | Given is a number sequence A of length N. Find the number of integers i \left(1 \leq i \leq N\right) with the following property: * For every integer j \left(1 \leq j \leq N\right) such that i \neq j , A_j does not divide A_i. | ['import bisect\nimport copy\nimport heapq\nimport sys\nimport itertools\nimport math\nimport queue\nfrom functools import lru_cache\ninput = sys.stdin.readline\nsys.setrecursionlimit(1000000)\nmod = 10 ** 9 + 7 \n\ndef read_values(): return map(int, input().split())\ndef read_index(): return map(lambda x: int(x) - 1, ... | ['Wrong Answer', 'Accepted'] | ['s623794303', 's078140442'] | [45060.0, 34572.0] | [1585.0, 349.0] | [847, 791] |
p02642 | u068862829 | 2,000 | 1,048,576 | Given is a number sequence A of length N. Find the number of integers i \left(1 \leq i \leq N\right) with the following property: * For every integer j \left(1 \leq j \leq N\right) such that i \neq j , A_j does not divide A_i. | ["import math\nN = int(input())\nA = list(map(int, input().split()))\n\nAs = sorted(A)\n\ndellist = []\n\ni = 0\nMAX = int(math.sqrt(As[N-1]))+2\nwhile(i < len(As)):\n if As[i] < MAX:\n break\n# print('i:{}'.format(i))\n# print('As:{}'.format(As))\n \n j = i+1\n poplist = []\n while(j < le... | ['Wrong Answer', 'Runtime Error', 'Runtime Error', 'Runtime Error', 'Accepted'] | ['s276384863', 's630249704', 's762499081', 's888527472', 's650596304'] | [33348.0, 46168.0, 33344.0, 32228.0, 45992.0] | [2206.0, 297.0, 2206.0, 2206.0, 1546.0] | [1671, 493, 1652, 356, 492] |
p02642 | u072218780 | 2,000 | 1,048,576 | Given is a number sequence A of length N. Find the number of integers i \left(1 \leq i \leq N\right) with the following property: * For every integer j \left(1 \leq j \leq N\right) such that i \neq j , A_j does not divide A_i. | ['# -*- coding: utf-8 -*-\n\nn = int(input())\nnum_list = list(map(int, input().split()))\n\nnew_num_list = list(set(num_list))\nnew_num_list.sort()\n\nif len(new_num_list) = 1:\n ans = 0\nelse:\n ans = 1\n\ncount = 0\n\nfor index_1, num_1 in enumerate(num_list):\n for index_2, num_2 in enumerate(num_list):\n if ... | ['Runtime Error', 'Accepted'] | ['s877161157', 's992165826'] | [9024.0, 103036.0] | [24.0, 796.0] | [431, 340] |
p02642 | u075303794 | 2,000 | 1,048,576 | Given is a number sequence A of length N. Find the number of integers i \left(1 \leq i \leq N\right) with the following property: * For every integer j \left(1 \leq j \leq N\right) such that i \neq j , A_j does not divide A_i. | ['import numpy as np\nfrom numba import njit\n\n\nn = int(input())\na = np.array(list(map(int, input().split())))\nans = 0\n\n@njit\ndef check(ans):\n for i in range(n):\n temp = a[i]\n count = np.count_nonzero(temp%a==0)\n if count == 1:\n ans += 1\n return ans\n\nans = check(ans)\nprint(ans)', 'import... | ['Time Limit Exceeded', 'Runtime Error', 'Accepted'] | ['s661715484', 's945194216', 's610009872'] | [150048.0, 8968.0, 122428.0] | [2209.0, 24.0, 733.0] | [290, 321, 362] |
p02642 | u075304271 | 2,000 | 1,048,576 | Given is a number sequence A of length N. Find the number of integers i \left(1 \leq i \leq N\right) with the following property: * For every integer j \left(1 \leq j \leq N\right) such that i \neq j , A_j does not divide A_i. | ['import math\nimport collections\nimport fractions\nimport itertools\n\ndef solve():\n n = int(input())\n arr = list(map(int, input().split()))\n arr.sort()\n s = set()\n cnt = collections.Counter(arr)\n for i in ragne(n):\n if arr[i] in s:\n continue\n elif cnt[arr[i]] >= 2:... | ['Runtime Error', 'Accepted'] | ['s378741861', 's996678982'] | [36648.0, 104780.0] | [142.0, 669.0] | [549, 558] |
p02642 | u077291787 | 2,000 | 1,048,576 | Given is a number sequence A of length N. Find the number of integers i \left(1 \leq i \leq N\right) with the following property: * For every integer j \left(1 \leq j \leq N\right) such that i \neq j , A_j does not divide A_i. | ['# D - Not Divisible\ndef main():\n N, *A = map(int, open(0).read().split())\n lim = max(A) + 1\n dp = [-1] * lim\n for a in A:\n dp[a] += 1\n if dp[a]:\n continue\n for i in range(a * 2, lim, a):\n dp[i] = 0\n print(sum(dp[a] == 0 for a in A))\n\n\nif __name__... | ['Wrong Answer', 'Accepted'] | ['s505982454', 's536233678'] | [32976.0, 33144.0] | [214.0, 197.0] | [331, 349] |
p02642 | u087731474 | 2,000 | 1,048,576 | Given is a number sequence A of length N. Find the number of integers i \left(1 \leq i \leq N\right) with the following property: * For every integer j \left(1 \leq j \leq N\right) such that i \neq j , A_j does not divide A_i. | ['from collections import Counter\nmax_=10**6+1\nans=0\n\nn=int(input())\ndata=list(map(int,input().split()))\n\nb=[True]*(max_+1)\ndata.sort()\nc=Counter(data)\nprint(c)\n\nfor d in data:\n if b[d]:\n for j in range(d,max_,d):\n b[j]=False\n if c[d]==1:\n ans+=1\nprint(ans)\n', '... | ['Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Accepted'] | ['s224138636', 's299842906', 's479352292', 's494347372'] | [64908.0, 32404.0, 64896.0, 43756.0] | [434.0, 2266.0, 418.0, 361.0] | [295, 936, 314, 315] |
p02642 | u092387689 | 2,000 | 1,048,576 | Given is a number sequence A of length N. Find the number of integers i \left(1 \leq i \leq N\right) with the following property: * For every integer j \left(1 \leq j \leq N\right) such that i \neq j , A_j does not divide A_i. | ['n = int(input())\n\nl = [int(x) for x in input().split()]\nmp = [1]*n\n\n\nfor i in range(n):\n for j in range(i+1,n):\n if(mp[j]==0):\n continue\n if(l[j]==l[i]):\n mp[i] = 0\n mp[j] = 0\n continue\n if(l[j]%l[i]==0):\n mp[j] = 0\n ... | ['Wrong Answer', 'Accepted'] | ['s460741322', 's343166912'] | [32016.0, 36200.0] | [2206.0, 482.0] | [331, 381] |
p02642 | u094999522 | 2,000 | 1,048,576 | Given is a number sequence A of length N. Find the number of integers i \left(1 \leq i \leq N\right) with the following property: * For every integer j \left(1 \leq j \leq N\right) such that i \neq j , A_j does not divide A_i. | ['n,*a=map(int,open(0).read().split())\ni = 0\nwhile a:\n if a.count(a[0]) == 1:\n i+=1\n a = list(filter(lambda x: x%a[0] >0,a))\nprint(i)', 'n,*a=map(int,open(0).read().split())\ni = 0\nwhile a:\n if a.count(a[0]) == 1:\n i+=1\n a = list(filter(lambda x: x%a[i] >0,a))\nprint(i)', 'import num... | ['Wrong Answer', 'Runtime Error', 'Runtime Error', 'Runtime Error', 'Accepted'] | ['s128519502', 's201499305', 's288614035', 's785610615', 's990881595'] | [33260.0, 33208.0, 50180.0, 9068.0, 33344.0] | [2206.0, 2206.0, 2206.0, 26.0, 298.0] | [144, 144, 163, 255, 210] |
p02642 | u095094246 | 2,000 | 1,048,576 | Given is a number sequence A of length N. Find the number of integers i \left(1 \leq i \leq N\right) with the following property: * For every integer j \left(1 \leq j \leq N\right) such that i \neq j , A_j does not divide A_i. | ['n=int(input())\na=list(map(int,input().split()))\na.sort()\nok=[0]*(a[-1]+1)\nfor i in range(n):\n ok[a[i]]+=1\nfor i in range(n):\n if ok[a[i]]>1:\n ok[a[i]]=0\n elif ok[a[i]]:\n for j in range(2,a[-1]//a[i]):\n ok[a[i]*j]=0\n \nprint(sum(ok))', 'n=int(input())\na=list(map(int,input().split()))\na.s... | ['Wrong Answer', 'Accepted'] | ['s691788942', 's696942183'] | [32240.0, 32376.0] | [544.0, 584.0] | [248, 287] |
p02642 | u098012509 | 2,000 | 1,048,576 | Given is a number sequence A of length N. Find the number of integers i \left(1 \leq i \leq N\right) with the following property: * For every integer j \left(1 \leq j \leq N\right) such that i \neq j , A_j does not divide A_i. | ['import collections\n\nN = int(input())\nA = [int(x) for x in input().split()]\n\nc = collections.Counter(A)\n\nA = list(set(A))\nA.sort()\n\ntotal = 10 ** 6 + 1\n\nX = [0] * total\n\nfor a in A:\n for aa in range(a + a, total, a):\n X[aa] = 1\n\nans = 0\nfor i in range(1, total):\n if X[i] == 0 and c[i] ... | ['Wrong Answer', 'Accepted'] | ['s160412199', 's107694670'] | [45296.0, 45080.0] | [1502.0, 1297.0] | [342, 333] |
p02642 | u099150084 | 2,000 | 1,048,576 | Given is a number sequence A of length N. Find the number of integers i \left(1 \leq i \leq N\right) with the following property: * For every integer j \left(1 \leq j \leq N\right) such that i \neq j , A_j does not divide A_i. | ['n = int(input())\na = list(map(int, input().split()))\na.sort()\n\nb = [True for i in range(n)]\n\ns = 0\nwhile s < n-1:\n if b[s]:\n for k in range(s+1, n):\n if b[k]:\n b[k] = bool(a[k] % a[s])\n b[s] = a[s+1] != a[s]\n s += 1\n\nprint(b)\nprint(b.count(True))\n', 'n = ... | ['Wrong Answer', 'Accepted'] | ['s168782301', 's892199910'] | [33204.0, 32240.0] | [2206.0, 852.0] | [293, 353] |
p02642 | u100927237 | 2,000 | 1,048,576 | Given is a number sequence A of length N. Find the number of integers i \left(1 \leq i \leq N\right) with the following property: * For every integer j \left(1 \leq j \leq N\right) such that i \neq j , A_j does not divide A_i. | ['N = int(input())\nA = sorted((map(int,input().split())))\nA_Max = A[-1]\nB = [True]*A_Max\n\nfor i in range(N):\n if B[A[i]]:\n for j in range(0, A_Max):\n if j < 2:\n continue\n elif A[i]*j > A_Max:\n break\n B[A[i] * j] = False\n\nans = 0\nfor... | ['Runtime Error', 'Runtime Error', 'Runtime Error', 'Runtime Error', 'Runtime Error', 'Runtime Error', 'Runtime Error', 'Accepted'] | ['s337334755', 's364571486', 's521018019', 's688279776', 's804012172', 's891911562', 's896756464', 's283665517'] | [32372.0, 32272.0, 32184.0, 32248.0, 32240.0, 32180.0, 32272.0, 32176.0] | [902.0, 817.0, 426.0, 795.0, 106.0, 797.0, 510.0, 309.0] | [397, 391, 346, 391, 351, 356, 344, 288] |
p02642 | u102367647 | 2,000 | 1,048,576 | Given is a number sequence A of length N. Find the number of integers i \left(1 \leq i \leq N\right) with the following property: * For every integer j \left(1 \leq j \leq N\right) such that i \neq j , A_j does not divide A_i. | ['def main():\n\tn = I()\n\tA = np.array(LI())\n\tA.sort()\n\tcount = 0\n\ta_max = A[-1]\n\tdp = [1]*a_max\n\tfor a in A:\n\t\tpoint = dp[a-1]\n\t\tif point == 1:\n\t\t\tdp[a-1] = 2\n\t\t\tcount += 1\n\t\t\tfor i in range(2,a_max):\n\t\t\t\tif a*i > a_max:\n\t\t\t\t\tbreak\n\t\t\t\tdp[a*i-1] = 0\n\t\telif point == 2:\n... | ['Wrong Answer', 'Accepted'] | ['s894393915', 's663156160'] | [9052.0, 45936.0] | [23.0, 442.0] | [308, 1415] |
p02642 | u106311097 | 2,000 | 1,048,576 | Given is a number sequence A of length N. Find the number of integers i \left(1 \leq i \leq N\right) with the following property: * For every integer j \left(1 \leq j \leq N\right) such that i \neq j , A_j does not divide A_i. | ["#!python3.8\n# -*- coding: utf-8 -*-\n# abc170/abc170_d\nimport sys\nfrom collections import Counter\n\ni2s = sys.stdin.readline().rstrip\n\ndef main():\n N = int(i2s())\n A = sorted(map(int, i2s().split(' ')))\n B = Counter(A)\n for a in A:\n if B[a] == 0:\n continue\n if B[a] > ... | ['Wrong Answer', 'Runtime Error', 'Accepted'] | ['s091550262', 's407577590', 's054306086'] | [9392.0, 32424.0, 96764.0] | [26.0, 114.0, 935.0] | [470, 1156, 389] |
p02642 | u107601154 | 2,000 | 1,048,576 | Given is a number sequence A of length N. Find the number of integers i \left(1 \leq i \leq N\right) with the following property: * For every integer j \left(1 \leq j \leq N\right) such that i \neq j , A_j does not divide A_i. | ['N = int(input())\narray = list(map(int, input().strip().split()))\narray.sort()\nans = 0\na = [True] * array{N}\ni = 0\nbefore = 0\nfor i in array:\n j = 2*i\n if i == before:\n array[i] == False\n while j < array[N]:\n array[j] == False\n j += i\n before = i\nfor i in array:\n if ... | ['Runtime Error', 'Runtime Error', 'Accepted'] | ['s552616803', 's878330499', 's912506160'] | [9028.0, 32176.0, 33096.0] | [23.0, 589.0, 652.0] | [347, 351, 388] |
p02642 | u111473084 | 2,000 | 1,048,576 | Given is a number sequence A of length N. Find the number of integers i \left(1 \leq i \leq N\right) with the following property: * For every integer j \left(1 \leq j \leq N\right) such that i \neq j , A_j does not divide A_i. | ['def main():\n import sys\n sys.setrecursionlimit(10**9)\n input = sys.stdin.readline\n from collections import Counter\n\n N = int(input())\n A = tuple(map(int, input().split()))\n counter_A = Counter(A)\n \n count = 0\n for i in counter_A.keys():\n if counter_A[i] > 1:\n ... | ['Wrong Answer', 'Accepted'] | ['s314999901', 's043339732'] | [37064.0, 40204.0] | [2206.0, 1150.0] | [619, 505] |
p02642 | u113255362 | 2,000 | 1,048,576 | Given is a number sequence A of length N. Find the number of integers i \left(1 \leq i \leq N\right) with the following property: * For every integer j \left(1 \leq j \leq N\right) such that i \neq j , A_j does not divide A_i. | ['N = int(input())\nList = list(map(int, input().split()))\nres = 0\nNew_List = sorted(List)\nFlag = [1]*N\n\ndef checkf(x, List):\n for j in range(N):\n if x < j:\n break\n else:\n if x == List[j]:\n return True\n return False\nfor i in range(2, N-1):\n for j in range(i+1,N):\n if New_List... | ['Wrong Answer', 'Wrong Answer', 'Accepted'] | ['s299573464', 's707382161', 's540443172'] | [33284.0, 127980.0, 33124.0] | [2206.0, 2418.0, 348.0] | [615, 456, 285] |
p02642 | u114641312 | 2,000 | 1,048,576 | Given is a number sequence A of length N. Find the number of integers i \left(1 \leq i \leq N\right) with the following property: * For every integer j \left(1 \leq j \leq N\right) such that i \neq j , A_j does not divide A_i. | ['from collections import deque,Counter\n\nN = int(input())\nA = list(map(int,input().split()))\n\nmemo = [0] * (10**6+10)\ncnt = Counter(A)\nfor k,v in cnt.items():\n if memo[k] > 1:\n continue\n for j in range(k,10**6+1,k):\n memo[j] += v \n\nans = 0\nfor num in cnt:\n ans += (memo[num] == 0)\n... | ['Wrong Answer', 'Wrong Answer', 'Accepted'] | ['s624117516', 's790832663', 's389044289'] | [52928.0, 136676.0, 52656.0] | [847.0, 2210.0, 921.0] | [314, 1347, 340] |
p02642 | u116038906 | 2,000 | 1,048,576 | Given is a number sequence A of length N. Find the number of integers i \left(1 \leq i \leq N\right) with the following property: * For every integer j \left(1 \leq j \leq N\right) such that i \neq j , A_j does not divide A_i. | ['\nimport numpy as np \nimport sys\ninput = sys.stdin.readline\nN = int(input())\nA = list(map(int, input().split()))\nA.sort()\nA_np =np.array(A,dtype=np.int64)\nA_set =set(A)\ncount =set()\nfor i in range(N):\n if np.count_nonzero(A[i] %A_np[:i] ==0) >=1:\n count.add(A[i])\nans =len(A_set - count)\npri... | ['Runtime Error', 'Time Limit Exceeded', 'Accepted'] | ['s662697900', 's811374478', 's523342868'] | [8900.0, 54116.0, 39068.0] | [25.0, 2207.0, 659.0] | [329, 678, 407] |
p02642 | u125348436 | 2,000 | 1,048,576 | Given is a number sequence A of length N. Find the number of integers i \left(1 \leq i \leq N\right) with the following property: * For every integer j \left(1 \leq j \leq N\right) such that i \neq j , A_j does not divide A_i. | ['N=int(input())\n\nA=list(map(int,input().split()))\n\nrcnt=0\nlength=len(A)\ndef length(n,*A):\n \n for i in range(length):\n if A[i]==A[i+1]:\n cnt+=1\n if cnt==N:\n print(0)\n return\n\n for i in range(length):\n cnt=0\n for j in range(length):\n... | ['Runtime Error', 'Accepted'] | ['s479120255', 's442439721'] | [32264.0, 52468.0] | [71.0, 1889.0] | [434, 773] |
p02642 | u127499732 | 2,000 | 1,048,576 | Given is a number sequence A of length N. Find the number of integers i \left(1 \leq i \leq N\right) with the following property: * For every integer j \left(1 \leq j \leq N\right) such that i \neq j , A_j does not divide A_i. | ['def main():\n n, *a = map(int, open(0).read().split())\n if n == 1:\n print(1)\n return\n\n m = max(a) + 1\n l = [0] * m\n for i in a:\n for j in range(i, m, i):\n l[j] += 2\n l[i] -= 1\n\n ans = sum(l[i] == -1 for i in a)\n print(ans)\n\n\nif __name__ == "_... | ['Wrong Answer', 'Runtime Error', 'Runtime Error', 'Accepted'] | ['s245280021', 's613106359', 's766216025', 's190718386'] | [33144.0, 33216.0, 38244.0, 33132.0] | [352.0, 406.0, 150.0, 387.0] | [322, 322, 588, 321] |
p02642 | u127873832 | 2,000 | 1,048,576 | Given is a number sequence A of length N. Find the number of integers i \left(1 \leq i \leq N\right) with the following property: * For every integer j \left(1 \leq j \leq N\right) such that i \neq j , A_j does not divide A_i. | ['from collections import Counter\n\ndef undivisible(A):\n m = max(A)\n dp = [True] * (m+1)\n A.sort()\n for a in A:\n if dp[a]:\n k = a * 2\n while k <= m:\n dp[k] = False\n k += a\n cnt = Counter(A)\n ans = 0\n for a in A:\n if dp[... | ['Wrong Answer', 'Wrong Answer', 'Accepted'] | ['s754332728', 's908886916', 's756694485'] | [43380.0, 10700.0, 43532.0] | [268.0, 32.0, 281.0] | [429, 411, 434] |
p02642 | u129749062 | 2,000 | 1,048,576 | Given is a number sequence A of length N. Find the number of integers i \left(1 \leq i \leq N\right) with the following property: * For every integer j \left(1 \leq j \leq N\right) such that i \neq j , A_j does not divide A_i. | ['N = int(input())\na = list(map(int,input().split()))\nA = sorted(a, reverse=True)\ncount = 0\nfor i in range(N-1):\n flag = False\n for j in range(i+1,N):\n if i != j:\n if A[i] % A[j] == 0:\n flag = True\n break\n if flag == False:\n count += 1\nprint(count)\n', 'N = int(input())\na = lis... | ['Wrong Answer', 'Wrong Answer', 'Accepted'] | ['s554913266', 's735962431', 's990424463'] | [32308.0, 32252.0, 32300.0] | [2206.0, 2206.0, 315.0] | [275, 322, 273] |
p02642 | u131638468 | 2,000 | 1,048,576 | Given is a number sequence A of length N. Find the number of integers i \left(1 \leq i \leq N\right) with the following property: * For every integer j \left(1 \leq j \leq N\right) such that i \neq j , A_j does not divide A_i. | ['n,*a=map(int,open(0).read().split())\na.sort()\nnum=[True for i in range(a[-1]+1)]\nfor i in range(n):\n if num[a[i]]:\n for j in range(a[-1]//a[i]):\n if j<2:\n continue\n num[a[i]*j]=False\n if i==n-1:\n pass\n elif a[i]==a[i+1]:\n num[a[i]]=False\n else:\n pass\n else:... | ['Wrong Answer', 'Wrong Answer', 'Runtime Error', 'Accepted'] | ['s008281981', 's377469097', 's874213303', 's213161454'] | [33220.0, 32980.0, 33024.0, 33024.0] | [532.0, 2206.0, 451.0, 566.0] | [379, 157, 334, 381] |
p02642 | u131881594 | 2,000 | 1,048,576 | Given is a number sequence A of length N. Find the number of integers i \left(1 \leq i \leq N\right) with the following property: * For every integer j \left(1 \leq j \leq N\right) such that i \neq j , A_j does not divide A_i. | ['n = int(input())\na=list(map(int,input().split()))\na.sort()\ndp = [True for _ in range(a[n-1])]\nfor val in set(a):\n for i in range(2,a[n-1]+1,val):\n dp[i-1]=False\nans = 0\nfor val in a:\n if dp[val-1] and a.count(val)==1:\n ans+=1\nprint(ans)', 'n = int(input())\na=list(map(int,input().split(... | ['Wrong Answer', 'Runtime Error', 'Wrong Answer', 'Accepted'] | ['s489772895', 's582335409', 's828285891', 's275483349'] | [39420.0, 39644.0, 39400.0, 38520.0] | [2206.0, 161.0, 2206.0, 431.0] | [256, 252, 276, 368] |
p02642 | u137646745 | 2,000 | 1,048,576 | Given is a number sequence A of length N. Find the number of integers i \left(1 \leq i \leq N\right) with the following property: * For every integer j \left(1 \leq j \leq N\right) such that i \neq j , A_j does not divide A_i. | ['length=int(input())\nlist=list(map(int,input().split()))\nmax=max(list)\ndp=[True]*(max+1)\nret=0\nfor num in list:\n if dp[num]:\n for i in range(max//num+1):\n dp[num*i]=False\n if list.count(num)==1:\n ret=ret+1\nprint(ret)\n', 'import numpy as np\nfrom collections import Cou... | ['Wrong Answer', 'Accepted'] | ['s915396425', 's586956344'] | [32312.0, 63328.0] | [2206.0, 502.0] | [255, 364] |
p02642 | u141786930 | 2,000 | 1,048,576 | Given is a number sequence A of length N. Find the number of integers i \left(1 \leq i \leq N\right) with the following property: * For every integer j \left(1 \leq j \leq N\right) such that i \neq j , A_j does not divide A_i. | ['# D - Not Divisible\nimport numpy as np\nfrom collections import Counter\n\nN = int(input())\nA = list(int(a) for a in input().split())\nc = Counter(A)\ndbl = len([i[0] for i in c.items() if i[1] >= 2])\n\nA.sort()\nA = np.array(A)\nans = 0\nfor i in range(N):\n if A[i] == 0:\n continue\n else:\n ... | ['Wrong Answer', 'Time Limit Exceeded', 'Wrong Answer', 'Accepted'] | ['s368527457', 's711350191', 's813813147', 's086080937'] | [52936.0, 53004.0, 32232.0, 32296.0] | [2207.0, 2207.0, 464.0, 379.0] | [395, 395, 322, 320] |
p02642 | u145145077 | 2,000 | 1,048,576 | Given is a number sequence A of length N. Find the number of integers i \left(1 \leq i \leq N\right) with the following property: * For every integer j \left(1 \leq j \leq N\right) such that i \neq j , A_j does not divide A_i. | ['n=int(input())\na=list(map(int, input().split()))\na_set=set(a)\na_uni=list(a_set)\n\nkazu=[0]*(10*6+1)\nfor i in a_uni:\n for j in range(1,len(a_uni), i):\n kazu[j] += 1\n\ncount = 0\nfor i in a_uni:\n if kazu[i] == 1:\n count += 1\nprint(count)', 'n=int(input())\na=list(map(int, input().split()))\nkazu=[0]*... | ['Runtime Error', 'Accepted'] | ['s674793432', 's506399800'] | [32232.0, 32160.0] | [186.0, 913.0] | [240, 263] |
p02642 | u146597538 | 2,000 | 1,048,576 | Given is a number sequence A of length N. Find the number of integers i \left(1 \leq i \leq N\right) with the following property: * For every integer j \left(1 \leq j \leq N\right) such that i \neq j , A_j does not divide A_i. | ['n = int(input())\na = list(map(int, input().split()))\n\na_sorted = sorted(a)\ndivisible_list = [0] * 2 * 100010\n\nfor i in range(len(a)):\n \n if divisible_list[a[i]] > 2:\n continue\n for j in range(0, len(divisible_list), a[i]):\n divisible_list[j] += 1\n\nans = 0\nfor i in range(a):\n i... | ['Runtime Error', 'Accepted'] | ['s777172711', 's084912196'] | [32348.0, 32232.0] | [322.0, 527.0] | [425, 430] |
p02642 | u149991748 | 2,000 | 1,048,576 | Given is a number sequence A of length N. Find the number of integers i \left(1 \leq i \leq N\right) with the following property: * For every integer j \left(1 \leq j \leq N\right) such that i \neq j , A_j does not divide A_i. | ['n = int(input())\na = list(map(int, input().split()))\na.sort(reverse=True)\nans = 0\n#print(a)\n\nfor i in range(n-1):\n for j in range(i+1, n):\n if a[i]%a[j] == 0 and a[i]!=a[j]:\n ans += 1\n break\n\nprint(ans)', 'n = int(input())\na = list(map(int, input().split()))\na.sort()\naMa... | ['Wrong Answer', 'Accepted'] | ['s080419633', 's554027896'] | [32232.0, 32164.0] | [2206.0, 445.0] | [234, 305] |
p02642 | u151285327 | 2,000 | 1,048,576 | Given is a number sequence A of length N. Find the number of integers i \left(1 \leq i \leq N\right) with the following property: * For every integer j \left(1 \leq j \leq N\right) such that i \neq j , A_j does not divide A_i. | ['N = int(input())\nA = list(map(int, input().split()))\nn = max(A)\ndp = [True for i in range(n+1)]\np = 2\nwhile (p * p <= n): \n # If prime[p] is not changed, then it is a prime \n if (prime[p] == True): \n # Update all multiples of p \n for i in range(p * p, n+1, p): \n prime[i] = False\n p += 1\n... | ['Runtime Error', 'Accepted'] | ['s225303441', 's739265405'] | [32164.0, 43032.0] | [101.0, 432.0] | [365, 636] |
p02642 | u152614052 | 2,000 | 1,048,576 | Given is a number sequence A of length N. Find the number of integers i \left(1 \leq i \leq N\right) with the following property: * For every integer j \left(1 \leq j \leq N\right) such that i \neq j , A_j does not divide A_i. | ['n = int(input())\nli = list(map(int,input().split()))\nli2 = li[:]\nli2.sort(reverse=True)\nans = 0\n\nif len(set(li)) == 1:\n ans = 0\nelse:\n for i,num in enumerate(li2,1):\n temp = 0\n j_list = li2[i:]\n for j in j_list:\n if num % j == 0:\n break\n e... | ['Wrong Answer', 'Accepted'] | ['s160056814', 's924853805'] | [33956.0, 32128.0] | [2206.0, 489.0] | [402, 296] |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.