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
u230621983
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, *p = map(int, open(0).read().split())\nans1 = x\nwhile ans1 in p:\n ans1 += 1\nans2 = x\nwhile ans2 in p:\n ans2 -= 1\n\nprint(min(ans1,ans2))', 'x, n, *p = map(int, open(0).read().split())\nans1 = x\nwhile ans1 in p:\n ans1 += 1\nans2 = x\nwhile ans2 in p:\n ans2 -= 1\n\nif abs(ans2-x) < abs(ans1-x...
['Wrong Answer', 'Accepted']
['s661993592', 's426868996']
[9108.0, 9216.0]
[23.0, 22.0]
[146, 252]
p02641
u231570044
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 = set(list(map(int, input().split())))\nelse:\n print(X)\n exit(0)\n\ndist = 100\nr = None\nfor i in range(100, -1, -1):\n if not i in P and abs(X-i) <= dist:\n dist = abs(X-i)\n print (i, dist)\n r = i\n\nprint(r)\n', 'X, N = list(...
['Wrong Answer', 'Accepted']
['s074954092', 's119733319']
[9124.0, 9072.0]
[24.0, 28.0]
[286, 262]
p02641
u232652798
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()]\narray = [int(x) for x in input().split()]\nplus = X\nminus = X\nif N == 0:\n print(X)\n exit()\nwhile True:\n plus += 1\n minus -= 1\n print(plus)\n print(minus)\n if minus not in array:\n print(minus)\n exit()\n if plus not in array:\n ...
['Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Accepted']
['s288264428', 's424358655', 's826816108', 's446996115']
[8976.0, 9052.0, 9120.0, 9204.0]
[30.0, 28.0, 30.0, 26.0]
[337, 337, 322, 379]
p02641
u234410680
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())\n p = list(map(int, input().split()))\n ans = 9999999999\n lists = []\n if n == 0:\n print(x)\n exit()\n for i in range(-1000, 1000):\n if not i in p:\n lists.append(i)\n for i in lists:\n if ans > abs(x - i):\n a...
['Runtime Error', 'Accepted']
['s763978188', 's117175520']
[8792.0, 8936.0]
[25.0, 31.0]
[356, 290]
p02641
u235027735
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 ans = x\n\nd = float('inf')\n\nfor i in range(n+1):\n tmpx = x + 1 + n//2 - i\n if not tmpx in p:\n tmpd = abs(x -tmpx) \n if d >= tmpd:\n d = tmpd\n if ans >= tmpx:\n ans ...
['Runtime Error', 'Runtime Error', 'Runtime Error', 'Accepted']
['s307627154', 's803295371', 's965846469', 's876768921']
[9184.0, 9132.0, 9044.0, 9212.0]
[29.0, 27.0, 25.0, 26.0]
[324, 324, 322, 353]
p02641
u236536206
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()))\n res=1000\n ans=0\n for i in range(1,101):\n p.append(i)\n if len(p)==len(set(p)):\n if res>=abs(x-i):\n res=abs(x-i)\n ans=i\n...
['Wrong Answer', 'Runtime Error', 'Accepted']
['s122055081', 's879890429', 's088555178']
[9212.0, 9160.0, 9144.0]
[21.0, 21.0, 19.0]
[438, 428, 341]
p02641
u242576923
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\n\na = input()\na, b = a.split()\na = int(a)\nif int(b) == 0:\n print(a)\n exit()\nn = input()\nn = [int(i) for i in n.split()]\nli = list(range(-101, 101))\nprint(li)\nfor i in n:\n li.remove(i)\nmini = [np.inf, 0]\nfor i in li:\n if abs(i - a) == mini[0]:\n if i < mini[1]:\n mini = [a...
['Wrong Answer', 'Accepted']
['s112421309', 's689889120']
[27148.0, 27164.0]
[115.0, 100.0]
[384, 374]
p02641
u243572357
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())\nlst = [int(input()) for _ in range(n)]\na = 100\nb = ''\n\nfor i in range(1, 102):\n if i in lst:\n continue\n\n if a > abs(x-i):\n a = abs(x-i)\n b = i\n\nprint(i)", 'x, n = map(int, input().split())\nlst = [int(input()) for _ in range(n)]\na = 100\nb = 0\n\nfor i in rang...
['Runtime Error', 'Runtime Error', 'Wrong Answer', 'Wrong Answer', 'Accepted']
['s236994603', 's523354293', 's537719431', 's685362801', 's471048456']
[9172.0, 9104.0, 8952.0, 9032.0, 8832.0]
[25.0, 26.0, 31.0, 31.0, 28.0]
[196, 195, 215, 194, 215]
p02641
u244416620
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\n# x, n = 10, 5\n# p = [4, 7, 10, 6, 5]\n\n\n\npl = min(p)-1\npr = max(p)+1\nnpl = list(range(pl, pr))\nnp = list(set(npl) - set(p))\nnp.sort()\n\n\nmx = x\nres = x\nfor k in np:\n t = abs(k - x)\n if t < mx:\n...
['Runtime Error', 'Runtime Error', 'Runtime Error', 'Accepted']
['s069093803', 's457290151', 's860207974', 's676030327']
[9196.0, 9136.0, 9196.0, 9228.0]
[21.0, 19.0, 20.0, 24.0]
[470, 450, 453, 607]
p02641
u244466744
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\nmin =10000\ntemp = 0\n\nfor i in range(-1000, 1000):\n temp = abs(X - i)\n \n if temp < min and i not in p:\n min = temp\n \nprint(min)\n', 'x, N = int(input().split())\np = list(map(int, int().split()))\n\nmin =10000\ntemp = 0\n\nfor i...
['Runtime Error', 'Runtime Error', 'Runtime Error', 'Wrong Answer', 'Accepted']
['s274286112', 's510191410', 's517074086', 's665753385', 's136779225']
[8988.0, 9120.0, 9040.0, 9132.0, 9076.0]
[22.0, 25.0, 22.0, 34.0, 28.0]
[206, 198, 201, 205, 229]
p02641
u250554058
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\nx, n = map(int, input().split())\np = list(map(int, input().split()))\nlist_p = [i for i in range(-1, 102)] \nt = x\nnum = x\n\nif(x == n):\n print(x - 1)\n sys.exit()\n\nfor i in p:\n list_p[i + 1] = -2\n\nfor i in range(len(list_p)):\n if(list_p[i] == -2):\n continue\n else:\n if(abs(list_p...
['Wrong Answer', 'Runtime Error', 'Accepted']
['s615407707', 's958283183', 's282820238']
[9216.0, 9016.0, 9108.0]
[21.0, 24.0, 23.0]
[389, 496, 477]
p02641
u255943004
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 = [int(i) for i in input().split()]\nfor i in range(1,100):\n if i in P:\n pass\n else:\n if abs(X-ans) > abs(X-i):\n ans = i\nprint(ans) if N != 0 else print(X)', 'X,Y = map(int,input().split())\nP = [int(i) for i in input().split()]\ntemp1 = 1000\nans...
['Runtime Error', 'Wrong Answer', 'Accepted']
['s355957482', 's754585410', 's893375042']
[9188.0, 9120.0, 9104.0]
[24.0, 24.0, 28.0]
[218, 211, 188]
p02641
u257823704
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...
['temp1 = input().split(" ")\ntemp1 = [int(i) for i in temp1]\nx = temp1[0]\nn = temp1[1]\n\nif not n == 0:\n temp2 = input().split(" ")\n temp2 = [int(i) for i in temp2]\nelse:\n temp2 = []\n\ncounter = 1\nwhile True:\n if n == 0:\n print(x)\n break\n\n mx = x - counter\n px = x + count...
['Runtime Error', 'Accepted']
['s630869747', 's595915328']
[9152.0, 9148.0]
[25.0, 22.0]
[427, 459]
p02641
u263660661
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...
['package main\n\nimport (\n\t"fmt"\n\t"math"\n\t"sort"\n)\n\nfunc main() {\n\tvar X, N int\n\tfmt.Scanf("%d", &X)\n\tfmt.Scanf("%d", &N)\n\n\tP := make([]int, N)\n\tfor i := 0; i < N; i++ {\n\t\tfmt.Scanf("%d", &P[i])\n\t}\n\tsort.Ints(P)\n\tfmt.Println(P)\n\n\tvar a int = -1\n\tif len(P) > 0 {\n\t\tfor p := 0; p < 10...
['Runtime Error', 'Accepted']
['s288995020', 's408480769']
[8948.0, 9176.0]
[23.0, 24.0]
[554, 225]
p02641
u266795424
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()))\nif not a[1] ==0:\n b = list(map(int,input().split()))\n b2 = sorted(b)\n if abs(a[0]-b2[0]) <= abs(a[0]-b2[a[1]-1]):\n c = b2[0]-a[0]\n else:\n c = b2[a[1]-1]-a[0] \n if a[0] < b2[0]:\n print(a[0])\n elif a[0] > b2[a[1]-1]:\n print(a[0])\n else:\n for i in ran...
['Wrong Answer', 'Accepted']
['s438018003', 's001970451']
[9260.0, 9280.0]
[23.0, 24.0]
[605, 708]
p02641
u268762839
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 == 100:\n print("")\nelif n > 0:\n ps = list(map(int, input().split()))\nelse:\n print(x)\nexit()\nnums = [n for n in range(1, 101) if n not in ps]\n\nabs_plus = sorted([n-x for n in nums if n-x >= 0])\nabs_minus = sorted([-(n-x) for n in nums if n-x < 0])\nif abs_plus ...
['Wrong Answer', 'Accepted']
['s802150664', 's084669879']
[9228.0, 9224.0]
[23.0, 21.0]
[476, 452]
p02641
u271064067
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 p = []\nelse:\n print(x)\n\np_change = []\nm = 0\nfor i in p:\n p_change.append(abs(i-x))\n\nif x in p:\n for i in range(n):\n if i != 0 and p_change.count(i) != 2:\n m = i\n break\n if x-m in p...
['Runtime Error', 'Runtime Error', 'Accepted']
['s259191938', 's881678354', 's890189253']
[9208.0, 9196.0, 9212.0]
[23.0, 22.0, 24.0]
[369, 360, 425]
p02641
u275710783
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 print(X)\nelse:\n p = sorted(list(map(int, input().split())))\n ok = [i for i in range(p[0]-1, p[-1]+1) if i not in p]\n print(ok)\n ix = np.argmin(list(map(lambda a: abs(X-a), ok)))\n print(ok[ix])\n', 'import numpy as np\nX, N = ma...
['Wrong Answer', 'Accepted']
['s858981098', 's830762859']
[27016.0, 26988.0]
[116.0, 117.0]
[275, 255]
p02641
u275726913
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())\na=set(map,int(input().split()))\nprint(min([i for i in range(102) if i not in a],key=lambda y:abs(x-y)))', 'x, n = map(int, input().split())\na = set(map(int, input().split()))\nprint(min([i for i in range(102) if i not in a], key=lambda y:abs(x-y)))']
['Runtime Error', 'Accepted']
['s965897720', 's956708161']
[9068.0, 9172.0]
[22.0, 25.0]
[132, 140]
p02641
u278260569
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\n X_u = X - 1\n X_l = X + 1\n while judge:\n X_u += 1\n X_l -= 1\n if X_u not in p and X_l not in p:\n print(X_l)\n break\n elif X_u not in p:\n ...
['Runtime Error', 'Accepted']
['s917923140', 's751477926']
[9144.0, 9176.0]
[21.0, 24.0]
[552, 344]
p02641
u279266699
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\ndiff = 1000\nfor i in range(-100, 110):\n if i in p:\n continue\n if abs(i - x) < diff:\n diff = abs(i - x)\n print(diff)\n ans = i\n\nprint(ans)', 'x, n = map(int, input().split())\np = list(map(int, input().sp...
['Wrong Answer', 'Accepted']
['s267434924', 's833616355']
[9188.0, 9188.0]
[22.0, 23.0]
[240, 220]
p02641
u281733053
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...
['lst1 = input().split()\nlst2 = input().split()\n\nfirst = int(lst1[0])\nnow = 0\nplm = 1\nflag = 0\nwhile flag == 0:\n if plm == -1:\n plm = 1\n else:\n now += 1\n plm = -1\n for i in lst2:\n if first+now*plm == int(i):\n break\n flag = 1\nprint(first+now*plm)', ...
['Wrong Answer', 'Accepted']
['s337317788', 's967317466']
[9164.0, 9200.0]
[2205.0, 22.0]
[298, 289]
p02641
u282908818
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()))\ndiffer=[]\n\nif N == 0:\n print(X)\nelse:\n for i in range(0,102):\n if i not in P:\n differ.append(abs(X - i))\n else:\n differ.append(1000)\n ans = differ.index(min(differ))\n print(differ)\n pr...
['Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Accepted']
['s023315598', 's211122728', 's358705706', 's852660446']
[9188.0, 9188.0, 9056.0, 9184.0]
[19.0, 23.0, 23.0, 23.0]
[313, 321, 313, 295]
p02641
u283719735
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())\na = list(map(int, input().split()))\na.sort()\n\nnota = list()\n\nfor i in range(1, 101):\n if i in a:\n continue\n nota.append(i)\n\nprint(nota)\nnota.sort()\nans = 1000\nminabs = 1000\nfor i in nota:\n if minabs > abs(i-x):\n minabs = abs(i-x)\n ans = i...
['Wrong Answer', 'Accepted']
['s735054853', 's073956207']
[9228.0, 9228.0]
[22.0, 25.0]
[312, 305]
p02641
u284261648
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, intput().split())\n\nm = -1\nfor a in p:\n if m == -1 or (abs(a - x) < abs(m - x)) or (abs(a - x) == abs(m - x) and a < m):\n m = a\n\nprint(m)', 'x, n = map(int, input().split())\nif n > 0:\n p = set(map(int, input().split()))\n i = 0\n while True:\n if x - ...
['Runtime Error', 'Accepted']
['s146833199', 's051958621']
[9172.0, 9176.0]
[24.0, 23.0]
[187, 240]
p02641
u284262180
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())\nnum_list = list(map(int, input().split()))\ndif = 101\no_list = []\nnum_list.sort(reverse=True)\n\nif len(num_list) == 0:\n print(x)\n exit()\n\nfor i in range(1, max(num_list)):\n if i not in num_list:\n o_list.append(i)\n#\n# for num in num_list:\n# if abs(x - n...
['Wrong Answer', 'Accepted']
['s636697101', 's472369571']
[9208.0, 9216.0]
[20.0, 25.0]
[533, 486]
p02641
u285022453
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\np_all = set(range(-101, 101)) - set(p)\nprint(p_all)\n\nmi = float('inf')\nans = 0\nfor i in p_all:\n if abs(x - i) < mi:\n mi = abs(x - i)\n ans = i\n\nprint(ans)\n", "x, n = map(int, input().split())\np = list(map(int, input()...
['Wrong Answer', 'Accepted']
['s369679050', 's584569620']
[9196.0, 9116.0]
[24.0, 21.0]
[241, 240]
p02641
u286422818
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...
['d = {i: 1 for i in p}\nidx = X\nwhile True:\n if d.get(idx) is None:\n ans_plus = idx\n break\n else:\n idx += 1\n\nidx = X\nwhile True:\n if d.get(idx) is None:\n ans_minus = idx\n break\n else:\n idx -= 1\n\nif abs(X - ans_plus) < abs(X - ans_minus):\n print(...
['Runtime Error', 'Accepted']
['s533125655', 's259082873']
[9092.0, 9156.0]
[25.0, 27.0]
[402, 406]
p02641
u290014241
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()))\nfor i in range(N+1):\n if X-i not in p:\n print(X-i)\n break\n if X+i not in p:\n print(X+i)', 'X, N=list(map(int,input().split()))\np=list(map(int,input().split()))\nfor i in range(N+1):\n if X-i not in p:\n p...
['Wrong Answer', 'Accepted']
['s990506644', 's174393593']
[9180.0, 9180.0]
[28.0, 28.0]
[183, 197]
p02641
u290983503
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 = input()\nx_n_list = x_n.split()\nx = int(x_n_list[0])\nn = int(x_n_list[1])\nif n == 0:\n print(x)\nelse:\n allp = input()\n p_list = allp.split()\n p_l = [int(n) for n in p_list]\n if x not in p_l:\n print(x)\n else:\n for i in range(len(p_l)):\n if x - i in p_l:\n print(x - i - 1)\n ...
['Wrong Answer', 'Accepted']
['s756240900', 's942854991']
[9232.0, 9148.0]
[23.0, 21.0]
[401, 417]
p02641
u293215208
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 collections\nx, n = map(int,input().split())\nP = list(map(int, input().split()))\n\nPX = list(map(lambda p: p-x,P))\nCPX = collections.Counter(PX)\nans = 0\n\nfor i in range(max(max(P),x))\n if CPX[-i] == 0:\n ans = x -i\n break\n elif CPX[i] == 0:\n ans = x +i\n break\n\nprint(ans)', 'import co...
['Runtime Error', 'Runtime Error', 'Runtime Error', 'Runtime Error', 'Accepted']
['s064898889', 's195624122', 's207934301', 's890295455', 's951009666']
[8844.0, 8920.0, 8800.0, 8944.0, 9352.0]
[30.0, 28.0, 26.0, 29.0, 31.0]
[289, 329, 284, 284, 281]
p02641
u293825440
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()))\nmin = 0\ni = 0\ncount = 0\nwhile True:\n if abs(X - i) == min:\n if i not in p:\n break\n elif min != 0:\n count += 1\n i = 0\n if count == 2:\n min += 1\n cou...
['Wrong Answer', 'Wrong Answer', 'Accepted']
['s020444668', 's053072779', 's540897204']
[9192.0, 9116.0, 9188.0]
[23.0, 24.0, 26.0]
[384, 232, 277]
p02641
u299599133
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 for i in range(1,102):\n if (X-i) not in P:\n print(X-i)\n break\n elif (X+i) not in P:\n print(X+i)\n break\n else:\n print(X)\n b...
['Runtime Error', 'Accepted']
['s294659158', 's009492666']
[9052.0, 9176.0]
[26.0, 20.0]
[308, 267]
p02641
u302697704
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 plist =list(map(int,input().split()))\n maxN = max(plist)\n Anslist =[i for i in range(maxN+1)]\n print (Anslist)\n for i in range(len(plist)):\n Anslist.remove(plist[i])\n Anslist.remove(0)\n print(Anslist)\n\n ans = 0\n min=100\n for i in range(len(Anslist)):\...
['Wrong Answer', 'Runtime Error', 'Accepted']
['s003390043', 's171313756', 's430354653']
[9164.0, 9084.0, 9164.0]
[29.0, 31.0, 28.0]
[415, 444, 430]
p02641
u303039933
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 -*-\nimport sys\nimport math\nimport os\nimport itertools\nimport string\nimport heapq\nimport _collections\nfrom collections import Counter\nfrom collections import defaultdict\nfrom functools import lru_cache\nimport bisect\nimport re\nimport queue\nimport decimal\n\n\nclass Scanner():\n @sta...
['Wrong Answer', 'Accepted']
['s927469430', 's676537915']
[10728.0, 10728.0]
[36.0, 36.0]
[2891, 2891]
p02641
u303650160
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\ndef Forbidden_List(x,n,p):\n k = [abs(s - x) for s in p]\n for i in range(n):\n if i not in k: \n return 10 - i\n return 10 - n\n\nif __name__ == '__main__':\n input = sys.stdin.readline\n \n inp1 = input().rstrip().split()\n x,n = int(inp1[0]),int(inp1[1])\n if n == 0:\n ...
['Wrong Answer', 'Runtime Error', 'Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Runtime Error', 'Wrong Answer', 'Accepted']
['s129780356', 's147317797', 's292895837', 's305395184', 's378831951', 's546418773', 's615271215', 's723812319', 's878905789', 's278474117']
[9108.0, 8896.0, 9008.0, 8960.0, 9196.0, 9068.0, 9048.0, 8748.0, 9208.0, 9196.0]
[29.0, 26.0, 28.0, 27.0, 27.0, 25.0, 32.0, 23.0, 27.0, 26.0]
[433, 432, 490, 434, 523, 514, 480, 439, 442, 449]
p02641
u307622233
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\ninput = sys.stdin.readline\n\n\ndef main():\n x, n = [int(i) for i in input().split()]\n p = set([int(i) for i in input().split()])\n\n for i in range(1, 101):\n if i in p:\n continue\n\n if i <= x:\n ans = i\n elif x - ans > i - x:\n ans = i\...
['Runtime Error', 'Wrong Answer', 'Accepted']
['s360623643', 's957868659', 's417908909']
[9056.0, 9232.0, 9192.0]
[24.0, 23.0, 23.0]
[353, 495, 431]
p02641
u308918401
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 list=list(map(int,input().split()))\n i=1\n print(list)\n while i<1000:\n if not((x-i) in list):\n print(x-i)\n break\n if not((x+i) in list):\n print(x+i)\n break\n i+=1\n', 'x,n=map(int,input().split())\nif n == 0:\n pri...
['Wrong Answer', 'Wrong Answer', 'Accepted']
['s088030235', 's550912076', 's725489016']
[9180.0, 9144.0, 9208.0]
[23.0, 20.0, 24.0]
[252, 292, 297]
p02641
u313445895
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())\n\nif n==0:\n print(x)\np = list(range(n))\np = list(map(int, input().split()))\np_2 = list(range(n))\nfor i in range(n):\n p_2[i] = x-p[i]\n\nfor i in range(100):\n h = p_2.count(i)\n h_2 = p_2.count(-i)\n if h==0 and h_2!=0:\n print(x-i)\n break\n el...
['Runtime Error', 'Accepted']
['s027647576', 's470061137']
[9000.0, 9072.0]
[26.0, 29.0]
[413, 436]
p02641
u317423698
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 operator\n\nreadline = sys.stdin.buffer.readline\na, b = map(int, readline().split())\nc = set(map(int, readline().split()))\n\nL = [(i, abs(i - a)) for i in range(0, 102) if i not in c]\nL.sort(key=operator.itemgetter(1))\nprint(L)', 'import sys\nimport operator\n\nreadline = sys.stdin.buffer.read...
['Wrong Answer', 'Wrong Answer', 'Accepted']
['s668270682', 's839735236', 's640845632']
[9304.0, 9256.0, 9124.0]
[29.0, 28.0, 26.0]
[242, 242, 248]
p02641
u320763652
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())\nx,n = map(int, "100 0".split())\n# line = list(map(int, input().split()))\nline = list(map(int, "".split()))\n\nplus = x\nminus = x\n\nif not x in line:\n print(x)\n exit()\n\nwhile True:\n\n if plus <= 100:\n plus += 1\n\n if minus >= 0:\n minus -=1\n\n\n ...
['Wrong Answer', 'Accepted']
['s805827506', 's227686810']
[9188.0, 9128.0]
[20.0, 25.0]
[466, 396]
p02641
u322171361
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=input().split()\npp=input().split()\na=int(a)\nb=int(b)\np=[]\nfor pa in pp:\n p.append(int(pa))\nx=0\ny=-1\nwhile:\n if a+x not in p:\n aa=a+x\n break\n elif a+y not in p:\n aa=a+y\n break\n x+=1\n y+=-1\nprint(aa)', 'a,b=input().split()\npp=input().split()\na=int(a)\nb...
['Runtime Error', 'Accepted']
['s783954059', 's079835672']
[8972.0, 9192.0]
[23.0, 22.0]
[244, 249]
p02641
u323859575
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\np_under = list(filter(lambda v: v<x, p))\np_upper = list(filter(lambda v: v>x, p))\np_under.sort(reverse=True)\np_upper.sort()\n\ncnt = 0\nwhile(True):\n if x - cnt not in p_under:\n print(x - cnt)\n break\n if x + cnt ...
['Runtime Error', 'Accepted']
['s127294347', 's371087892']
[9140.0, 9128.0]
[23.0, 22.0]
[371, 460]
p02641
u325132311
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...
['num_input = [input() for i in range(2)]\nx = int(num_input[0].split()[0])\nn = int(num_input[0].split()[1])\n\nnum_list = [int(n) for n in num_input[1].split()]\nnum_list.sort()\n\nans=x\n\nif n!=0 and n!=1 and n!=100:\n if x in num_list:\n index=num_list.index(x)\n index_left=None\n index_rig...
['Wrong Answer', 'Runtime Error', 'Wrong Answer', 'Accepted']
['s051288474', 's684469567', 's858634779', 's002027663']
[9300.0, 9104.0, 9284.0, 9284.0]
[23.0, 20.0, 26.0, 22.0]
[1150, 1220, 1248, 1221]
p02641
u325492232
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 abc170_c_1():\n \n def solve():\n x, n = map(int, input().split(' '))\n if n == 0:\n return x\n\n p = list(map(int, input().split(' ')))\n\n search_range_min = min(min(p), x) - 1\n search_range_max = max(max(p), x) + 1\n search_values = [i for i in range(...
['Runtime Error', 'Accepted']
['s101103699', 's409227386']
[9016.0, 9196.0]
[27.0, 31.0]
[910, 577]
p02641
u328608670
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)\nelse:\n ps = list(map(int, input().split()))\n sub_abs = 0\n while True:\n if (X-sub_abs) not in ps:\n print(X-sub_abs)\n break\n if (X+sub_abs) not in ps:\n print(X+sub_abs)\n sub_abs += 1',...
['Wrong Answer', 'Accepted']
['s874678920', 's449577778']
[9180.0, 9180.0]
[22.0, 23.0]
[304, 322]
p02641
u329399746
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(i) for i in input().split(" ")]\n\nif N == 0:\n print(X)\n exit()\n\np = {int(i) for i in input().split(" ")}\n\nall_p = {i for i in range(max(p) + 1)}\nranges = all_p - p\n\nprint(ranges)\n\ndiff = 1e9\nans = 0\nfor i in ranges:\n if diff > abs(i - X):\n diff = abs(i - X)\n ans = i...
['Wrong Answer', 'Accepted']
['s609962701', 's748616780']
[9076.0, 9100.0]
[24.0, 26.0]
[312, 385]
p02641
u330912904
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 solve(x, ls):\n y = 0\n m = x\n for i in range(1, 102):\n if i in ls:\n continue\n if abs(x - i) < m:\n y = i\n m = abs(x - i)\n return y\n\n\ndef main(istr, ostr):\n x, n = list(map(int, istr.readline().strip().split()))\n ls = list(map(int, istr.r...
['Wrong Answer', 'Accepted']
['s269125033', 's665233550']
[9116.0, 9200.0]
[27.0, 27.0]
[387, 464]
p02641
u335599768
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 = list(map(int, input().split()))\ny = set(map(int, input().split()))\n\nif x[1] == 0:\n min = x[0]\nelse:\n for i in range(1, x[1]):\n if (set() == {x[0]-i}&y) and (x[0]-i >= 0):\n min = x[0]-i\n break;\n elif set() == {x[0]+i}&y:\n min = x[0]+i\n bre...
['Wrong Answer', 'Accepted']
['s187766600', 's871944330']
[9000.0, 9152.0]
[27.0, 27.0]
[310, 212]
p02641
u335950809
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...
['ans = []\nx,n = map(int,input().split())\nl = list(map(int,input().split()))\n\nl.sort()\n\nans.append(x)\n\nnl = [0] * 100\n\n\nfor i in l:\n nl[i] = i\n\nif(not (n == 0)):\n \n mx = x+1\n if(mx < 100):\n for i in range(x+1,len(nl)+1):\n if( nl[i] == 0):\n ans.append(mx)...
['Runtime Error', 'Runtime Error', 'Wrong Answer', 'Runtime Error', 'Runtime Error', 'Accepted']
['s040767451', 's162064765', 's215721608', 's259456957', 's344518486', 's875793973']
[9224.0, 9184.0, 9196.0, 9244.0, 9020.0, 9164.0]
[26.0, 23.0, 26.0, 23.0, 29.0, 29.0]
[568, 611, 262, 548, 588, 220]
p02641
u337573893
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())\n\nif N == 0:\n print(X)\n \nelse:\n P = list(map(int, input().split()))\n A = [0]\n for i in range(1, 102):\n if (i in P) == False:\n A.append(i)\n \n c = 0\n for j in range(len(A)):\n if abs(X - A[j]) < abs(X - c):\n c = A[j]\n else:\n c = c\n pr...
['Wrong Answer', 'Accepted']
['s261770186', 's402131434']
[9144.0, 9092.0]
[30.0, 29.0]
[312, 344]
p02641
u343977188
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()))\np_bar=[]\nfor i in range(0,101):\n if i not in p:\n p_bar.append(i)\n\nd_min=1000\nfor i in p_bar:\n d = abs(X-i)\n if d < d_min:\n d_min = d\nif X-d_min >= 0:\n print(X-d_min)\nelse:\n print(X+d_min)\n', 'X,N=map(int,input().split())\np=list(...
['Wrong Answer', 'Accepted']
['s221238933', 's080331816']
[9184.0, 9184.0]
[21.0, 22.0]
[261, 241]
p02641
u345577588
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 d in range(X + 1):\n for s in [-1, +1]:\n a = X + s * d\nif p.count(a) == 0:\nprint(a)\nexit(0)\n', 'X, N = map(int, input().split())\np = list(map(int, input().split()))\nfor d in range(X + 1):\nfor s in [-1, +1]:\na = X + s * d...
['Runtime Error', 'Runtime Error', 'Accepted']
['s096313497', 's122048407', 's787422456']
[8972.0, 8956.0, 9176.0]
[28.0, 28.0, 30.0]
[178, 162, 215]
p02641
u346818994
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\n\nif N == 0:\n print(X)\n\nfor i in range(102):\n if X - i not in p:\n print(x - i)\n exit()\n \n if X + i not in p:\n print(x + i)\n exit()\n', 'X, N = map(int, input().split())\np = list(map(int, input()...
['Runtime Error', 'Runtime Error', 'Accepted']
['s340616425', 's680457284', 's842770999']
[9180.0, 9180.0, 9172.0]
[25.0, 27.0, 31.0]
[240, 240, 251]
p02641
u347244019
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\n# Your code here!\n\n\nx,n = map(int, input().split())\ndef deflis(n):\n tempn=int(n)\n return tempn-x\nnum_list = list(map(deflis, input().split()))\nnum_list.sort()\ncount=0\nmaxans=0\nminans=0\nmaxflag=False\nminflag=False\nminlist=[]\nmaxlist=[]\nfor num in num_list:\n if(num<0):\n ...
['Wrong Answer', 'Accepted']
['s947425673', 's834166824']
[9196.0, 9180.0]
[24.0, 23.0]
[617, 691]
p02641
u347600233
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:\n p = {int(i) for i in input().split()}\nif n == 0:\n print(x)\nelse:\n if x not in p:\n print(x)\n else:\n flag = True\n abs_diff = 1\n while flag:\n for i in range(1, 3):\n ans = x + (-1)**i * abs_diff\n ...
['Wrong Answer', 'Accepted']
['s583609852', 's868741046']
[9208.0, 9084.0]
[24.0, 21.0]
[437, 445]
p02641
u348432940
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...
['\nX, N = map(int, input().split()) \nnum_list = list(map(int, input().split())) \nfor i in range(len(num_list)):\n num_list[i] = num_list[i]-X\nprint(num_list)\nfor i in range(101):\n if (-i in num_list) is False:\n print(X-i)\n break\n if (i in num_list) is False:\n print(X+i)\n ...
['Wrong Answer', 'Accepted']
['s226117899', 's319558305']
[9184.0, 8836.0]
[31.0, 28.0]
[331, 315]
p02641
u350093546
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())\na=list(map(int,input().split()))\nif n==0:\n print(x)\nelse:\n for i in range(1,101):\n if i not in a:\n print(i)\n break\n', 'x,n=map(int,input().split())\na=list(map(int,input().split()))\nif n==0:\n ans=x\nelse:\n ans=0\n for i in range(101):\n y=x-i\n if y not...
['Wrong Answer', 'Accepted']
['s350512126', 's529558715']
[9172.0, 9108.0]
[20.0, 22.0]
[159, 233]
p02641
u355078864
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\nx, n = [int(x) for x in stdin.readline().rstrip().split()]\nif n > 0:\n P = [int(x) for x in stdin.readline().rstrip().split()]\n\nmemos = [False] * 102\n\nfor p in P:\n memos[p] = True\n\ntgt = x\noffset = 1\nlook_down = True\nwhile True:\n\n if memos[tgt] == False:\n break\n...
['Runtime Error', 'Wrong Answer', 'Accepted']
['s290762891', 's854738411', 's937815580']
[9200.0, 9200.0, 9200.0]
[22.0, 23.0, 20.0]
[466, 553, 557]
p02641
u363599046
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())\nif b>0:\n\tp = list(map(int, input().split()))\nelse:\n\tprint(a)\n\texit()\n\nn = a\nm = a\n\nfor i in range(b):\n\tprint(n)\n\tprint(m)\n\tprint("")\n\tif n in p:\ta,b = map(int, input().split())\nif b>0:\n\tp = list(map(int, input().split()))\nelse:\n\tprint(a)\n\texit()\n\nn = a\n...
['Runtime Error', 'Wrong Answer', 'Accepted']
['s037325906', 's211687921', 's296597858']
[9020.0, 9200.0, 9116.0]
[25.0, 27.0, 24.0]
[558, 291, 282]
p02641
u364774090
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 ans = 0\n L = X\n L = X\n for _ in range(N // 2):\n L = L - 1\n H = H + 1\n if L not in P:\n print(L)\n break\n if H not in P:\n print(H)\n ...
['Runtime Error', 'Accepted']
['s987083256', 's271077530']
[9188.0, 9192.0]
[25.0, 23.0]
[328, 309]
p02641
u366424761
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()))\ni = 0\nwhile True:\n ans = x - i\n if ans in P:\n ans = x + i\n if ans in P:\n continue\n else:\n print(ans)\n break\n else:\n print(ans)\n break\n i = i + 1', 'x,n = map...
['Time Limit Exceeded', 'Accepted']
['s828842552', 's182397011']
[9192.0, 9124.0]
[2205.0, 26.0]
[290, 345]
p02641
u366974168
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()\na=input().split()\nfor i in range(n):\n if x-i not in a:\n print(x-i)\n exit()\n if x+i not in a:\n print(x+i)\n exit()', 'x,n=map(int,input().split())\nif n==0:\n print(x)\n exit()\na=list(map(int,input().split()))\nfor i in range(n+1):\n ...
['Wrong Answer', 'Accepted']
['s168314775', 's295619539']
[9120.0, 9124.0]
[32.0, 31.0]
[184, 201]
p02641
u369502636
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 = []\nfor i in range(102):\n num.append(i)\nfor j in range(n):\n num.remove(p[j])\n\na = 1000000000000\nb = 0\nfor k in range(102-n):\n if(abs(x-num[k]) < a):\n a = abs(x-num[k])\n b = num[k]\n\nprint(b)\n\nprint(num)', '...
['Wrong Answer', 'Accepted']
['s166684113', 's119521163']
[9208.0, 9220.0]
[27.0, 23.0]
[296, 284]
p02641
u371132735
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...
['# abc170_c.py\nX , N = map(int,input().split())\nP = list(map(int,input().split()))\nans = (X,0)\nfor i in range(101):\n if P.count(i)==0:\n print(abs(X-i),i,X,ans)\n if ans[0] > abs(X-i):\n ans = (abs(X-i),i)\nprint(ans[1])\n\n', '# abc170_c.py\nX , N = map(int,input().split())\nP = list(...
['Wrong Answer', 'Accepted']
['s582025088', 's231090992']
[9188.0, 9172.0]
[22.0, 26.0]
[245, 248]
p02641
u372201459
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 argparse\nimport collections\nimport logging.config\nimport sys\nimport csv\nimport numpy as np\n\ndef tester(x, y, p):\n c = []\n c.append(x)\n for i in range(y):\n c.append(int(x+(i//2+1)*(1-i%2-0.5)*-2))\n for i in range(y):\n if not(c[i] in p):\n return(c[i])\n ...
['Wrong Answer', 'Accepted']
['s981560453', 's383241597']
[28864.0, 28904.0]
[131.0, 140.0]
[562, 569]
p02641
u375616706
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\nans=float("inf")\nval=-1\nfor p in P:\n if abs(p-X)<ans:\n val=p\n ans=abs(p-X)\nprint(val)\n', "X,N = map(int,input().split())\nP = set(map(int,input().split()))\n\n\ndiff=float('inf')\nans=-1\nfor i in range(-100,110):\n if i ...
['Wrong Answer', 'Wrong Answer', 'Accepted']
['s276219662', 's360657437', 's142272863']
[9180.0, 9172.0, 9176.0]
[22.0, 21.0, 21.0]
[170, 207, 222]
p02641
u375695365
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()))\nans = 1000\njugh = 1000\nfor i in range(0, 150):\n if abs(x-i) <= jugh and i not in p:\n jugh = abs(x-i)\n ans = i\n # print(ans)\nprint(jugh)\n', 'x, n = map(int, input().split())\np = list(map(int, input().split()))\nans = 10...
['Wrong Answer', 'Wrong Answer', 'Accepted']
['s673719452', 's693637500', 's592792816']
[9100.0, 9076.0, 9140.0]
[26.0, 29.0, 28.0]
[225, 194, 223]
p02641
u376328830
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())\nlst = list(map(int,input().split()))\nans = lst[0]\n\nfor e in lst:\n if abs(e-n) < abs(e-ans):\n ans = e\n \n elif abs(e-n) == abs(e-ans):\n ans = min(e,ans)\n \n else:\n pass\n \nprint(ans)', 'x,n = map(int,input().split())\nlst = sorted(list(map(int,input().split()...
['Runtime Error', 'Accepted']
['s382991114', 's091906355']
[9160.0, 9180.0]
[28.0, 27.0]
[227, 363]
p02641
u376392666
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\n# Your code here!\na,b = map(int, input().split()) \n\nif b==0:\n #print(a)\n exit()\nnum_list = list(map(int, input().split()))\n\n \n\nnum=[True]*101\n#print(num)\n\n\nfor i in range(b):\n num[num_list[i]]=False\n\n\nnum[0]=False\nprint(num)\n\ncount=0\nmin_min=100\nmin_max=100\ni=a\n#p...
['Wrong Answer', 'Wrong Answer', 'Accepted']
['s502197621', 's717283448', 's000401768']
[9268.0, 9256.0, 9188.0]
[22.0, 21.0, 23.0]
[883, 886, 250]
p02641
u376754170
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())\n\nif n != 0:\n ps = list(map(int, input().split()))\n\n ans = 0\n sa = x\n \n for i in range(0, 102):\n if i not in ps and abs(x-i) < sa:\n ans = i\n sa = x-i\n print(ans, sa)\n \n print(ans)\n \nelse:\n print(x)', 'x...
['Wrong Answer', 'Accepted']
['s735753784', 's284388943']
[9172.0, 9192.0]
[23.0, 22.0]
[296, 269]
p02641
u378691508
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=list(map(int, input().split()))\n#i=N\n\n\t\n\t\n\n\t\n\t\n\ni=N\nj=0\nwhile True:\n\tif X-j not in p_list:\n\t\tprint(X+j)\n\t\texit()\n\telif X+j not in p_list:\n\t\tprint(X-j)\n\t\texit()\n\telse:\n\t\tj+=1\n\n', 'X, N =map(int, input().split())\np_list=list(map(int, input()...
['Wrong Answer', 'Wrong Answer', 'Runtime Error', 'Accepted']
['s242302707', 's368922786', 's606486505', 's103011748']
[9072.0, 9064.0, 9016.0, 9088.0]
[27.0, 31.0, 26.0, 28.0]
[334, 334, 199, 334]
p02641
u380187071
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 = input().split()\nX = int(X)\nN = int(N)\n\nif N == 0:\n print(X)\n exit()\n\nP = input().split()\nfor i in range(len(P)):\n P[i] = int(P[i])\n\nif X not in P:\n print(X)\n\nflag_p = True\nflag_n = True\n\nabs_num = 0\nabs_num_p = X + 1\nabs_num_n = X - 1\nwhile True:\n\n if abs_num_p in P:\n ...
['Wrong Answer', 'Wrong Answer', 'Accepted']
['s348464988', 's773537593', 's060324102']
[9240.0, 9232.0, 9232.0]
[2205.0, 23.0, 25.0]
[680, 691, 779]
p02641
u380524497
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...
["IN = iter(Input.split('\\n')).__next__\ndef input():\n return IN()\n\n###################################################\n\nx, n = map(int, input().split())\nif n == 0:\n print(x)\n exit()\nP = set(map(int, input().split()))\n\nd_min = 1000\nans = 1000\nfor num in range(-1, 102):\n if num in P:\n ...
['Runtime Error', 'Accepted']
['s298418918', 's799182985']
[8928.0, 9200.0]
[20.0, 21.0]
[399, 283]
p02641
u380669795
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 = [int(i) for i in input().split()]\nq = []\n\nif n == 0 or x not in p:\n print(x)\n sys.exit() \n\nfor i in range(1, 101-x):\n if x + i not in p:\n q.append(x + i)\n if x - i not in p:\n q.append(x - i)\n break\nprint(min(q))', 'X,N = map(int,input().spl...
['Runtime Error', 'Accepted']
['s173490629', 's123954457']
[9200.0, 9184.0]
[22.0, 19.0]
[274, 224]
p02641
u382169668
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(" "))\ndata = list(map(int, input().split(" ")))\npoint = 0\ni = -1\nwhile(1):\n if x not in data:\n print(x)\n break\n elif x+i not in data:\n print(x+i)\n break\n elif x+(-1*i) not in data:\n print(x+(-1*i))\n break\n else:\n ...
['Runtime Error', 'Runtime Error', 'Accepted']
['s353828657', 's978301882', 's628875534']
[9196.0, 8844.0, 9228.0]
[24.0, 22.0, 20.0]
[309, 294, 335]
p02641
u384576550
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 = input().split()\np = list(map(int, input().split()))\n\nans = 0\nfor i in range(1, 102):\n if abs(X - i) < abs(ans - i) and i not in p and i != X:\n ans = i\n\nprint(ans)\n', 'X, N = map(int, input().split())\np = list(map(int, input().split()))\n\nans = 0\nfor i in range(1, 102):\n if abs(X - i) ...
['Runtime Error', 'Accepted']
['s033864949', 's436437299']
[9176.0, 9156.0]
[20.0, 21.0]
[180, 178]
p02641
u387080888
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()))\nm=100\nans=0\nlis=list(range(101,-1,-1))\nfor k in lis:\n for l in range(N):\n if k==P[l]:\n lis[100-k]=0\nfor i in lis:\n if abs(i-X)<=m:\n m=abs(i-X)\n ans=i\nprint(ans)\n', 'N=int(input())\nA=list(map(int,input()....
['Wrong Answer', 'Runtime Error', 'Accepted']
['s139315999', 's900125683', 's102592196']
[9200.0, 9200.0, 9204.0]
[23.0, 22.0, 26.0]
[261, 281, 260]
p02641
u394526356
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 not n:\n print(x) \nelse:\n l = list(map(int, input().split()))\n dic = {} \n for ll in l: dic[ll] = 1\n i = 1\n while true:\n if not dic.get(x-i,0):\n print(x-i)\n break\n elif not dic.get(x+i, 0):\n print(x+i) \n break\n i+=1', 'x, n = li...
['Runtime Error', 'Runtime Error', 'Runtime Error', 'Accepted']
['s567272299', 's609257305', 's706615545', 's290859966']
[9132.0, 9064.0, 9140.0, 9196.0]
[26.0, 28.0, 24.0, 30.0]
[290, 289, 290, 290]
p02641
u394731058
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()))\nflg = false\nt = x\nwhile flg == False:\n if t in l:\n t -= 1\n else:\n ans = t\n flg = True\nflg = False\nt = x\nwhile flg == False:\n if t in l:\n t += 1\n else:\n if abs(x-ans) > abs(x-t):\n ans = t\n flg = True\nprin...
['Runtime Error', 'Accepted']
['s940095056', 's175795826']
[9204.0, 9196.0]
[24.0, 24.0]
[306, 306]
p02641
u401390528
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\nlis=[]\nfor i in range(102):\n lis.append(i)\nprint(lis)\nlistA=[]\nwhile True:\n try:\n listA.append(list(map(int,input().split())))\n except:\n break;\nprint(listA)\n \nX_=listA[0]\nX=X_[0]\nN=X_[1]\nif N!=0:\n P =listA[1]\n \n arr = np.array(lis)\n P_max = max(P)...
['Wrong Answer', 'Accepted']
['s499712868', 's083440434']
[27272.0, 27288.0]
[110.0, 108.0]
[735, 736]
p02641
u403385724
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...
['XX, N = map(int, input().split(" "))\nif N == 0:\n print(X)\n exit()\nelse:\n p = list(map(int, input().split(" ")))\n c = -1\n for i in range(100):\n if i+1 not in p:\n if abs(X-(i+1)) < abs(X-c):\n c = i+1\n else:\n print(c)\n exit()', 'X, N = map(int, input().split(" "))\nif ...
['Runtime Error', 'Accepted']
['s849820254', 's919007075']
[9192.0, 9192.0]
[27.0, 21.0]
[261, 259]
p02641
u404629709
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())\nlis=[i+1 for i in range(100)]\nflag=True\nflag2=True\nif n==0:\n flag=False\n print(x)\n\n\nif flag:\n p=list(map(int,input().split()))\n for i in p:\n lis.remove(i)\n if x>lis[-1]:\n print(lis[-1])\n flag2=False\n if flag2:\n for i in range(len(lis)):\n if lis[i]>...
['Runtime Error', 'Accepted']
['s764829451', 's322376140']
[9088.0, 9208.0]
[23.0, 22.0]
[950, 362]
p02641
u405256066
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\nX,Y = [int(x) for x in stdin.readline().rstrip().split()]\nP = [int(x) for x in stdin.readline().rstrip().split()]\ntmp = 10**9+7\nP = set(list(range(0,101))) - set(P)\nP.sort(reverse=True)\n\n\nans = 0\nfor i in P:\n if abs(i-X) <= tmp:\n ans = i\n tmp = abs(i-X)\n \npr...
['Runtime Error', 'Accepted']
['s399968490', 's105725297']
[9160.0, 9244.0]
[24.0, 22.0]
[321, 321]
p02641
u406355300
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()))\nmin = 100\npp = list(map(lambda x: x-X, p))\ni = 0\nf = 0\nwhile f == 0:\n if not i in pp:\n res = X - i\n break\n if i >= 0:\n i = -1 * (i +1)\n else:\n i = -1 * i\nprint(res)\n\n\n', 'X,N = map(int,input().split...
['Wrong Answer', 'Accepted']
['s232615360', 's669274300']
[9112.0, 9120.0]
[27.0, 24.0]
[270, 270]
p02641
u407415713
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()))\nans = 0\nxhigh=0\nxlow=0\nif n==0:\n ans = x\nelse:\n if x not in p:\n ans=x\n else:\n xhigh=x+1\n xlow=x-1\n if xhigh in p and xlow in p:\n xhigh +=1\n xlow -=1\n else:\n ...
['Wrong Answer', 'Accepted']
['s677345766', 's160410438']
[9196.0, 8880.0]
[30.0, 25.0]
[399, 402]
p02641
u408375121
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 q = [True] * 101\n for i in range(n):\n q[p[i]] = False\n d_min = 10**3\n for j in range(1, 102):\n if q[j]:\n d = abs(x - j)\n if d_min > d:\n ans = j\n print(ans)', 'x, n = map(int, i...
['Runtime Error', 'Wrong Answer', 'Accepted']
['s460709886', 's941902352', 's390510726']
[9184.0, 9196.0, 9068.0]
[21.0, 20.0, 22.0]
[283, 284, 299]
p02641
u408620326
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().strip().split()]\np = set([int(x) for x in input().strip().split()])\nans = 0\ndiff = X\nfor i in range(102):\n if i in p:\n continue\n if abs(X - i) < diff:\n ans = i\nprint(ans)', 'X, N = [int(x) for x in input().strip().split()]\np = [int(x) for x in input().strip().split()]...
['Wrong Answer', 'Wrong Answer', 'Accepted']
['s026508741', 's948983053', 's052161582']
[8936.0, 9184.0, 9064.0]
[28.0, 26.0, 33.0]
[210, 179, 232]
p02641
u410715775
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())\nlst = set(map(int,input().split()))\ndf = 0\nwhile True:\n if not (x + df) in lst: print(x + df)\n df = -df\n if not (x + df) in lst: print(x + df)\n df = -df\n df += 1', 'x, n = map(int,input().split())\nlst = set(map(int,input().split()))\ndf = 0\nwhile True:\n if ...
['Time Limit Exceeded', 'Accepted']
['s386361480', 's611659928']
[44960.0, 9100.0]
[2263.0, 29.0]
[208, 254]
p02641
u414050834
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 p2=map(lambda s:s-x,p)\na=0\ni=0\nif n==0:\n print(x)\nelse:\n while a==0:\n if i in p2:\n if i==0:\n i=-1\n elif i>0:\n i=-1*(i+1)\n else:\n i=-1*i\n else:\n print(x+i)\n a=1\n bre...
['Wrong Answer', 'Accepted']
['s827225466', 's484598964']
[9192.0, 9176.0]
[27.0, 24.0]
[301, 307]
p02641
u416258526
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 warnings\nwarnings.simplefilter('ignore')\n\nfrom numba import jit\n\nN = int(input())\nAs = list(map(int, input().split(' ')))\n\n\n@jit\ndef test(As):\n not_divisible = 0\n for num_i, Ai in enumerate(As):\n for num_j, Aj in enumerate(As):\n if num_i==num_j:\n continue\n...
['Runtime Error', 'Accepted']
['s717572894', 's818467502']
[91728.0, 27152.0]
[372.0, 104.0]
[432, 305]
p02641
u418149936
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_ls = list(map(int, input().split(' ')))\n diff, rst = -1, 0\n for i in range(101, -1, -1):\n if diff == -1:\n diff = abs(X - i)\n rst = i\n else:\n diff = min(diff, abs(X - i))\n ...
['Wrong Answer', 'Runtime Error', 'Accepted']
['s898618482', 's948871621', 's539171180']
[9132.0, 9076.0, 9132.0]
[28.0, 25.0, 30.0]
[368, 501, 422]
p02641
u424467986
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 java.util.Arrays;\nimport java.util.Scanner;\n\npublic class Main {\n\n\tpublic static void main(String[] args) {\n\t\tScanner scan = new Scanner(System.in);\n\t\tint X = scan.nextInt();\n\t\tint N = scan.nextInt();\n\t\tInteger p[] = new Integer[N];\n\t\t//int min = Math.abs(100 - X);\n\t\tint min = 100;\n ...
['Runtime Error', 'Accepted']
['s185983050', 's191425168']
[8908.0, 9172.0]
[27.0, 28.0]
[567, 305]
p02641
u433375322
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...
['s = list(map(int,input().split()))\nt = 0\nh = 0\na = s.pop(0)\nb = s.pop(0)\nprint(a)\nprint(b)\nd = 0\nfor i in range(a+1,a+2+b):\n c = 1\n for k in range(0,b):\n if i == s[k]:\n c = 0\n break\n if c==1:\n t = i\n break\nfor i in range(a-1,a-2-b,-1):\n c = 1\n for k in range(0,b):\n if i ...
['Runtime Error', 'Wrong Answer', 'Runtime Error', 'Wrong Answer', 'Accepted']
['s337701961', 's529240442', 's537895602', 's788999954', 's651444259']
[9236.0, 9188.0, 9236.0, 9160.0, 9208.0]
[24.0, 27.0, 21.0, 25.0, 27.0]
[418, 289, 489, 474, 304]
p02641
u433380437
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()))\ny=x\nz=x\nif x not in p:\n print(x)\n exit()\nfor i in range(2*len(p)):\n y-=1\n z+=1\n if y not in p:\n print(y)\n print('owari')\n exit()\n if z not in p:\n print(z)\n print('owari')\n exit()\...
['Wrong Answer', 'Accepted']
['s822478500', 's988773475']
[9092.0, 9196.0]
[28.0, 27.0]
[305, 259]
p02641
u437215432
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())\n\nif n == 0:\n p = set([])\nelse:\n p = list(map(int, input().split()))\np = list(map(int, str.split()))\na = list(set(range(201)) - set(p))\nabs_diff = [abs(i - x) for i in a]\nmin_abs_diff = min(abs_diff)\nfor i, j in zip(a, abs_diff):\n if j == min_abs_diff:\n prin...
['Runtime Error', 'Accepted']
['s627877653', 's783741363']
[8976.0, 9132.0]
[22.0, 29.0]
[325, 304]
p02641
u439757045
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()))\ndef y(x,l):\n k=1\n if x-k not in l:\n return (x-k)\n\n elif x-k not in l:\n return (x+k)\n else:\n k+=1\nprint(y(x,l))', 'x,n=map(int,input().split())\nl=list(map(int,input().split()))\ndef y(x,l):\n k=0\n while k>...
['Wrong Answer', 'Accepted']
['s320031073', 's273136649']
[9180.0, 9184.0]
[23.0, 24.0]
[205, 246]
p02641
u440608859
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 collections\nx,n=map(int,input().split())\nl=list(map(int,input().split()))\nv=collections.Counter(l)\nif n==0:\n print(x)\nelse:\n for i in range(101):\n if x not in v:\n ans=x\n break\n \n if x+1 not in v:\n ans=x+1\n break\n ...
['Runtime Error', 'Accepted']
['s227548581', 's357604224']
[9480.0, 9480.0]
[25.0, 24.0]
[391, 408]
p02641
u441246928
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 a = list(range(10000000))\n ab = 101\n an = []\n for i in range(-1.N):\n a.remove(P[i])\n a = a\n for j in range(101 - N):\n ab = min(ab,abs(X - a[j]))\n if X - ab in a :\...
['Runtime Error', 'Accepted']
['s617490792', 's051993533']
[8964.0, 404632.0]
[19.0, 1227.0]
[387, 365]
p02641
u445580781
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())\nb = list(map(int,input().split()))\nfor i in b:\n a[i] = 1\nt = 1\nans = 0\nwhile 1:\n if x-t not in b:\n ans = x - t\n break\n if x+t not in b:\n ans = x + t\n break\n t += 1\nprint(ans)', 'x , n = map(int , input().split())\nb = []\nif n!=0...
['Runtime Error', 'Accepted']
['s122618271', 's128542454']
[8968.0, 9192.0]
[25.0, 26.0]
[249, 244]