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
u449580152
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(0, 102):\n if x-i not in P or x+i not in P:\n if x-i not in P:\n print(x-i)\n exit(0)\n if x+i not in P:\n print(x+i)\n ...
['Runtime Error', 'Wrong Answer', 'Accepted']
['s369073481', 's683021832', 's525225906']
[9032.0, 27200.0, 9196.0]
[24.0, 100.0, 21.0]
[328, 188, 332]
p02641
u450288159
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 -*-\ndef main(): \n x, n = map(int, input().split())\n if n == 0:\n print(x)\n return\n p = list(map(int, input().split()))\n print(p)\n check = 0\n while(1):\n s = check//2\n if check%2 == 0:\n ans = x-s\n else:\n ans =...
['Wrong Answer', 'Accepted']
['s103941725', 's125419769']
[9188.0, 9184.0]
[26.0, 27.0]
[401, 388]
p02641
u453634575
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())) \nimport numpy as np\n\nif x not in p:\n print(x)\nelse:\n t = [i for i in range(1,101)]\n for i in range(n): \n t.remove(p[i])\n# print(t)\n\n res = 100\n s = 1000\n print(len(t))\n for i in range(len(t))...
['Wrong Answer', 'Accepted']
['s815016480', 's320345736']
[27128.0, 27136.0]
[105.0, 1613.0]
[454, 439]
p02641
u454866890
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\tprint(X)\nelif N == 1:\n\tp = [int(input())]\n print(" ")\nelse:\n p = list(map(int, input().split()))\nfor d in range(N+1):\n\tfor s in [-1, +1]:\n\t\ta = X + s * d\n\t\tif p.count(a) == 0:\n\t\t\tprint(a)\n\t\t\texit(0)\n\n', 'X,N = list(map(int, input().split()...
['Runtime Error', 'Accepted']
['s579919187', 's699970353']
[8900.0, 9144.0]
[24.0, 27.0]
[251, 250]
p02641
u459150945
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())\npn = list(map(int, input().split()))\ndiff = 100\nans = X\nif pn:\n for i in range(min(pn)+1, max(pn)):\n if i in pn:\n continue\n if abs(X-i) < diff:\n ans = i\nprint(ans)', 'X, N = map(int, input().split())\npn = list(map(int, input().split())...
['Wrong Answer', 'Accepted']
['s324906515', 's311750473']
[9180.0, 9124.0]
[22.0, 21.0]
[235, 266]
p02641
u460340021
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())\nif Y == 0:\n answer = X\nelse:\n list_1 = list(map(int, input().split()))\n\n mylist = list(range(1,101))\n\n list_2 = list(filter(lambda x: x not in list_1, mylist))\n\n import numpy as np\n\n abslist = np.abs(list_2)\n\n min_num = min(abslist)\n\n answer = X...
['Runtime Error', 'Accepted']
['s724190020', 's303203776']
[27092.0, 27168.0]
[114.0, 107.0]
[331, 520]
p02641
u465652095
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())\nLP = [list(map(int, input().split())) for i in range(N)]\n\nif N == 0:\n print(X)\n\nelse:\n for i in range(1,100):\n ans = X - i\n if ans not in LP:\n print(ans)\n break\n else:\n dans = X + i\n if dans not in LP:...
['Runtime Error', 'Runtime Error', 'Runtime Error', 'Accepted']
['s241286693', 's821787668', 's947764820', 's707791406']
[9200.0, 9136.0, 9196.0, 9112.0]
[23.0, 21.0, 26.0, 20.0]
[354, 369, 352, 299]
p02641
u473633103
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\nimport numpy as np\n\nx,n = map(int,input().split())\n\np = list(map(int,input().split()))\n\nm = np.array(list(range(-100,200)))\nm = (m-x)**2\nprint(m)\nfor i in (np.argsort(m)-101):\n if p.count(i) == 0:\n print(i)\n break\n', '# coding: utf-8\n# Your code her...
['Wrong Answer', 'Wrong Answer', 'Runtime Error', 'Wrong Answer', 'Accepted']
['s268652534', 's412092393', 's679749295', 's833075006', 's941474413']
[27276.0, 27180.0, 9172.0, 27292.0, 27216.0]
[117.0, 121.0, 24.0, 120.0, 116.0]
[266, 297, 332, 257, 258]
p02641
u475189661
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()))\nif (len(num_list) == 0) or X not in num_list:\n print(X)\nelse:\n d = 1\n while True:\n\tif X - d not in num_list:\n print(X -d)\n break\n elif X + d not in num_list:\n print(X + d)\n break\n else:\n d += 1'...
['Runtime Error', 'Accepted']
['s486640282', 's004784505']
[9012.0, 9184.0]
[25.0, 28.0]
[302, 352]
p02641
u479937725
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 = X+1\n b = X-1\n\n if X not in P:\n print(X)\n \n else:\n while a not in P:\n break\n a+=1\n while b not in P:\n break\n b-=1\n \n if abs(X-a)>abs(X-b):\n print(a)\n ...
['Wrong Answer', 'Accepted']
['s371058044', 's685089994']
[9204.0, 9196.0]
[23.0, 22.0]
[318, 319]
p02641
u481856377
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...
['y,n = map(int, input().split())\nlist = []\nlist = map(int, input().split())\nsum = 100\nans = 100\n\nfor i in list:\n if i > y:\n if i - y < sum:\n sum = i - y\n if ans > i:\n ans = i\n elif i < y:\n if y - i < sum:\n sum = y - i\n if ans...
['Wrong Answer', 'Accepted']
['s504523504', 's321708532']
[9140.0, 9052.0]
[30.0, 25.0]
[415, 203]
p02641
u487044452
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\nif n == 0:\n print(x)\nelse:\n while True:\n if not x - i in p:\n print(x-i)\n break\n elif not x + i in p:\n print(x+i)\n else:\n i += 1', 'x,n = map(int,input().split())\...
['Time Limit Exceeded', 'Runtime Error', 'Accepted']
['s297312977', 's836386135', 's020499650']
[23336.0, 9024.0, 9188.0]
[2241.0, 21.0, 21.0]
[270, 296, 297]
p02641
u490195279
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\n\ndef main(X, N, a):\n a.append(10000000000)\n a.append(-10000000000)\n a.sort()\n maxn = a[0]-1\n for i in range(len(a)-1):\n\n if a[i] >= X:\n if a[i+1]-a[i] > 1:\n if X-maxn>a[i]+1-X\n maxn = a[i]+1\n break\n ...
['Runtime Error', 'Accepted']
['s000947690', 's771682494']
[8980.0, 26992.0]
[25.0, 102.0]
[664, 669]
p02641
u490489966
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\nx, n = map(int, input().split())\np = list(map(int, input().strip().split()))\nprint(p)\nans = 0\nif n == 0:\n print(x)\nelif x not in p:\n print(x)\nelse:\n for i in range(102):\n if i not in p:\n if abs(x - i) < abs(x - ans):\n ans = i\n print(ans)\n', '# C\nx, n = map(...
['Runtime Error', 'Runtime Error', 'Runtime Error', 'Runtime Error', 'Accepted']
['s152787153', 's535841622', 's590333542', 's723012864', 's750646966']
[8980.0, 9024.0, 8952.0, 8996.0, 9180.0]
[23.0, 25.0, 24.0, 20.0, 23.0]
[283, 267, 268, 252, 281]
p02641
u491462774
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 bisect\nx, n = map(int, input().split())\npN = list(map(int, input().split()))\nplus_flag = 1\nminus_flag = 1\npN.sort()\nkey_index = bisect.bisect(pN, x) - 1\nplus_index = key_index\nminus_index = key_index\nif n == 0:\n print(x)\nelse:\n while(1):\n if minus_flag == 1:\n if pN[key_ind...
['Runtime Error', 'Runtime Error', 'Accepted']
['s429825584', 's918574305', 's630895280']
[9204.0, 9208.0, 9128.0]
[2205.0, 26.0, 28.0]
[778, 832, 315]
p02641
u491550356
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()))\n\nabs_min = int(1e5)\nans = -1\nfor i in range(0, 102):\n if abs(x - i) < abs_min:\n abs_min = abs(x - i)\n ans = i\nprint(ans)', 'x, n = map(int, input().split())\na = list(map(int, input().split()))\n\nabs_min = int(1e5)\nans = ...
['Wrong Answer', 'Accepted']
['s135939860', 's648079182']
[9180.0, 9120.0]
[28.0, 28.0]
[206, 238]
p02641
u496157893
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(input().split())\nlist = [int(x) for x in input().split()]\n\nmin_num = 150\n\nfor a in range(-10,110):\n counter = 0\n A = abs(X - a)\n for b in list:\n if a == b:\n counter = 1\n else:\n continue\n if counter == 1:\n continue\n else:\n if A ...
['Runtime Error', 'Runtime Error', 'Accepted']
['s174798857', 's527516941', 's844795649']
[9136.0, 9012.0, 9204.0]
[23.0, 23.0, 27.0]
[455, 468, 539]
p02641
u497046426
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, = map(int, input().split())\ncand = set(range(101)) - set(P)\nans, temp = None, 10**10\nfor c in cand:\n t = abs(X - c)\n if t < temp:\n temp = t; ans = min(ans, c)\nprint(ans)', 'X, N = map(int, input().split())\n*P, = map(int, input().split())\ncand = set(range(-50...
['Runtime Error', 'Accepted']
['s406146799', 's674345397']
[9196.0, 9192.0]
[23.0, 24.0]
[219, 180]
p02641
u497277272
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 forbidden_list():\n condition = input()\n num_str = input()\n \n condition_list = condition.split()\n X = int(condition_list[0])\n N = int(condition_list[1])\n \n if N == 0:\n print(X)\n return\n \n num_list_str = num_str.split()\n num_list = []\n for i in num_lis...
['Wrong Answer', 'Accepted']
['s855019498', 's856895064']
[9232.0, 9228.0]
[20.0, 25.0]
[913, 894]
p02641
u498575211
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=X\n\n\nmin= 1000\n\np.sort()\n\nfor i in range(100):\n if (i not in p ) and len(p) > 0:\n a = abs(i-X)\n if a<min:\n min=a\n ans = i\n', 'X, N=map(int, input().split())\np = list(map(int, input().split()))\nans=X\n\n\nmin= 100\n...
['Wrong Answer', 'Accepted']
['s037543420', 's973746240']
[9180.0, 9196.0]
[22.0, 22.0]
[209, 224]
p02641
u499106786
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, num = [int(i) for i in input().split(" ")]\nl = [int(i) for i in input().split(" ")]\n\nif num == 0:\n print(X)\nelse:\n for i in range(num):\n if X-i not in l:\n print(X-i):\n exit()\n elif X+i not in l:\n print(X+i)\n exit()\n print(X-num)', 'X, num = [int(i) for i in input().split("...
['Runtime Error', 'Accepted']
['s854015397', 's119145263']
[9044.0, 9188.0]
[24.0, 22.0]
[260, 263]
p02641
u500376440
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...
['#include <bits/stdc++.h>\n#define rep(i,x,n) for(int i=x; i<(int)(n); i++)\n#define rep_eq(i,x,n) for(int i=x; i<=(int)(n); i++)\nusing namespace std;\n\nint main() {\n int X,N; cin >>X >>N;\n if (N==0) {cout <<X <<endl; return 0;}\n vector<int> p(N);\n rep(i,0,N) cin >>p[i];\n sort(p.begin(),p.end());\n int an...
['Runtime Error', 'Accepted']
['s979024934', 's904023515']
[8900.0, 9188.0]
[22.0, 20.0]
[572, 217]
p02641
u503111914
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 = 100000000\nl = 1000000\nfor i in range(1,101):\n if P.count(i) == 0:\n #print(i)\n if abs(i-X) < l:\n l = abs(i-X)\n ans = min(i,ans)\n #print(ans,i,l)\nprint(ans)', 'X,N = map(int,input().split...
['Wrong Answer', 'Accepted']
['s192046872', 's096765248']
[9184.0, 9180.0]
[23.0, 25.0]
[276, 234]
p02641
u504194367
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\ntry:\n p = set(map(int, input().split()))\n num = set(range(-100,201))\n mem = []\n\n ref = sorted(list(num - p))\n\n for item in ref:\n mem.append(abs(item - X))\n \n print(ref)\n print(mem)\n print(ref[mem.index(min(mem))])\n\nexcept EOFError:\n print(X)', 'X, N = ma...
['Wrong Answer', 'Wrong Answer', 'Accepted']
['s013036235', 's382821110', 's951422960']
[9216.0, 9164.0, 9076.0]
[28.0, 30.0, 23.0]
[288, 286, 262]
p02641
u505730871
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\nx,n = [int(i) for i in input().split()]\ntable = [int(i) for i in input().split()]\ntable.sort()\nmin = min(table)\n\na = np.array(table)\na = a - x\na = np.abs(a)\na = np.sort(a)\n#print(a)\n\nfor i in range(n):\n if a[0] > 0:\n print(x)\n break\n elif a[i+1]-a[i]>1 and i>0:\n if a[i...
['Runtime Error', 'Wrong Answer', 'Accepted']
['s156740676', 's263104297', 's454318033']
[27236.0, 9164.0, 9168.0]
[106.0, 27.0, 26.0]
[602, 279, 279]
p02641
u507456172
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 numbers=list(range(102))\n ans=0\n\n for i in range(len(p)):\n numbers.remove(p[i])\n\n if numbers.count(X)==1:\n print(X)\n else:\n for j in range(100):\n if numbers.count(X-j)==1:\n ans=X-j\n ...
['Runtime Error', 'Runtime Error', 'Runtime Error', 'Accepted']
['s127580578', 's504015560', 's574746430', 's796515075']
[9000.0, 9028.0, 9028.0, 9208.0]
[25.0, 24.0, 20.0, 21.0]
[395, 396, 396, 390]
p02641
u514118270
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 math\nimport itertools\nfrom copy import copy\nfrom collections import deque,Counter\nfrom decimal import Decimal\ndef s(): return input()\ndef i(): return int(input())\ndef S(): return input().split()\ndef I(): return map(int,input().split())\ndef L(): return list(input().split())\ndef l(): return...
['Runtime Error', 'Accepted']
['s686351566', 's254261769']
[10096.0, 10080.0]
[28.0, 30.0]
[642, 681]
p02641
u515128734
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\nfor i in range(X + 1):\n for j in [-1, +1]:\n ans = X + i * j\n\n if p.count(ans) == 0:\n print(ans)\n break\n else:\n continue\n break\n', 'X, N = map(int, input().split())\np = list(map(int, inpu...
['Wrong Answer', 'Accepted']
['s342702638', 's231585126']
[9172.0, 9048.0]
[30.0, 26.0]
[245, 249]
p02641
u516494592
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())\ntry:\n p = list(map(int, input().split()))\nexcept EOFError:\n p = []\n \nint_list = [i for i in range(102)]\nforbidden_list = sorted(list(set(int_list) - set(p)))\nnum_X = int_list.index(X)\nc = 10000000\n \nif X in forbidden_list:\n print(X)\nelse:\n for i in range(len(forbidde...
['Wrong Answer', 'Accepted']
['s450910669', 's113112408']
[9272.0, 9252.0]
[24.0, 21.0]
[709, 709]
p02641
u516554284
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())\ntry:\n a=list(map(int,input().split()))\n \n \n a=sorted(a)\n\n if x<a[0]:\n print(x)\n elif x>a[-1]:\n print(x)\n else:\n bb=list(range((a[0]-1),(a[-1])))\n b=list(range((a[0]-1),(a[-1])+n))\n for n in range(n):\n b.remove(a[n])\n \n f=len(b)\n\n\n d=ab...
['Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Accepted']
['s405913566', 's617431349', 's739997475', 's929177422', 's939315697']
[9252.0, 9252.0, 9124.0, 9240.0, 9016.0]
[22.0, 25.0, 24.0, 23.0, 30.0]
[469, 489, 471, 473, 231]
p02641
u517681577
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(N):\n if not (X-i in p):\n print(X-i)\n elif not (X+i in p):\n print(X+i)', 'X, N = map(int, input().split())\np = list(map(int, input().split()))\n\nfor i in range(100):\n if X-i not in p:\n print(X...
['Wrong Answer', 'Accepted']
['s349590841', 's883594524']
[9080.0, 9176.0]
[30.0, 25.0]
[175, 202]
p02641
u519939795
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=sorted(list(map(int,input().split())))\nans=0\nfor i in range(102):\n if i not in l:\n if abs(x-i)<abs(x-ans):\n ans=i\nprint(i)', 'x,n=map(int,input().split())\nl=sorted(list(map(int,input().split())))\nans=0\nfor i in range(102):\n if abs(x-i)<abs(x-ans) and i...
['Wrong Answer', 'Accepted']
['s114885614', 's272730776']
[9168.0, 9108.0]
[27.0, 29.0]
[174, 164]
p02641
u521271655
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()))\ndic = {}\nlis = []\nfor i in range(0,102):\n if i not in p:\n dic[i] = abs(x-i)\n lis.append(i)\nprint(lis)\n\nmini = min(dic.values())\nfor j in lis:\n if mini == dic[j]:\n print(j)\n break', 'x,n = map(int,input()....
['Wrong Answer', 'Accepted']
['s091819422', 's127594379']
[9004.0, 9180.0]
[32.0, 26.0]
[278, 267]
p02641
u521866787
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 bisect\n\nx ,n=map(int,input().split())\np=list(map(int,input().split()))\n\np.sort()\n\nindex = bisect.bisect_left(p,x)\n\nif n==0:\n print(x)\nelse:\n for i in range(n):\n print(index-i, index+i)\n if p[index-i] != x-i:\n print(x-i)\n break\n elif p[index+i] !...
['Runtime Error', 'Accepted']
['s607845994', 's673774561']
[9084.0, 9204.0]
[23.0, 23.0]
[348, 417]
p02641
u522937309
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...
['\nimport copy\nn = int(input())\nlist_a = list(map(int, input().split())) \n\nlist_a = list(set(list_a))\nlist_a.sort(reverse=True)\n# print(list_a)\n\ncount = 0\nif len(list_a) == 1:\n print(0)\nelse:\n for i in range(len(list_a)):\n ai = list_a[i] \n new_list = list_a[i+1:] \n# print(n...
['Runtime Error', 'Accepted']
['s001883826', 's435101506']
[9284.0, 9168.0]
[25.0, 29.0]
[659, 351]
p02641
u524534026
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()))\ntmp=0\nif n==0:\n print(x)\n sys.exit()\nfor i in range(1,101):\n ans=x-i\n if not ans in p:\n print(ans)\n sys.exit()\n ', 'import sys\nimport numpy as np\n\nX,n=map(int,input().split())\np=list(map(int,input().s...
['Wrong Answer', 'Accepted']
['s195805954', 's836105732']
[9176.0, 27180.0]
[23.0, 106.0]
[214, 358]
p02641
u528484796
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,x=map(int,input().split())\nl=list(map(int,input().split()))\np=0\nif x==0:\n print(n)\nelif n not in l:\n print(n)\nelse:\n for i in range(101):\n if abs(x-i)>abs(x-p) and i not in p:\n p=i\n print(p)', 'x,n=map(int,input().split())\nl=list(map(int,input().split()))\np=0\nif n==0:\n print(x)\nelif x n...
['Runtime Error', 'Wrong Answer', 'Accepted']
['s085449669', 's692754308', 's884958551']
[9212.0, 9192.0, 9184.0]
[22.0, 25.0, 21.0]
[204, 214, 277]
p02641
u529706830
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(list,int(input.split()))\ndirection = -1\ni = 0\nwhile True:\n dist = i * direction\n\n if not (dist + X in P):\n print(dist + X)\n break\n i += 1\n if direction < 0: direction = 1\n else : direction = -1', 'X,N = map(int, input().split())\nif N > ...
['Runtime Error', 'Accepted']
['s349726048', 's379708160']
[8816.0, 9136.0]
[27.0, 26.0]
[262, 450]
p02641
u532141811
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())\nif N == 0:\n print(X)\n sys.exit()\np = list(map(int, input().split()))\n\ncomp = 101\n\nfor i in range(1, 101):\n x = abs(X - i)\n if x == comp:\n sys.exit()\n if comp > x and i not in p and:\n comp = x\n result = i\n\nprint(result)'...
['Runtime Error', 'Runtime Error', 'Accepted']
['s648944466', 's904938011', 's130556628']
[8984.0, 9048.0, 9156.0]
[19.0, 24.0, 25.0]
[299, 294, 256]
p02641
u532955973
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...
['#!/usr/bin/env python3\n# atcoder \n\n\nimport sys\n\niimr = lambda: map(int, sys.stdin.readline().rstrip().split())\nreadline = sys.stdin.readline\nsys.setrecursionlimit(10 ** 8)\n\n\ndef 関数(x, n, p_liste):\n if n == 0:\n return x\n \n if x not in p_liste:\n return x\n chikai = x-1\n plu...
['Runtime Error', 'Runtime Error', 'Accepted']
['s385229547', 's815424390', 's888598985']
[9276.0, 9288.0, 9280.0]
[29.0, 27.0, 29.0]
[854, 854, 854]
p02641
u533084327
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 collections import deque\n\nX, N = map(int, input().split())\np = list(map(int, input().split()))\nans = X\nqueue = deque()\nqueue.append(X)\ndone_list = []\nans = []\nwhile queue:\n print(queue)\n var = queue.popleft()\n if var in p:\n done_list.append(var)\n if var - 1 not in done_list:\...
['Wrong Answer', 'Accepted']
['s678810345', 's058665535']
[9444.0, 9464.0]
[27.0, 24.0]
[474, 457]
p02641
u534610124
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())\nlistp = list(set(map(int, input().split())))\n\n\ndef f(X, N, listp):\n\n if N == 0:\n return X\n if X not in listp:\n return X\n\n up_list = []\n down_list = []\n for p in listp:\n if p > X:\n up_list.append(p)\n if p < X:\n ...
['Wrong Answer', 'Wrong Answer', 'Accepted']
['s521808192', 's981588002', 's701977550']
[9248.0, 9244.0, 9248.0]
[23.0, 23.0, 24.0]
[892, 887, 786]
p02641
u536642030
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 p = list(map(int, input().split()))\n hoge = [i for i in range(x - n, x + n + 1)]', 'x,n = list(map(int, input().split()))\nif n == 0:\n print(x)\nelse:\n p = list(map(int, input().split()))\n hoge = [i for i in range(x - n, x + n + 1)]...
['Wrong Answer', 'Accepted']
['s400964847', 's909403126']
[9032.0, 9168.0]
[29.0, 29.0]
[149, 364]
p02641
u538909258
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.sort()\n\ndef main():\n if len(p) == 0:\n print(x)\n return\n\n ans_l = list(range(x-10, x+10))\n print(ans_l)\n\n diff_l = list(set(p) ^ set(ans_l))\n print(diff_l)\n\n cnt = 100\n ans = 100\n for i in rang...
['Wrong Answer', 'Accepted']
['s060565616', 's064566583']
[9072.0, 9184.0]
[23.0, 21.0]
[485, 430]
p02641
u540698208
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 = (int(x) for x in input().split())\nif N != 0:\n p = [int(x) for x in input().split()]\nelse:\n print(X)\n sys.exit()\n\nans = X\nfor i in range(0, 101, -1):\n if X + i not in p:\n ans = X + i\n if X - i not in p:\n ans = X - i\nprint(ans)', 'import sys\n\nX, N = (int(x) for...
['Wrong Answer', 'Runtime Error', 'Accepted']
['s039435192', 's403617962', 's945711675']
[9196.0, 9112.0, 9148.0]
[22.0, 2206.0, 28.0]
[267, 317, 380]
p02641
u542541293
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...
['try:\n p = list(map(int, input().split()))\nexcept:\n p = []\n\n\nl = [0]*100\n\nfor i in range(N):\n l[abs(p[i] - X)] += 1\n\n#print(p.index(9))\nif N == 0:\n print(X)\nelse:\n for i in range(N):\n if i == 0:\n if l[0] == 1:\n continue\n else:\n print(X)\n break\n else:\n ...
['Runtime Error', 'Accepted']
['s544023027', 's315561252']
[9196.0, 9164.0]
[25.0, 23.0]
[484, 520]
p02641
u542739769
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())\n\nif N == 0:\n print(X)\n sys.exit()\n\narr = list(map(int, input().split()))\nmainasu = X \npurasu = X \n\ndef saiki():\n mainasu = mainasu - 1\n purasu = purasu + 1\n if X in arr:\n if mainasu in arr:\n if purasu in arr:\n saiki()\n else:\n ...
['Runtime Error', 'Runtime Error', 'Runtime Error', 'Accepted']
['s267837054', 's518131912', 's576920105', 's589955744']
[9192.0, 9664.0, 9664.0, 9212.0]
[22.0, 26.0, 23.0, 23.0]
[429, 393, 410, 461]
p02641
u543954314
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)))\n', 'x, n = map(int, input().split())\na = set(map(int, input().split()))\nprint(min(abs(i-x) for i in range(102) if i not in a))', 'x, n = map(int, input().split())\na = set(ma...
['Runtime Error', 'Wrong Answer', 'Accepted']
['s058736800', 's574811382', 's395410616']
[9036.0, 9164.0, 9132.0]
[24.0, 25.0, 22.0]
[139, 122, 141]
p02641
u546236742
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 = input().split()\nif a[1] == "0":\n print(a[0])\nelse:\n number_list = input().split()\n n = 1\n number = int(a[0])\n while True:\n num = number + n\n num2 = number - n\n if str(num) not in number_list or str(num2) not in number_list:\n if str(num) in number_list:\n print(num2)\n els...
['Runtime Error', 'Accepted']
['s936982531', 's371291546']
[9192.0, 9208.0]
[24.0, 21.0]
[355, 454]
p02641
u548589319
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 a[1] == 0:\n print(a[0])\nelse:\n b = list(map(int, input().split()))\n ans = 1\n out = 0\n res = abs(a[0] - ans)\n while (ans <= max(b) or abs(a[0] - ans) != res):\n if ans not in b:\n if (abs(a[0] - ans) < res):\n res = abs(a...
['Wrong Answer', 'Accepted']
['s134347739', 's715094477']
[9136.0, 9240.0]
[2205.0, 22.0]
[436, 342]
p02641
u550146922
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\nans = []\nflag = 0\nwhile True:\n if (x + i) not in p:\n ans += [x+i]\n print(ans)\n flag = 1\n if (x - i) not in p:\n ans += [x-i]\n print(ans)\n flag = 1\n if flag == 0:\n i += 1\n...
['Wrong Answer', 'Accepted']
['s158589176', 's885114483']
[9116.0, 9124.0]
[24.0, 23.0]
[361, 304]
p02641
u551906883
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 math\ninput_a= input().split(" ")\nX=int(input_a[0])\nN=int(input_a[1])\ndis=X+3\nif N!=0:\n array= input().split(" ")\nelse:\n array=[0,0]\n\nnum=X\nnum2=-100\nfor i in range(101-X):\n\n \n if str(num) not in array:\n dis=abs(X-num)\n num2=X-dis\n num1=num\n if str(num2) not in array:\n \tn...
['Runtime Error', 'Runtime Error', 'Accepted']
['s330346970', 's379152190', 's449433388']
[9208.0, 9264.0, 9172.0]
[23.0, 20.0, 24.0]
[709, 656, 665]
p02641
u552143188
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(p) for p in input().split()]\nA = X\nB = X\n\nwhile True:\n if B in P:\n B += 1\n else:\n break\n\nwhile True:\n if A in P:\n A -= 1\n else:\n break\n\n\nprint(min(A, B))', 'X, N = map(int, input().split())\nP = [int(p) for p in input().split()]\nA = X\nB = X...
['Wrong Answer', 'Accepted']
['s181311866', 's357545817']
[9180.0, 9192.0]
[20.0, 22.0]
[211, 293]
p02641
u554237650
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...
['str1 = input()\nstr2 = input()\n\nA = str1.split(" ")\nB = str2\n\nres = 0\n#print(A[1])\nif A[1] == "0":\n res = A[0]\nelse:\n# print("A[1]!=0")\n B = B.split(" ")\n intB = []\n for i in B:\n intB.append(int(i))\n intB.sort(reverse=True)\n\n X = int(A[0])\n N = int(A[1])\n\n res = 0...
['Wrong Answer', 'Accepted']
['s164337408', 's621563935']
[9096.0, 9244.0]
[24.0, 22.0]
[716, 717]
p02641
u555587832
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\n\nx,n = map(int,input().split())\np = list(map(int,input().split()))\n\na = numpy.abs(list(map(lambda z: z-x,p))).tolist()\nprint(a)\n\nif n==0 or 0 not in a:\n print(x)\nelse:\n for i in range(1,n,1):\n if a.count(i) == 2:\n continue\n elif a.count(i) == 1:\n i...
['Wrong Answer', 'Accepted']
['s226822031', 's899103858']
[27080.0, 27136.0]
[119.0, 116.0]
[400, 497]
p02641
u556326496
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 ps = list(map(int, input().split()))\ncounters = [0 for _ in range(len(ps))]\ncounters[0] = 1\n\nfor i,p in enumerate(ps):\n distance = abs(x - p)\n if distance < len(ps):\n counters[distance] += 1\n\nprint(counters)\nfor i,counter in e...
['Wrong Answer', 'Accepted']
['s656062896', 's231905333']
[9216.0, 9224.0]
[23.0, 23.0]
[459, 445]
p02641
u559250296
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\n p.sort()\n gap = 10**1000\n ans =10**1000\n for i in p:\n if gap > abs(i-x) :\n ans = i\n gap =abs(i-x)\n\n\n\n print(ans)\nelse:\n print(x)', 'x, n = map(int,input().split())\nif n >0:...
['Wrong Answer', 'Accepted']
['s677883950', 's006926911']
[9184.0, 9192.0]
[24.0, 24.0]
[257, 311]
p02641
u559367141
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())\nd = list(map(int, input().split()))\n\nfor n in range(X + 1):\n for m in [-1, 1]:\n l = X + n*m\n if d.count(l) == 0:\n print(l)\n break ', 'X, N = map(int, input().split())\nk = list(map(int, input().split()))\nfor d in range(X + 1):\n for s ...
['Wrong Answer', 'Accepted']
['s885232157', 's879335656']
[9084.0, 9060.0]
[27.0, 29.0]
[202, 200]
p02641
u562015767
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 l = list(map(int,input().split()))\nelse:\n print(x)\n exit()\n\nif x not in l:\n print(x)\n exit()\n\ntmp = []\nfor i in range(x-50,x+50):\n tmp.append(i)\n\nans = []\nfor j in tmp:\n if j not in l:\n ans.append(j)\n\ntmp1 = 1\nfor k in ans:\n ...
['Runtime Error', 'Accepted']
['s333263826', 's324262510']
[9228.0, 9228.0]
[22.0, 24.0]
[482, 504]
p02641
u563453679
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()\n\nif x == 1:\n print(0):\n sys.exit()\n\n\nif n == 100:\n if x <= 50:\n print(0)\n sys.exit()\n else:\n print(101)\n sys.exit()\n\n\nnun_list = list(map(int, input().split()))\nanswer = 0\n\...
['Runtime Error', 'Wrong Answer', 'Wrong Answer', 'Accepted']
['s076655086', 's510954448', 's982765950', 's043412131']
[8996.0, 9236.0, 9156.0, 9204.0]
[24.0, 23.0, 25.0, 20.0]
[647, 644, 588, 646]
p02641
u563711100
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 = input().split()\nn = [int(i) for i in n]\nm = input().split()\nm = [int(i) for i in m]\n \nans_1 = n[0]\nans_2 = n[0]\n \nans = []\nwhile True:\n \tif n[1] == 0:\n ans.append(0)\n \n ans_1 += 1\n ans_2 -= 1\n if not ans_1 in m:\n ans.append(ans_1)\n \n elif not ans_2 in m:\n ...
['Runtime Error', 'Runtime Error', 'Accepted']
['s105863121', 's472819965', 's484851540']
[8972.0, 8916.0, 9216.0]
[26.0, 25.0, 27.0]
[386, 385, 470]
p02641
u565751569
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 a=list(map(int,input().split()))\nelse:\n a=[]\nif not x in a:\n print(x)\nelse:\n a.sort()\n i=a.index(x)-1\n j=i+2\n d=1\n ans=0\n while(True):\n if(a[i]!=x-d):\n ans=a[i]\n break\n else:\n i-=1\n ...
['Runtime Error', 'Runtime Error', 'Accepted']
['s201935514', 's467377796', 's258694076']
[9212.0, 9224.0, 9224.0]
[25.0, 24.0, 22.0]
[416, 386, 462]
p02641
u566574814
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\narr = []\nincc = []\nfor i in range(101):\n for j in range(n):\n incc.append(p[j])\n if i in incc:\n continue\n else:\n arr.append(i)\narr.pop(0)\n# print(arr)\n \nfor i in range(1,len(arr)):\n if n == 0:\n ...
['Wrong Answer', 'Accepted']
['s080734201', 's790610465']
[9220.0, 9188.0]
[23.0, 22.0]
[552, 805]
p02641
u569117803
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\n p = list(map(int, input().split(" ")))\n\n p_ = [abs(x - n) for n in p]\n\n m_p_ = p_.index(min(p_))\n\n start = p[m_p_]\n\n for v in range(100):\n a = start - v - 1\n if a not in p:\n ans = a\n b = start + v + 1\...
['Runtime Error', 'Accepted']
['s842561019', 's352607166']
[9184.0, 9100.0]
[25.0, 22.0]
[438, 654]
p02641
u569776981
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\ny = []\nz = []\nfor i in range(n):\n if x - n[i] >= 0:\n y.append(x - n[i])\n else:\n z.append(n[i] - x)\n\n\n\ny = sorted(y)\nz = sorted(z)\n\nif y[0] == z[0]:\n print(y[0])\nelif y[0] > z[0]:\n print(z[0])\nelse:\n p...
['Runtime Error', 'Runtime Error', 'Accepted']
['s037417287', 's529428970', 's841312160']
[9200.0, 9196.0, 8920.0]
[21.0, 28.0, 31.0]
[307, 307, 276]
p02641
u570155187
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 exit()\n\np = map(int,input().split())\n\nx1,x2 = x,x\nfor i in range(1000):\n x1 -= 1\n x2 += 1\n if x1 not in p:\n print(x1)\n exit()\n if x2 not in p:\n print(x2)\n exit()', 'x,n = map(int,input().split())\n\nif n == 0:\n print(x)\n exit...
['Wrong Answer', 'Wrong Answer', 'Accepted']
['s719085997', 's836168913', 's695994635']
[9132.0, 9128.0, 9124.0]
[31.0, 27.0, 28.0]
[233, 233, 274]
p02641
u571281863
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=[i-X for i in p]\n qs=set(q)\n print(q)\n\n for i in range(N):\n if -i not in qs:\n print(X-i)\n break\n elif i not in qs:\n print(X+i)\n break', 'X,N=map(int,input().split())\nif N==0:\n p...
['Wrong Answer', 'Accepted']
['s032296227', 's552957142']
[9188.0, 9112.0]
[21.0, 25.0]
[256, 213]
p02641
u572122511
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\nmin_ = 100\nfor i in range(0, 102):\n print(i)\n cur = i \n if cur in P:\n continue\n diff = abs(X - cur)\n if diff < min_:\n min_ = diff\n\nfront = X - min_\nback = X + min_\nif front not in P:\n print(fron...
['Wrong Answer', 'Accepted']
['s911578402', 's823728634']
[8996.0, 9140.0]
[22.0, 20.0]
[326, 313]
p02641
u573332356
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())\nif(N != 0):\n p = set(list(map(int, input().split())))\nelse:\n print(X)\n exit()\n\nresult = []\n\nfor i in range(max(p)):\n result.append(i)\n\nans = set(result)-p\nans1 = 1000000000000\n\nprint(ans)\n\nfor count, i in enumerate(ans):\n if (ans1 > abs(i-X)):\n ...
['Wrong Answer', 'Accepted']
['s363434534', 's008386014']
[9212.0, 9196.0]
[20.0, 22.0]
[394, 344]
p02641
u580273604
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 bisect\nX, N=map(int, input().split())\nif N==0:print(X);exit()\np=sorted(list(map(int, input().split())))\n#print(p)\nm=min(p)-1\nM=max(p)+1\n\n# p.append(i)\n\nm=X;i=0\nfor i in range(m,min(p)-2,-1):\n if i not in p:break\nM=X;j=0\nfor j in range(M,max(p)+2):\n if j not in p:break\n\nprint(min(i,j))\n', '...
['Wrong Answer', 'Accepted']
['s065431890', 's238489501']
[9128.0, 9216.0]
[27.0, 27.0]
[331, 303]
p02641
u581022379
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())\nline = list(map(int, input().split()))\nnotLine = [i for i in range(-100, 201) if i not in line]\nleft = -1\nright = len(notLine)\nwhile abs(right - left) > 1:\n middle = (right + left) // 2\n if notLine[middle] >= X:\n right = middle\n else:\n left = middle\np...
['Wrong Answer', 'Accepted']
['s455002344', 's373119974']
[9204.0, 9148.0]
[24.0, 28.0]
[444, 445]
p02641
u581603131
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()\n\np = list(map(int, input().split()))\npp = set(p)\nnumlist = [i for i in range(-1000, 1000)]\nnumlistt = set(numlist)\nnewlist = numlistt - pp\nnewlistt = list(newlist)\nabsn = 1000\nans = 1000\n \nfor i in newlistt:\n if absn > abs(X-i):\n ...
['Wrong Answer', 'Accepted']
['s510830492', 's544166075']
[9384.0, 9268.0]
[22.0, 24.0]
[446, 430]
p02641
u583507988
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 ans = []\n\n for i in range(n-2):\n if x-i not in p:\n ans.append(-i)\n break\n elif x+i not in p:\n ans.append(i)\n break\n else:\n ans.append(-3)\n print(x+ans[0])', 'x, n = ...
['Runtime Error', 'Accepted']
['s920329106', 's731738408']
[9200.0, 9128.0]
[22.0, 27.0]
[291, 263]
p02641
u591182368
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\ninput = sys.stdin.readline\n\ndef main():\n x, n = map(int, input().rstrip().split())\n if n == 0:\n print(x)\n sys.exit()\n else:\n p = list(map(int, input().rstrip().split()))\n\tif x > max(p):\n print(x)\n sys.exit()\n else:\n p_x = set(range(max(p)+1))\n p_temp = s...
['Runtime Error', 'Runtime Error', 'Accepted']
['s618983645', 's867728244', 's456826225']
[9036.0, 9192.0, 9236.0]
[23.0, 21.0, 22.0]
[540, 636, 652]
p02641
u591287669
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 collections import defaultdict\n\nx,n = map(int,input().split())\nif n==0:\n print(x)\nelse:\n dd = defaultdict(int)\n arr = list(map(int,input().split()))\n for i in range(len(arr)):\n dd[x-arr[i]]+=1\n \n print(dd)\n\n for i in range(101):\n if dd[i]==0:\n print(x-...
['Wrong Answer', 'Accepted']
['s116481741', 's906046090']
[9408.0, 9340.0]
[32.0, 32.0]
[391, 372]
p02641
u595833382
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\nif N != 0:\n if X in p:\n sorted_p = sorted(p)\n\n x = p.index(X)\n \n def checknum(d,loweridx,upperidx):\n upper = sorted_p[upperidx]\n lower = sorted_p[loweridx]\n if...
['Wrong Answer', 'Runtime Error', 'Runtime Error', 'Wrong Answer', 'Accepted']
['s463135136', 's524611553', 's587778649', 's743796588', 's022036022']
[9220.0, 9276.0, 9012.0, 9244.0, 9192.0]
[29.0, 25.0, 27.0, 29.0, 29.0]
[1337, 1129, 1084, 1007, 1014]
p02641
u597455618
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(100):\n if x + i not in p:\n print(x+i)\n elif x - i not in p:\n print(x-i)', 'x, n = map(int, input().split())\np = list(map(int, input().split()))\nfor i in range(n+1):\n c = 10**5\n t = 10**5\n y = 0\...
['Wrong Answer', 'Accepted']
['s558734448', 's895634282']
[9172.0, 9196.0]
[25.0, 24.0]
[175, 284]
p02641
u600261652
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 resolve():\n X, N = map(int, input().split())\n P = []\n for i in range(N):\n p = int(input())\n P.append(p)\n plus = 1\n while True:\n if X in P:\n if plus%2 == 1:\n X -= plus\n plus +=1\n else:\n X += plus\n ...
['Runtime Error', 'Runtime Error', 'Wrong Answer', 'Runtime Error', 'Accepted']
['s270811171', 's322458244', 's411585117', 's992287793', 's779425696']
[9132.0, 9184.0, 9144.0, 9192.0, 9212.0]
[22.0, 20.0, 24.0, 23.0, 23.0]
[391, 407, 511, 358, 554]
p02641
u602677143
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()))\np1 = [i for i in range(0,101)]\nfor i in p:\n if i in p1:\n p1.remove(i)\nans = 1000\n\nfor i in p1:\n if ans >= abs(i-x):\n ans = min(abs(i-x),ans)\n al.append(i)\n\nif len(al) == 0:\n if x < 50:\n print(0)\n ...
['Runtime Error', 'Accepted']
['s537991317', 's793061790']
[9216.0, 9108.0]
[25.0, 22.0]
[405, 468]
p02641
u602773379
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...
['\ndef input2():\n\treturn map(int,input().split())\nx,n=input2()\np=sorted(input_array())\nq=[0]*102\nresult=[10000,-1]\nfor i in range(n):\n\tq[p[i]]=1\nfor i in range(102):\n\tif q[i]==0:\n\t\tnum=abs(i-x)\n\t\tif num<result[0]:\n\t\t\tresult=[num,i]\nprint(result[1])', '\ndef input2():\n\treturn map(int,input().sp...
['Runtime Error', 'Accepted']
['s018778014', 's867130634']
[9060.0, 9200.0]
[25.0, 31.0]
[269, 371]
p02641
u605151360
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\nimport math\n\nX, N = map(int, input().split())\n\nif N==0:\n p = []\nelse:\n p = list(map(int, input().split()))\n\np = sorted(p)\n\nif X not in p:\n print(X)\nelse:\n ind = p.index(X)\n pre = p[:ind]\n pre = pre[::-1]\n pre += [100] * 100\n ans_p = math.inf\n fo...
['Wrong Answer', 'Accepted']
['s269250600', 's005049581']
[9232.0, 9160.0]
[23.0, 22.0]
[597, 286]
p02641
u605161376
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()))\nsortP = sorted(P)\nif N==0:\n print(X)\nelif sortP[0]>X:\n print(sortP[0]-1)\nelif sortP[N-1]<X:\n print(sortP[N-1]+1)\nelse:\n for n in range(sortP[0],sortP[N-1]+2):\n if n in sortP:\n continue\n if n ==X:\n ...
['Runtime Error', 'Accepted']
['s176566532', 's064859640']
[9156.0, 9212.0]
[23.0, 25.0]
[490, 490]
p02641
u607180061
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\n\ndef getNearestValue(li, num):\n idx = np.abs(np.array(li) - num).argmin()\n return li[idx]\n\n\nx, n = map(int, input().split())\np = list(map(int, input().split()))\n\n\nans = 0\nprint(p)\ni = 0\nwhile True:\n mi = getNearestValue(p, x - i)\n ma = getNearestValue(p, x + i)\n if...
['Runtime Error', 'Accepted']
['s304217629', 's644881428']
[27212.0, 9176.0]
[109.0, 24.0]
[366, 239]
p02641
u608007704
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())\np=np.array(list(map(int,input().split())))\nans=np.array([X,X])\nwhile True:\n for x in ans:\n if x not in p:\n print(x)\n exit()\n ans+=[-1,1]\n \n', 'import numpy as np\nX,N=map(int,input().split())\np=np.array(list(map(int,input().split())))\nans=np.arr...
['Runtime Error', 'Accepted']
['s309295740', 's960726510']
[8800.0, 27340.0]
[25.0, 119.0]
[199, 205]
p02641
u608080019
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\np = list(map(int, input().split))\n\nabs_val_dict = {}\n\nif N == 0:\n print (X)\n\nfor i in range (X-N, X+N):\n if i not in p:\n abs_val_dict[i] = abs(i-X)\n \nprint(max(abs_val_dict, key = abs_val_dict.get()))', 'import operator\n\nX, N = map(int, input().split())...
['Runtime Error', 'Accepted']
['s988816735', 's281172787']
[9104.0, 9096.0]
[19.0, 24.0]
[250, 305]
p02641
u608178601
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())\nans=0\nflag=0\nif N!=0:\n\n\tP=sorted(list(map(int, input().split())))\n\tpabs=[]\n\tfor p in P:\n\t\tpabs.append(abs(X-p))\n\t\n\tpabs.sort()\n\t\n\t\n\tcnt=0\n\ttemp=0\n\t\n\tprint(pabs)\n\tif 0 in pabs:\n\t\tfor i in range(1,max(pabs)+1):\n\t\t\tif i in pabs:\n\t\t\t\t\n\t\t\t\tif pa...
['Wrong Answer', 'Accepted']
['s343950432', 's292925574']
[9180.0, 9232.0]
[21.0, 23.0]
[567, 535]
p02641
u609176437
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=int(input())\nli = list(map(int,input().split()))\ncount=0\n\nfor i in range(100):\n for j in range(n):\n if i == j:pass\n elif li[i]%li[j] == 0:break\n elif j == n-1:count +=1\n\nprint(count)', 'x,n = map(int,input().split())\nif n == 0:print(x)\nelse:\n li = list(map(int,input().split()))\n\n for i in...
['Runtime Error', 'Accepted']
['s779218463', 's849862653']
[9188.0, 9224.0]
[21.0, 21.0]
[194, 385]
p02641
u613350811
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 len(p) == 0:\n print(X)\n exit()\n\nif not X in p:\n print(X)\n exit()\n\nsmall = [i for i in range(-101, X)]\nbig = [i for i in range(X+1, 102)]\nsmall.reverse()\nprint(small)\nprint(big)\nprint(max(len(big),len(small)))\nfor i i...
['Wrong Answer', 'Runtime Error', 'Accepted']
['s261480364', 's365199562', 's337487536']
[9232.0, 9236.0, 9220.0]
[21.0, 21.0, 22.0]
[463, 461, 407]
p02641
u618251217
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\nP.sort(reverse=True)\nP += [-1000]\np_idx = 0\nmin_difference = 101\nans = 101\nfor num in range(101, -2, -1):\n if num == P[p_idx]:\n p_idx += 1\n else:\n if abs(X - num) <= min_differenc...
['Wrong Answer', 'Accepted']
['s828622408', 's163792223']
[9196.0, 9092.0]
[28.0, 29.0]
[380, 261]
p02641
u619819312
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())\ns=list(map(int,input().split()))\nfor i in range(101):\n if n-i not in s:\n print(n-i)\n break\n elif n+i not in s:\n print(n+i)\n break ', 'x,n=map(int,input().split())\ns=list(map(int,input().split()))\nfor i in range(101):\n if x-i not in s:\n...
['Wrong Answer', 'Accepted']
['s946009625', 's661868239']
[9176.0, 9128.0]
[24.0, 29.0]
[198, 198]
p02641
u629540524
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 = sorted(map(int, input().split()))\nif p == []:\n print(x)\nelse:\n a = p[-1]\n d =[]\n e = 0\n E = 0\n b = 1000\n c = 0\n for i in range(a):\n d += [e]\n e += 1\n for i in range(n):\n d.remove(p[E])\n E += 1\n for i in rang...
['Runtime Error', 'Accepted']
['s389715083', 's938680575']
[9256.0, 9176.0]
[24.0, 29.0]
[420, 195]
p02641
u632395989
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 = list(map(int, input().split()))\n\nintegers = [i for i in range(1, 101)]\nfor i in list:\n integers.remove(i)\n\nans = integers[0]\nminabs = abs(integers[0] - x)\nfor i in integers:\n if abs(i - x) < minabs:\n minabs = abs(i - x)\n ans = i\n break\n\...
['Runtime Error', 'Wrong Answer', 'Accepted']
['s336146058', 's594106049', 's235413893']
[9136.0, 9184.0, 9176.0]
[22.0, 28.0, 23.0]
[314, 284, 198]
p02641
u638231966
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(100)\n sys.exit()\np = list(map(int, input()))\n\nn_ans = 1\nsa = 100\nfor k in range(1,100,1):\n if (k in p):\n continue\n if(abs(k-X) < sa):\n n_ans = k\n sa = abs(k-X)\n else:\n break\nprint(n_ans)', 'import...
['Runtime Error', 'Accepted']
['s417931177', 's907757767']
[9200.0, 9200.0]
[25.0, 22.0]
[291, 297]
p02641
u643679148
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())\nps = list(map(int, input().split()))\npss = [i for i in range(1, 100+1)]\nps = list(set(pss)-set(ps))\nans = x\n\nfor i, p in enumerate(ps):\n temp = abs(x-p)\n ans = p\n if i == 0:\n mins = temp\n ans = p\n else:\n if mins > temp:\n mins =...
['Wrong Answer', 'Runtime Error', 'Accepted']
['s353654525', 's791290914', 's925019339']
[9108.0, 9156.0, 9056.0]
[28.0, 30.0, 28.0]
[341, 250, 291]
p02641
u646661668
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])\nif N == 0:\n print(X)\nelse:\n p = input().split()\n A = [None]*N\n for i in range(N):\n A[i] = abs(int(p[i])-X)\n print(A)\n if 0 not in A:\n print(X)\n else:\n j = 1\n while A.count(j) == 2:\n j += 1\n ...
['Wrong Answer', 'Runtime Error', 'Wrong Answer', 'Accepted']
['s191931375', 's596436376', 's871875081', 's182948281']
[9224.0, 9220.0, 9228.0, 9224.0]
[23.0, 19.0, 22.0, 22.0]
[466, 442, 491, 453]
p02641
u647087591
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()))\nmin_abs = 51\nans = 0\nfor i in range(max(X, N)+2):\n if i in l:\n continue\n if abs(i - X) < min_abs:\n min_abs = abs(i - X)\n ans = i\nprint(ans)', 'X, N = map(int, input().split())\nl = list(map(int, input().split()))...
['Wrong Answer', 'Accepted']
['s807935380', 's519580967']
[9192.0, 9184.0]
[22.0, 23.0]
[235, 227]
p02641
u655048024
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\nans = 0\nwhile True:\n if(x-1 in p):\n if(x+1 in p):\n None\n else:\n ans = x+1\n break\n else:\n ans = x-1\n break\n i += 1\nprint(ans)\n \n ', 'x,n = map(int,input())\np = list(map(int,input.split()))\ni =...
['Runtime Error', 'Runtime Error', 'Accepted']
['s408978025', 's583145965', 's718342169']
[9172.0, 9176.0, 9172.0]
[23.0, 22.0, 23.0]
[236, 228, 234]
p02641
u658627575
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 = []\np.sort()\n\ndiff_1 = abs(X-p[-1])\ndiff_2 = abs(X-p[1])\ndiff = max(diff_1,diff_2)\n\nfor x in range(1,diff+1):\n\tif X+x not in p:\n\t\tans.append(X+x)\n\t\t\n\tif X-x not in p:\n\t\tans.append(X-x)\n\nans.sort()\nprint(ans[1])', 'X,N = ma...
['Runtime Error', 'Runtime Error', 'Accepted']
['s390141191', 's762804345', 's907595305']
[9192.0, 9048.0, 9196.0]
[21.0, 20.0, 23.0]
[281, 286, 290]
p02641
u663404111
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()))\ninteger = [i for i in range(101)]\nfor i in range(N):\n integer.remove(p[i])\nl = len(integer)\nans = -200\nfor i in range(l):\n if abs(ans) > abs(integer[i]-X):\n ans = integer[i]\nprint(ans)', '\n\nX, N = list(map(int, input().spl...
['Wrong Answer', 'Wrong Answer', 'Accepted']
['s690021490', 's765757246', 's017162155']
[9128.0, 9048.0, 9076.0]
[24.0, 25.0, 26.0]
[268, 272, 276]
p02641
u663438907
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()))\nl = []\nif len(l) == 0:\n if X != N:\n print(X)\n else:\n print(X-1)\n exit()\nfor i in range(-100, max(p)):\n if not i in p:\n l.append(i)\nprint(l)\n\nans_n = 100\nans = 0\nfor i in range(len(l)):\n if ans_n >...
['Wrong Answer', 'Accepted']
['s157541465', 's047837909']
[9216.0, 9216.0]
[23.0, 25.0]
[373, 321]