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 |
|---|---|---|---|---|---|---|---|---|---|---|
p02640 | u994865749 | 2,000 | 1,048,576 | There are some animals in a garden. Each of them is a crane with two legs or a turtle with four legs. Takahashi says: "there are X animals in total in the garden, and they have Y legs in total." Determine whether there is a combination of numbers of cranes and turtles in which this statement is correct. | ["x, y = map(int, input().split())\nif y % 2 == 0 and y >= 2*x and y <= 4*x:\n print('yes')\nelse:\n print('no')", "x, y = map(int, input().split())\nif y % 2 == 0 and y >= 2*x and y <= 4*x:\n print('Yes')\nelse:\n print('No')"] | ['Wrong Answer', 'Accepted'] | ['s183108258', 's668043697'] | [9108.0, 9104.0] | [27.0, 29.0] | [108, 108] |
p02641 | u000037600 | 2,000 | 1,048,576 | Given are an integer X and an integer sequence of length N: p_1, \ldots, p_N. Among the integers not contained in the sequence p_1, \ldots, p_N (not necessarily positive), find the integer nearest to X, that is, find the integer whose absolute difference with X is the minimum. If there are multiple such integers, repo... | ['x,y=map(int,input().split())\na=list(map(int,input().split()))\nwhile True:\n if x not in a:\n break\n else:\n x-=1\nprint(x)', 'x,y=map(int,input().split())\na=list(map(int,input().split()))\ndif=1\nif x not in a:\n print(x)\nelse:\n while True:\n if x-dif not in a:\n dif*=-1\n break\n elif... | ['Wrong Answer', 'Accepted'] | ['s144690728', 's956005642'] | [8936.0, 9192.0] | [30.0, 26.0] | [126, 237] |
p02641 | u000298463 | 2,000 | 1,048,576 | Given are an integer X and an integer sequence of length N: p_1, \ldots, p_N. Among the integers not contained in the sequence p_1, \ldots, p_N (not necessarily positive), find the 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())\nY = list(map(int, input().split()))\nx = int(X)\nprint(x)\nfor i in range(100):\n if x - i in Y:\n print(x + i)\n break\n elif x + i in Y:\n print(x - i)\n break\n', 'X, N = map(int, input().split())\nif int(N) == 0:\n print(X)\nelse:\n Y = lis... | ['Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Accepted'] | ['s267819977', 's325109693', 's621649736', 's744274335'] | [9072.0, 9036.0, 9176.0, 9124.0] | [33.0, 26.0, 26.0, 30.0] | [220, 282, 290, 290] |
p02641 | u000623733 | 2,000 | 1,048,576 | Given are an integer X and an integer sequence of length N: p_1, \ldots, p_N. Among the integers not contained in the sequence p_1, \ldots, p_N (not necessarily positive), find the integer nearest to X, that is, find the integer whose absolute difference with X is the minimum. If there are multiple such integers, repo... | ['from bisect import bisect_left\n\nX, N = map(int, input().split())\nplist = list(map(int, input().split()))\n\n\nif N == 0:\n print(X)\n\nelse:\n plist.sort()\n not_plist = [x for x in range(plist[0]-1, plist[-1]+2, 1) if x not in plist]\n\n print(not_plist)\n\n idx = bisect_left(not_plist, X)\n\n ... | ['Wrong Answer', 'Accepted'] | ['s305938036', 's856280950'] | [9156.0, 9156.0] | [31.0, 29.0] | [573, 550] |
p02641 | u000875186 | 2,000 | 1,048,576 | Given are an integer X and an integer sequence of length N: p_1, \ldots, p_N. Among the integers not contained in the sequence p_1, \ldots, p_N (not necessarily positive), find the integer nearest to X, that is, find the integer whose absolute difference with X is the minimum. If there are multiple such integers, repo... | ['l=input()\nls=l.split(" ")\nX=int(ls[0])\nN=int(ls[1])\nlstr=input()\nlst=lstr.split(" ")\nfl=[];\nif(fl!=[]):\n for a in lst:\n fl.append(int(a))\nelse:\n print(X)\nfor a in range(len(fl)):\n if(X-a not in fl):\n print(X-a)\n break\n if(X+a not in fl):\n print(X+a)\n ... | ['Wrong Answer', 'Accepted'] | ['s908264614', 's164455700'] | [8816.0, 9072.0] | [29.0, 27.0] | [309, 282] |
p02641 | u002663801 | 2,000 | 1,048,576 | Given are an integer X and an integer sequence of length N: p_1, \ldots, p_N. Among the integers not contained in the sequence p_1, \ldots, p_N (not necessarily positive), find the 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 = input().split()\n\nx = int(s[0])\nn = int(s[1])\n\ns = {i for i in range(-100,101)}\n\np1 = input().split()\n\np = set()\n\nfor i in p1:\n p.add(int(i))\n\nt = s - p\n\nanswer = 150\n\nfor i in t:\n if (abs(x - abs(int(i))) < abs(x - abs(answer))) or (abs(x - abs(int(i))) == abs(x - abs(answer))) and i < an... | ['Wrong Answer', 'Wrong Answer', 'Accepted'] | ['s221149823', 's257456436', 's251227153'] | [9224.0, 9216.0, 9208.0] | [23.0, 23.0, 23.0] | [343, 323, 323] |
p02641 | u003142309 | 2,000 | 1,048,576 | Given are an integer X and an integer sequence of length N: p_1, \ldots, p_N. Among the integers not contained in the sequence p_1, \ldots, p_N (not necessarily positive), find the 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()]\nif N == 0:\n print(X)\nelse:\n Ps = set([int(i) for i in input().split()])\n if not X in Ps:\n print(X)\n\n print(f'{X} {sorted(Ps)}')\n diff = 0\n while True:\n if not X - diff in Ps:\n print(X - diff)\n break\n if... | ['Wrong Answer', 'Accepted'] | ['s452560629', 's734814090'] | [9200.0, 9088.0] | [22.0, 23.0] | [388, 458] |
p02641 | u003475507 | 2,000 | 1,048,576 | Given are an integer X and an integer sequence of length N: p_1, \ldots, p_N. Among the integers not contained in the sequence p_1, \ldots, p_N (not necessarily positive), find the 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\nsys.setrecursionlimit(10000000)\n\nx,n = map(int,input().split())\n\np = list(map(int,input().split()))\n\n\nif n == 0:print(x);exit()\n\nl=[0] * 101\n\nfor i in p:\n l[i] =1\n\ndiff=1000\nans=0\nfor i in range(1,101):\n if l[i] == 0 and diff > abs(x-1):\n diff= abs(x-1)\n ans=i\n\npri... | ['Wrong Answer', 'Wrong Answer', 'Accepted'] | ['s211139257', 's620411598', 's680483703'] | [9108.0, 9124.0, 9112.0] | [21.0, 23.0, 22.0] | [304, 351, 304] |
p02641 | u005569385 | 2,000 | 1,048,576 | Given are an integer X and an integer sequence of length N: p_1, \ldots, p_N. Among the integers not contained in the sequence p_1, \ldots, p_N (not necessarily positive), find the 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())\na = list(map(int,input().split()))\nif x in a:\n s = 0; t = 0\n for i in range(x+1,100):\n if i not in a:\n s = i\n sys.exit()\n for j in reversed(range(x-1,-100)):\n if i not in a:\n t = j\n sys.exit()\n ... | ['Wrong Answer', 'Accepted'] | ['s773709711', 's698508002'] | [9220.0, 9068.0] | [20.0, 27.0] | [412, 193] |
p02641 | u017624958 | 2,000 | 1,048,576 | Given are an integer X and an integer sequence of length N: p_1, \ldots, p_N. Among the integers not contained in the sequence p_1, \ldots, p_N (not necessarily positive), find the 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\n\nX, N = list(map(int, input().split()))\np = list(map(int, input().split()))\n# print(X, N, p)\n\nif N == 0:\n print(X)\n exit()\n\n# p.sort()\n\n\n\n\n# if X < minimum or maximum < X:\n# print(X)\n# exit()\n\n\n\n\n# answer = min(minimum - 1, maximum + 1)\n# else:\n\n\nfor candidate i... | ['Runtime Error', 'Wrong Answer', 'Runtime Error', 'Runtime Error', 'Accepted'] | ['s404945327', 's616216070', 's711709296', 's763881564', 's748365875'] | [9184.0, 9188.0, 9196.0, 9208.0, 9236.0] | [21.0, 22.0, 25.0, 24.0, 22.0] | [780, 374, 601, 513, 756] |
p02641 | u018679195 | 2,000 | 1,048,576 | Given are an integer X and an integer sequence of length N: p_1, \ldots, p_N. Among the integers not contained in the sequence p_1, \ldots, p_N (not necessarily positive), find the 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 find_smallest_num(lst):\n\tX=lst[0]\n\tfor i in range(len(lst)):\n\t\tif lst[i]<X: X=lst[i]\n\treturn X', '#input x,n and p as intergers. p acts as an array\nx,n=int(input()).split()\np=int([]).split()\nlength=len(p)\n\n#define the closest number\ndef closestnum(p,length):\n return p[min(range(length))]\n#prin... | ['Wrong Answer', 'Runtime Error', 'Accepted'] | ['s230947438', 's912600905', 's105316545'] | [9020.0, 8960.0, 9092.0] | [27.0, 24.0, 29.0] | [98, 285, 416] |
p02641 | u018776180 | 2,000 | 1,048,576 | Given are an integer X and an integer sequence of length N: p_1, \ldots, p_N. Among the integers not contained in the sequence p_1, \ldots, p_N (not necessarily positive), find the 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(s) for s in input().split(" ")]\nif n == 0:\n print(x)\nelse:\n plist = [int(s) for s in input().split(" ")]\n\n dlist = {}\n for p in plist:\n d = abs(p - x)\n if d in dlist or d == 0:\n dlist[d] = (True, None)\n else:\n dlist[d] = (False, p - x)\n\n sorted_d = sorted(dlist.items(... | ['Wrong Answer', 'Wrong Answer', 'Accepted'] | ['s078912652', 's319093505', 's176856957'] | [9244.0, 9252.0, 9192.0] | [25.0, 26.0, 23.0] | [612, 652, 632] |
p02641 | u018846452 | 2,000 | 1,048,576 | Given are an integer X and an integer sequence of length N: p_1, \ldots, p_N. Among the integers not contained in the sequence p_1, \ldots, p_N (not necessarily positive), find the 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\tp = list(map(int, input().split()))\n\n\tfor i in range(n+1):\n\t\tif x - i in p:\n\t\t\tprint(x-1)\n\t\t\tbreak\n\t\tif x + i in p:\n\t\t\tprint(x+1)\n\t\t\tbreak\nelse:\n\tprint(x)', 'x, n = map(int, input().split())\nif n:\n\tp = list(map(int, input().split()))\n\tfor i i... | ['Wrong Answer', 'Accepted'] | ['s375615596', 's603639404'] | [9196.0, 9168.0] | [27.0, 28.0] | [194, 201] |
p02641 | u021114240 | 2,000 | 1,048,576 | Given are an integer X and an integer sequence of length N: p_1, \ldots, p_N. Among the integers not contained in the sequence p_1, \ldots, p_N (not necessarily positive), find the 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\nimport time\nfrom collections import defaultdict, deque\nfrom sys import stdin, stdout\nfrom bisect import bisect_left, bisect_right\nx,n=map(int,stdin.readline().split())\na=set(map(int,stdin.readline().split()))\nif(x not in a):\n print(x)\nelse:\n diff=1\n while(True):\n if(x-diff not ... | ['Wrong Answer', 'Accepted'] | ['s072052484', 's995336842'] | [9260.0, 9412.0] | [28.0, 29.0] | [445, 447] |
p02641 | u021763820 | 2,000 | 1,048,576 | Given are an integer X and an integer sequence of length N: p_1, \ldots, p_N. Among the integers not contained in the sequence p_1, \ldots, p_N (not necessarily positive), find the 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 -*-\nx, n = map(int, input().split())\naa = 0\nif n == 0:\n aa = 1\nif aa == 0:\n p = list(map(int, input().split()))\n p.sort()\n i = 0\n flg = 0\n dis = []\n while flg == 0:\n if i > 100:\n flg = 1\n if i in p:\n dis.append(5000)\n el... | ['Runtime Error', 'Accepted'] | ['s785056270', 's629801437'] | [9148.0, 9212.0] | [23.0, 19.0] | [460, 473] |
p02641 | u021849254 | 2,000 | 1,048,576 | Given are an integer X and an integer sequence of length N: p_1, \ldots, p_N. Among the integers not contained in the sequence p_1, \ldots, p_N (not necessarily positive), find the 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()\na=a.split()\nx=int(a[0])\np=input()\np=p.split()\n\ni=0\np_1=p+[]\n\n\n\nfor y in p_1:\n p_1[i]=abs(int(p_1[i])-x)\n i=i+1\n\np_1.sort()\nif p_1[0]==0:\n del p_1[0]\n\nq=p_1[0]\nif str(x-q) in p:\n print(x-q)\nelse:\n print(x+q)\n\n\n\n\n', 'x,n=map(int, input().split())\na=list(map(int, input().split... | ['Runtime Error', 'Accepted'] | ['s799356880', 's110057631'] | [9180.0, 9088.0] | [25.0, 28.0] | [226, 167] |
p02641 | u023229441 | 2,000 | 1,048,576 | Given are an integer X and an integer sequence of length N: p_1, \ldots, p_N. Among the integers not contained in the sequence p_1, \ldots, p_N (not necessarily positive), find the 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())\nQ=list(map(int,input().split()))\n\nif n==0:\n print(x);exit()\n \nif x in Q:\n print(x) ; exit()\n\nA=[]\nfor i in range(1,250):\n A.append(-i)\n A.append(i)\n \nfor i in A:\n if not x+i in Q:\n print(x+i)\n exit()\n', 'x,n=map(int,input().split())\nQ=list(map(int,input().s... | ['Wrong Answer', 'Wrong Answer', 'Accepted'] | ['s300447865', 's833469951', 's568105881'] | [9176.0, 9184.0, 9040.0] | [27.0, 26.0, 32.0] | [242, 200, 246] |
p02641 | u025236579 | 2,000 | 1,048,576 | Given are an integer X and an integer sequence of length N: p_1, \ldots, p_N. Among the integers not contained in the sequence p_1, \ldots, p_N (not necessarily positive), find the 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 \n X, N = map(int, input().split())\n P = list(map(int, input().split()))\n \n min_abs = list()\n \n if N == 0:\n return X\n # X + i\n i = 1\n while True:\n if X + i in P:\n i += 1\n else:\n min_abs.append(X + i)\n ... | ['Wrong Answer', 'Accepted'] | ['s158755131', 's972582048'] | [9080.0, 9208.0] | [27.0, 27.0] | [606, 875] |
p02641 | u027977105 | 2,000 | 1,048,576 | Given are an integer X and an integer sequence of length N: p_1, \ldots, p_N. Among the integers not contained in the sequence p_1, \ldots, p_N (not necessarily positive), find the 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())\ni = list(map(int, input().split()))\nif X not in i:\n print(X)\nelse:\n n = 1\n while n <=N+1:\n if X - n not in i:\n print(X - n)\n break\n else:\n if X+n not in i:\n print(X+n)\n break', 'X, N = m... | ['Time Limit Exceeded', 'Accepted'] | ['s396545935', 's551553024'] | [9120.0, 9192.0] | [2206.0, 22.0] | [293, 307] |
p02641 | u033287260 | 2,000 | 1,048,576 | Given are an integer X and an integer sequence of length N: p_1, \ldots, p_N. Among the integers not contained in the sequence p_1, \ldots, p_N (not necessarily positive), find the 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 = input().split(' ')\np =[int(i) for i in p]\nif X not in p:\n print(X)\n exit()\n\nnum_list = [int(i-99) for i in range(200)]\n[num_list.remove(p[i]) for i in range(N)]\ntmp = [0] * int(len(num_list))\n\n\nfor i in range(len(num_list... | ['Runtime Error', 'Wrong Answer', 'Runtime Error', 'Accepted'] | ['s462028773', 's565999121', 's631133861', 's139309320'] | [9248.0, 9184.0, 9220.0, 9208.0] | [22.0, 21.0, 20.0, 20.0] | [558, 559, 386, 386] |
p02641 | u033642300 | 2,000 | 1,048,576 | Given are an integer X and an integer sequence of length N: p_1, \ldots, p_N. Among the integers not contained in the sequence p_1, \ldots, p_N (not necessarily positive), find the integer nearest to X, that is, find the integer whose absolute difference with X is the minimum. If there are multiple such integers, repo... | ['def main():\n import copy\n\n num, quantity = map(int, input().split())\n nums = list(map(int, input().split()))\n nums.sort()\n \n if quantity == 0:\n print(num)\n return\n \n i = 0\n\n minus_num = copy.copy(num)\n plus_num = copy.copy(num)\n\n while i = 1\n if n... | ['Runtime Error', 'Runtime Error', 'Accepted'] | ['s608139637', 's837867714', 's221692244'] | [9040.0, 8900.0, 9192.0] | [26.0, 23.0, 25.0] | [623, 647, 630] |
p02641 | u035210736 | 2,000 | 1,048,576 | Given are an integer X and an integer sequence of length N: p_1, \ldots, p_N. Among the integers not contained in the sequence p_1, \ldots, p_N (not necessarily positive), find the 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(0)\np = list(map(int, input().split()))\na = [i for i in range(1,101)]\nb = list(set(a) - set(p))\nfor i in range(len(b)):\n if x < b[i]:\n if abs(b[i-1]-x) <= abs(b[i]-x):\n print(b[i-1])\n break\n else:\n print(b[i])\n break... | ['Runtime Error', 'Wrong Answer', 'Accepted'] | ['s745240656', 's892792970', 's060784195'] | [9128.0, 9036.0, 9128.0] | [29.0, 27.0, 31.0] | [319, 305, 296] |
p02641 | u039065404 | 2,000 | 1,048,576 | Given are an integer X and an integer sequence of length N: p_1, \ldots, p_N. Among the integers not contained in the sequence p_1, \ldots, p_N (not necessarily positive), find the 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()))\nS = []\n\nfor i in range(101):\n if i in p:\n continue\n else:\n S.append(abs(i-X))\n\nprint(min(S))', 'X, N = map(int, input().split())\np = list(map(int, input().split()))\nS = []\n\nfor i in range(110):\n if i in p:\n S.append(100)\... | ['Wrong Answer', 'Accepted'] | ['s697078852', 's454925648'] | [9168.0, 9172.0] | [31.0, 29.0] | [169, 184] |
p02641 | u048735692 | 2,000 | 1,048,576 | Given are an integer X and an integer sequence of length N: p_1, \ldots, p_N. Among the integers not contained in the sequence p_1, \ldots, p_N (not necessarily positive), find the 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())\npList = list(map(int, input().split()))\n\nnmap = [i for i in range(0, 102)]\n\nfor (i, v) in enumerate(nmap):\n nmap[i] = abs(v-x)\n\nprint(nmap)\n\nfor (i, v) in enumerate(pList):\n nmap[v] = 102\n\nprint(nmap)\n\nans = numpy.argmin(nmap)\nprint(ans)\n', 'import n... | ['Wrong Answer', 'Accepted'] | ['s794565382', 's124896001'] | [27076.0, 27000.0] | [115.0, 118.0] | [287, 261] |
p02641 | u050706842 | 2,000 | 1,048,576 | Given are an integer X and an integer sequence of length N: p_1, \ldots, p_N. Among the integers not contained in the sequence p_1, \ldots, p_N (not necessarily positive), find the 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 = None\nfor r in range(100):\n for i in [-r, r]:\n if (X + i) not in p:\n ans = X+i\n break\n\n if ans is not None:\n break\n\n\nprint(ans)', 'X, N = list(map(int, input().split()))\np = list(map(int, input().split()))\n\nans = None\nfor r in range(100):\n for i in [-r... | ['Runtime Error', 'Accepted'] | ['s769790162', 's368770959'] | [9092.0, 9188.0] | [25.0, 19.0] | [174, 249] |
p02641 | u052244548 | 2,000 | 1,048,576 | Given are an integer X and an integer sequence of length N: p_1, \ldots, p_N. Among the integers not contained in the sequence p_1, \ldots, p_N (not necessarily positive), find the integer nearest to X, that is, find the integer whose absolute difference with X is the minimum. If there are multiple such integers, repo... | ["X,Y=map(int,input().split())\n\n\nfor i in range(0,100+1):\n \n for j in range(0,100+1):\n if i + j > X:\n break\n if (i*2 + j*4) == Y and (i+j) == X:\n print('Yes')\n exit()\n\nprint('No')\n", 'X,N=map(int,input().split())\nif N == 0:\n print(X)\n exit()\n\n... | ['Wrong Answer', 'Accepted'] | ['s724075785', 's970952323'] | [9168.0, 9144.0] | [24.0, 23.0] | [231, 306] |
p02641 | u054662964 | 2,000 | 1,048,576 | Given are an integer X and an integer sequence of length N: p_1, \ldots, p_N. Among the integers not contained in the sequence p_1, \ldots, p_N (not necessarily positive), find the 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()\nb = int(a[0])\nc = int(a[1])\nd = [int(i) for i in input().split()]\ne = sorted(d)\n\n\nf = int(e[0]-1)\ng = int(e[-1]+1)\n\n\nh = int(g-f)\n\nX = []\nfor I in range(int(h+1)):\n J = int(f+I)\n if e.count(J) == 0:\n X.append(J)\n\nY = len(X)\nH = []\nfor S in range(Y):\n Q = X[S]\... | ['Runtime Error', 'Accepted'] | ['s094565778', 's911104304'] | [9160.0, 9200.0] | [22.0, 21.0] | [469, 583] |
p02641 | u054798759 | 2,000 | 1,048,576 | Given are an integer X and an integer sequence of length N: p_1, \ldots, p_N. Among the integers not contained in the sequence p_1, \ldots, p_N (not necessarily positive), find the 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,n = int(x),int(n)\n\na = input().split()\nfor i in range(len(a)):\n a[i] = int(a[i])\n\nif x not in a:\n print(x)\nelse:\n sa = 1\n while True:\n if x-sa not in a:\n print(x-sa)\n break\n if x+sa not in a:\n print(x+sa)\n break', 'x,n = input().split()\nx,n = int... | ['Time Limit Exceeded', 'Accepted'] | ['s462682532', 's511257840'] | [9204.0, 9188.0] | [2206.0, 22.0] | [265, 278] |
p02641 | u054825571 | 2,000 | 1,048,576 | Given are an integer X and an integer sequence of length N: p_1, \ldots, p_N. Among the integers not contained in the sequence p_1, \ldots, p_N (not necessarily positive), find the 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=[]\nif N>0:\n p=list(map(int,input().split()))\n L=[abs(X-i) for i in P]\n l=min(L)\n if X-l in P:\n print(X-l)\n else:\n print(X+l)\nelse:\n print(X)', 'X,N=map(int,input().split())\nif N>0:\n P=list(map(int,input().split()))\n L=[abs(X-i) for i in P]\n l=min(L)\n if X... | ['Runtime Error', 'Wrong Answer', 'Accepted'] | ['s106424812', 's764870843', 's080139997'] | [9096.0, 9120.0, 9116.0] | [26.0, 33.0, 28.0] | [183, 178, 213] |
p02641 | u055044516 | 2,000 | 1,048,576 | Given are an integer X and an integer sequence of length N: p_1, \ldots, p_N. Among the integers not contained in the sequence p_1, \ldots, p_N (not necessarily positive), find the 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\nX, N = map(int,input().split())\nP = list(map(int,input().split()))\n\nP_set = list(set(P))\n#print(P_set)\n#print(P_set[1])\n\nans_chk = 0\n\nif ( X < P[0] or X > P[N-1] ):\n print(X)\n ans_chk = 1\n\nif ( ans_chk==0 ):\n for i in range(len(P)):\n if ( P_set[i] == X ):\n X_i = i... | ['Runtime Error', 'Runtime Error', 'Accepted'] | ['s544736265', 's740125044', 's491679051'] | [9272.0, 9268.0, 9324.0] | [24.0, 22.0, 22.0] | [762, 1312, 1498] |
p02641 | u055981695 | 2,000 | 1,048,576 | Given are an integer X and an integer sequence of length N: p_1, \ldots, p_N. Among the integers not contained in the sequence p_1, \ldots, p_N (not necessarily positive), find the 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\na = list(map(int,input().split()))\n\nx = a[0]\nn = a[1]\nd = list(map(int,input().split()))\n\nif (n == 0):\n print(x)\nelse:\n min_int = d[np.argmin(d)]\n max_int = d[np.argmax(d)]SSS\n if (x < min_int or max_int < x):\n print(x)\n else:\n p = []\n for var in ... | ['Runtime Error', 'Accepted'] | ['s754856960', 's270311856'] | [9044.0, 27092.0] | [24.0, 111.0] | [566, 577] |
p02641 | u057942294 | 2,000 | 1,048,576 | Given are an integer X and an integer sequence of length N: p_1, \ldots, p_N. Among the integers not contained in the sequence p_1, \ldots, p_N (not necessarily positive), find the 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 = set(list(map(int, input().split())))\n\nfor diff in range(1000):\n if X - diff not in P:\n print(X - diff)\n elif X + diff not in P:\n print(X + diff)\n', 'X, N = map(int, input().split())\nP = set(map(int, input().split()))\n\nfor diff in range(1000):\n if X - diff not ... | ['Wrong Answer', 'Accepted'] | ['s465428523', 's092350965'] | [9224.0, 9172.0] | [24.0, 20.0] | [190, 208] |
p02641 | u058496530 | 2,000 | 1,048,576 | Given are an integer X and an integer sequence of length N: p_1, \ldots, p_N. Among the integers not contained in the sequence p_1, \ldots, p_N (not necessarily positive), find the 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\ndef my_index(l, x, default=False):\n if x in l:\n return l.index(x)\n else:\n return default\nlist_n = [0, -1, 1]\nfor i in range(2, 50):\n list_n.append(-i)\n list_n.append(i)\nX, N = map(int, input().split())\nif N == 0:\n print(X)\n sys.exit()\np = list(map(int, input().spli... | ['Wrong Answer', 'Accepted'] | ['s115735566', 's753362841'] | [9128.0, 9224.0] | [23.0, 23.0] | [445, 440] |
p02641 | u059973060 | 2,000 | 1,048,576 | Given are an integer X and an integer sequence of length N: p_1, \ldots, p_N. Among the integers not contained in the sequence p_1, \ldots, p_N (not necessarily positive), find the 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 = input().split()\ny = input().split()\n\nif len(y) == 0:\n print(x[0])\n sys.exit()\na=[]\nb=[]\nfor n in range(-1,102):\n b.append(n)\n \nfor nn in range(len(y)):\n \n b.remove(int(y[nn]))\nfor m in range(len(b)): \n d = b[m] - int(x[0])\n if d < 0:\n c = d*(-1)\n if ... | ['Wrong Answer', 'Accepted'] | ['s888518339', 's242485857'] | [9236.0, 9236.0] | [23.0, 23.0] | [432, 437] |
p02641 | u062754605 | 2,000 | 1,048,576 | Given are an integer X and an integer sequence of length N: p_1, \ldots, p_N. Among the integers not contained in the sequence p_1, \ldots, p_N (not necessarily positive), find the 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()))\n A = [0] * N\n for i in range(N):\n A[i] = abs(l[i] - X)\n S = A.count(0)\n if S == 0:\n print(X)\n else:\n for i in range(1, N):\n S = A.count(N)\n ... | ['Wrong Answer', 'Runtime Error', 'Wrong Answer', 'Runtime Error', 'Runtime Error', 'Accepted'] | ['s279491049', 's381442571', 's550700756', 's639091664', 's651430033', 's099199965'] | [9180.0, 9216.0, 9204.0, 9212.0, 9216.0, 9124.0] | [32.0, 23.0, 32.0, 22.0, 23.0, 23.0] | [590, 631, 613, 535, 643, 203] |
p02641 | u066551652 | 2,000 | 1,048,576 | Given are an integer X and an integer sequence of length N: p_1, \ldots, p_N. Among the integers not contained in the sequence p_1, \ldots, p_N (not necessarily positive), find the 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(101):\n a = int(x - i)\n b = int(x + i)\n if a not in p:\n print(a)\n exit()\n elif b not in p:\n print(b)\n exit()', 'x, n = map(int,input().split())\np = list(map(int, input().split()))\n\nfor i... | ['Wrong Answer', 'Accepted'] | ['s073930829', 's645898350'] | [9184.0, 9188.0] | [23.0, 21.0] | [226, 231] |
p02641 | u070630744 | 2,000 | 1,048,576 | Given are an integer X and an integer sequence of length N: p_1, \ldots, p_N. Among the integers not contained in the sequence p_1, \ldots, p_N (not necessarily positive), find the 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 iput(): return int(input())\ndef mput(): return map(int, input().split())\ndef lput(): return list(map(int, input().split()))\n\ndef solve():\n x, n = mput()\n p = lput()\n ans = []\n for i in range(x, x-n-1, -1):\n boo = i in p\n if boo != True:\n ans.append(i)\n b... | ['Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Accepted'] | ['s250410251', 's478540874', 's635319943', 's240212198'] | [9220.0, 9084.0, 9220.0, 9180.0] | [20.0, 25.0, 22.0, 22.0] | [526, 502, 526, 576] |
p02641 | u080419397 | 2,000 | 1,048,576 | Given are an integer X and an integer sequence of length N: p_1, \ldots, p_N. Among the integers not contained in the sequence p_1, \ldots, p_N (not necessarily positive), find the integer nearest to X, that is, find the integer whose absolute difference with X is the minimum. If there are multiple such integers, repo... | ['for i in range(100):\n plus_abs=X+i\n minus_abs=X-i\n\n for j in range(N):\n if plus_abs == int(list2[j]):\n plus_abs=1000\n\n\n for k in range(N):\n if minus_abs == int(list2[k]):\n minus_abs=1000\n\n if plus_abs !=1000 or minus_abs!=1000:\n if plus_abs >= min... | ['Runtime Error', 'Accepted'] | ['s369319840', 's638292803'] | [9056.0, 9212.0] | [24.0, 24.0] | [423, 548] |
p02641 | u085530099 | 2,000 | 1,048,576 | Given are an integer X and an integer sequence of length N: p_1, \ldots, p_N. Among the integers not contained in the sequence p_1, \ldots, p_N (not necessarily positive), find the integer nearest to X, that is, find the integer whose absolute difference with X is the minimum. If there are multiple such integers, repo... | ['z = list(map(int, input().split()))\nx = z[0]\nif z[1] == 0:\n print(z[0])\nelse:\n p = list(map(int, input().split()))\n count = 0\n l = []\n for i in range(1, 101):\n l.append(i)\n for i in p:\n l.remove(i)\n print(l)\n t = 200\n for i in l:\n e = abs(x-i)\n if e >= t:\n break\n t = e\n... | ['Runtime Error', 'Accepted'] | ['s253992542', 's255550059'] | [9232.0, 9196.0] | [24.0, 23.0] | [323, 299] |
p02641 | u088553842 | 2,000 | 1,048,576 | Given are an integer X and an integer sequence of length N: p_1, \ldots, p_N. Among the integers not contained in the sequence p_1, \ldots, p_N (not necessarily positive), find the 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\nif n == 0:\n print(x)\n sys.exit()\nx, n = map(int, input().split())\nlst = list(map(int, input().split()))\nfor i in range(250):\n if x - i not in lst:\n print(x + i)\n sys.exit()\n if x + i not in lst:\n print(x + i)\n sys.exit()', 'import sys\nx, n = map(int, input().split())\nlst = lis... | ['Runtime Error', 'Runtime Error', 'Accepted'] | ['s563930167', 's857775615', 's011068017'] | [9056.0, 9020.0, 9124.0] | [30.0, 28.0, 31.0] | [247, 218, 247] |
p02641 | u089230684 | 2,000 | 1,048,576 | Given are an integer X and an integer sequence of length N: p_1, \ldots, p_N. Among the integers not contained in the sequence p_1, \ldots, p_N (not necessarily positive), find the integer nearest to X, that is, find the integer whose absolute difference with X is the minimum. If there are multiple such integers, repo... | ['#the program is to find the nearest number which is not included in N, and if more than 1 number, it will take the smallest one\n\n#we will declare the x and n integer\nx, n = map(int, input().split())\n\n#declare the pi\np = list(map(int, input().split()))\n\n\nfor a in range(x + 1):\nfor b in [-1, +1]:\nresult = X ... | ['Runtime Error', 'Accepted'] | ['s923172037', 's329729071'] | [8988.0, 9100.0] | [25.0, 26.0] | [354, 287] |
p02641 | u091307273 | 2,000 | 1,048,576 | Given are an integer X and an integer sequence of length N: p_1, \ldots, p_N. Among the integers not contained in the sequence p_1, \ldots, p_N (not necessarily positive), find the integer nearest to X, that is, find the integer whose absolute difference with X is the minimum. If there are multiple such integers, repo... | ['def main():\n x, n = (int(i) for i in input().split())\n if n > 0:\n p = [int(i) for i in input().split()]\n else:\n p = []\n\n mask = [0] * 101 \n for pe in p:\n mask[pe] = 1\n\n b, e = x, x\n\n while True:\n if b >= 1 and mask[b] == 0:\n break\n b -... | ['Wrong Answer', 'Wrong Answer', 'Accepted'] | ['s594469939', 's811237391', 's892205703'] | [9188.0, 9044.0, 9164.0] | [2205.0, 2205.0, 32.0] | [450, 365, 361] |
p02641 | u092650292 | 2,000 | 1,048,576 | Given are an integer X and an integer sequence of length N: p_1, \ldots, p_N. Among the integers not contained in the sequence p_1, \ldots, p_N (not necessarily positive), find the 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 math import gcd\n\nfrom math import factorial as f\n\nfrom math import ceil,floor,sqrt\nimport math\n\nimport bisect\nimport re\nimport heapq\n\n\nfrom copy import deepcopy\nimport itertools\nfrom itertools import permutations\n\nfrom sys import exit\n\nii = lambda : int(input())\nmi = lambda : map(int,input().s... | ['Runtime Error', 'Accepted'] | ['s702242909', 's364209268'] | [8964.0, 9976.0] | [26.0, 40.0] | [406, 592] |
p02641 | u094999522 | 2,000 | 1,048,576 | Given are an integer X and an integer sequence of length N: p_1, \ldots, p_N. Among the integers not contained in the sequence p_1, \ldots, p_N (not necessarily positive), find the 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()\nq = input().split()\np = sorted(abs(int(i)-x) for i in q)\nfor i in range(n):\n if i != p[i]:\n if x - i not in q:\n print(x - i)\n else:\n print(x + i)\n exit()', 'x,n,*p = map(int,open(0).read().split())\n... | ['Wrong Answer', 'Accepted'] | ['s576896157', 's851074750'] | [9184.0, 9172.0] | [21.0, 24.0] | [260, 181] |
p02641 | u097065307 | 2,000 | 1,048,576 | Given are an integer X and an integer sequence of length N: p_1, \ldots, p_N. Among the integers not contained in the sequence p_1, \ldots, p_N (not necessarily positive), find the 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()))\na = 0\nab = 0\nfor i in range(100):\n if x - i not in l:\n ans = x - i\n a = i + 1\n print(ans)\n break\nfor i in range(100):\n if x + i not in l:\n ansb = x + i\n ab = i + 1\n print(ansb)\n ... | ['Wrong Answer', 'Accepted'] | ['s775956499', 's132707057'] | [9140.0, 9000.0] | [29.0, 29.0] | [361, 322] |
p02641 | u098436028 | 2,000 | 1,048,576 | Given are an integer X and an integer sequence of length N: p_1, \ldots, p_N. Among the integers not contained in the sequence p_1, \ldots, p_N (not necessarily positive), find the 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==100):\n print(X)\n\nelse:\n p = list(map(int,input().split() ))\n\n p.sort()\n q=list(range(1,max(p)+1))\n\n for i in p:\n q.remove(i)\n\n Z=1000\n ans=-1\n for i in q:\n if( abs(X-i)<Z):\n Z=abs(X-i)\n ans=i\n \n print(ans)', 'X,N=map(int,input()... | ['Runtime Error', 'Accepted'] | ['s951159178', 's262696831'] | [9020.0, 9136.0] | [23.0, 20.0] | [275, 255] |
p02641 | u099150084 | 2,000 | 1,048,576 | Given are an integer X and an integer sequence of length N: p_1, \ldots, p_N. Among the integers not contained in the sequence p_1, \ldots, p_N (not necessarily positive), find the 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)\nelse:\n l = list(map(int, input().split()))\n l.sort()\n small = x\n large = x\n while small in l and large in l:\n small -= 1\n large += 1\n if x - small > large - x:\n print(large)\n else:\n print(small)\n... | ['Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Accepted'] | ['s420895154', 's473061084', 's862954121', 's384480758'] | [9176.0, 9184.0, 9188.0, 9192.0] | [24.0, 23.0, 23.0, 21.0] | [302, 314, 316, 400] |
p02641 | u103520789 | 2,000 | 1,048,576 | Given are an integer X and an integer sequence of length N: p_1, \ldots, p_N. Among the integers not contained in the sequence p_1, \ldots, p_N (not necessarily positive), find the 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()))\nif N == 0:\n print(100)\n\nelse:\n min_abs = 100\n min_abs = min([abs(X-i) for i in range(100) if not i in P])\n min_abs\n\n\n ans_candi = [i+X for i in range(-min_abs, min_abs+1) if not i in P]\n ans = min(ans_candi)\n print(... | ['Wrong Answer', 'Accepted'] | ['s625578915', 's941348232'] | [9204.0, 9144.0] | [21.0, 22.0] | [309, 231] |
p02641 | u107494228 | 2,000 | 1,048,576 | Given are an integer X and an integer sequence of length N: p_1, \ldots, p_N. Among the integers not contained in the sequence p_1, \ldots, p_N (not necessarily positive), find the integer nearest to X, that is, find the integer whose absolute difference with X is the minimum. If there are multiple such integers, repo... | ['k,n=map(int,input().split())\nif(n==0):\n print(k)\nelse:\n l=sorted(list(map(int,input().split())))\n a=[]\n a.append(k)\n for i in range(1,n):\n a.append(k-i)\n a.append(k+i)\n if(n%2==0):\n a.pop(-1)\n for i in range(n):\n if(l[i] in a):\n continue\n else:\n if(i!=n-1):\n ... | ['Wrong Answer', 'Accepted'] | ['s299247773', 's675983236'] | [9084.0, 9140.0] | [26.0, 28.0] | [411, 274] |
p02641 | u107799502 | 2,000 | 1,048,576 | Given are an integer X and an integer sequence of length N: p_1, \ldots, p_N. Among the integers not contained in the sequence p_1, \ldots, p_N (not necessarily positive), find the 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 = set([int(i) for i in input().split()])\nset_all = set(np.arange(-100, 101))\nex_list = set_all-p_list\nex_list = list(ex_list)\ndiff_list = [np.abs(i-X) for i in ex_list]\nmin_index = np.argmin(diff_list)\nprint(ex_list[min_index])', 'X, N = map(int, input().split())\np_list... | ['Runtime Error', 'Runtime Error', 'Accepted'] | ['s140495740', 's422562499', 's022844882'] | [9132.0, 9220.0, 27188.0] | [25.0, 24.0, 104.0] | [267, 264, 286] |
p02641 | u110650988 | 2,000 | 1,048,576 | Given are an integer X and an integer sequence of length N: p_1, \ldots, p_N. Among the integers not contained in the sequence p_1, \ldots, p_N (not necessarily positive), find the 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())\nlis = list(map(int,input().split()))\nlis.sort()\np = 0\ncounter = n\nfor i in range(n):\n if i>0 and lis[i] == lis[i-1]:\n counter -=1\n elif i>0 and lis[i]<lis[0]*2:\n p += 1\n else:\n for j in range(n):\n if i != j and lis[i]%lis[j] ==0:\n c... | ['Runtime Error', 'Accepted'] | ['s848605133', 's789498355'] | [9132.0, 9192.0] | [29.0, 21.0] | [353, 382] |
p02641 | u113569368 | 2,000 | 1,048,576 | Given are an integer X and an integer sequence of length N: p_1, \ldots, p_N. Among the integers not contained in the sequence p_1, \ldots, p_N (not necessarily positive), find the 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 = list(map(int, input().split()))\n\nif XN[1] == 0:\n print(XN[0])\nelse:\n p = list(map(int, input().split()))\n for d in range(1, XN[1] + 1):\n if not XN[0] + d in p:\n print(XN[0] + d)\n', 'XN = list(map(int, input().split()))\n \nif XN[1] == 0:\n print(XN[0])\nelse:\n p = list(map(int, input().spl... | ['Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Accepted'] | ['s193836784', 's257557492', 's752334193', 's782493940', 's187947948'] | [9116.0, 9192.0, 9200.0, 9088.0, 9132.0] | [24.0, 22.0, 23.0, 26.0, 21.0] | [194, 241, 243, 244, 265] |
p02641 | u115110170 | 2,000 | 1,048,576 | Given are an integer X and an integer sequence of length N: p_1, \ldots, p_N. Among the integers not contained in the sequence p_1, \ldots, p_N (not necessarily positive), find the 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())\nls = list(map(int,input().split()))\n\nls = sorted(ls)\nd = 10**3\nans = 0\nfor p in ls:\n if abs(x-p)<d:\n d = abs(x-p)\n ans = p\nprint(ans)', 'x,n = map(int,input().split())\nif n==0:\n print(x)\n exit()\nls = list(map(int,input().split()))\n\nls = sorted(ls)\nd = 10**3\nan... | ['Wrong Answer', 'Accepted'] | ['s190959577', 's303414406'] | [9208.0, 9192.0] | [20.0, 24.0] | [171, 250] |
p02641 | u115877451 | 2,000 | 1,048,576 | Given are an integer X and an integer sequence of length N: p_1, \ldots, p_N. Among the integers not contained in the sequence p_1, \ldots, p_N (not necessarily positive), find the 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\na,b=map(int,input().split())\nc=list(map(int,input().split()))\n\nif a not in c:\n print(a)\n exit()\n\nn=[i for i in range(-1,101)]\n\nm=sorted(list(set(n)^set(c)))\nbisect.insort_right(m,a)\n\nm=sorted(list(set(m)))\nif len(m)=<3:\n print(m[m.index(a)-1])\n\nelif b==0:\n print(a)\n\nelif ... | ['Runtime Error', 'Accepted'] | ['s358107703', 's209879915'] | [9056.0, 9208.0] | [21.0, 21.0] | [527, 203] |
p02641 | u116038906 | 2,000 | 1,048,576 | Given are an integer X and an integer sequence of length N: p_1, \ldots, p_N. Among the integers not contained in the sequence p_1, \ldots, p_N (not necessarily positive), find the 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 sys\ninput = sys.stdin.readline\nX,N = (int(i) for i in input().split())\nif N !=0:\n p = list(map(int, input().split()))\nelif N ==0:\n p=[-1]\np.sort()\np_100 =[i for i in range(1,101)]\np =p_100\n#\nans =[]\nfor i in range(-1,101):\n if i not in p:\n ans.append((abs(i-X),i))\nans.sort()\ni... | ['Wrong Answer', 'Wrong Answer', 'Accepted'] | ['s241172401', 's397383971', 's099868026'] | [9156.0, 9128.0, 9204.0] | [23.0, 21.0, 22.0] | [351, 416, 288] |
p02641 | u117078923 | 2,000 | 1,048,576 | Given are an integer X and an integer sequence of length N: p_1, \ldots, p_N. Among the integers not contained in the sequence p_1, \ldots, p_N (not necessarily positive), find the 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\nall_l = [i for i in range(0,101)]\n\n\nfor p in P:\n all_l.remove(p)\n \n\nkouho = x\nfor i in range(200):\n kouho1 = x-i\n kouho2 = x+i\n if kouho1 not in P:\n print(x-i)\n break\n elif kouho2 not in P:', 'X, N = ... | ['Runtime Error', 'Accepted'] | ['s479098081', 's959659936'] | [9056.0, 9140.0] | [21.0, 19.0] | [338, 178] |
p02641 | u119982001 | 2,000 | 1,048,576 | Given are an integer X and an integer sequence of length N: p_1, \ldots, p_N. Among the integers not contained in the sequence p_1, \ldots, p_N (not necessarily positive), find the 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\nlis = [1] * 100\nprint(lis)\nfor p in P: lis[p-1] -= 1\nprint(lis)\n\nfor i in range(50):\n up = X+i\n down = X-i\n if lis[down-1] == 1:\n print(down)\n exit()\n elif lis[up-1] == 1:\n print(up)\n exit()\n... | ['Runtime Error', 'Accepted'] | ['s683167194', 's746320603'] | [9196.0, 9188.0] | [23.0, 25.0] | [301, 293] |
p02641 | u121799456 | 2,000 | 1,048,576 | Given are an integer X and an integer sequence of length N: p_1, \ldots, p_N. Among the integers not contained in the sequence p_1, \ldots, p_N (not necessarily positive), find the 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)\n\texit()\np = list(map(int, input().split()))\nmind = abs(x - p[0])\npos = [p[0]]\ns = set(p)\np = []\nfor x1 in range(-100, 200):\n\tif x1 in s:\n\t\tcontinue\n\telse:\n\t\tp.append(x1)\nfor q in p:\n\tif abs(x - q) < mind:\n\t\tmind = abs(x - q)\n\t\tpos = [... | ['Wrong Answer', 'Accepted'] | ['s783958488', 's553587095'] | [9216.0, 9220.0] | [24.0, 22.0] | [357, 370] |
p02641 | u124212130 | 2,000 | 1,048,576 | Given are an integer X and an integer sequence of length N: p_1, \ldots, p_N. Among the integers not contained in the sequence p_1, \ldots, p_N (not necessarily positive), find the 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())\nMylist = input().split()\nMylist = [int(s) for s in Mylist]\n\nfor i in range(X):\n if not (X - i) in Mylist:\n print(X-i)\n elif not (X + i) in Mylist:\n print(X+i) ', 'X, N = map(int, input().split())\nMylist = input().split()\nMylist = [int(s) for s in Mylist]\... | ['Wrong Answer', 'Wrong Answer', 'Accepted'] | ['s908432652', 's975405994', 's972447484'] | [9120.0, 9176.0, 9184.0] | [24.0, 22.0, 21.0] | [212, 204, 263] |
p02641 | u127025777 | 2,000 | 1,048,576 | Given are an integer X and an integer sequence of length N: p_1, \ldots, p_N. Among the integers not contained in the sequence p_1, \ldots, p_N (not necessarily positive), find the 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()))\nx = a[0]\nif a[1] == 0 :\n print(x)\nelse :\n b = list(map(int,input().split()))\n retu = []\n for i in range(1,101) :\n retu.append(i)\n for i in b :\n if i in retu :\n retu.remove(i)\n print(retu)\n k = 1000\n ans = i\n for i in... | ['Wrong Answer', 'Accepted'] | ['s860346186', 's305308436'] | [9208.0, 9088.0] | [26.0, 24.0] | [406, 389] |
p02641 | u127873832 | 2,000 | 1,048,576 | Given are an integer X and an integer sequence of length N: p_1, \ldots, p_N. Among the integers not contained in the sequence p_1, \ldots, p_N (not necessarily positive), find the 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()))\nif not P:\n print(x)\nexit(0)\nfor i in range(x, 102):\n if i not in P:\n upper = i\n break\n else:\n upper = 102\nfor i in range(x, -1, -1):\n if i not in P:\n lower = i\n break\n else:\n l... | ['Wrong Answer', 'Runtime Error', 'Accepted'] | ['s026640541', 's981526280', 's400923321'] | [9084.0, 8940.0, 9100.0] | [29.0, 24.0, 25.0] | [358, 359, 362] |
p02641 | u132266749 | 2,000 | 1,048,576 | Given are an integer X and an integer sequence of length N: p_1, \ldots, p_N. Among the integers not contained in the sequence p_1, \ldots, p_N (not necessarily positive), find the 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())\nlista= [int (x) for x in input().split()]\n\nfor i in range(200):\n if a-i not in lista:\n print(a-1)\n exit()\n elif a+i not in lista:\n print(a+1)\n exit()', 'a, b= map(int, input().split())\nlista= [int (x) for x in input().split()]\n\nfor i in ran... | ['Wrong Answer', 'Accepted'] | ['s829937458', 's821395664'] | [9020.0, 9164.0] | [29.0, 32.0] | [215, 213] |
p02641 | u135389999 | 2,000 | 1,048,576 | Given are an integer X and an integer sequence of length N: p_1, \ldots, p_N. Among the integers not contained in the sequence p_1, \ldots, p_N (not necessarily positive), find the 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\nelse:\n p = list(map(int, input().split()))\n cnt = 0\n if x in p:\n print(x)\n else:\n while True:\n cnt += 1\n if x - cnt not in p:\n print(x - cnt)\n break\n if x +... | ['Wrong Answer', 'Accepted'] | ['s381454479', 's250599097'] | [9180.0, 9128.0] | [33.0, 33.0] | [370, 374] |
p02641 | u139216357 | 2,000 | 1,048,576 | Given are an integer X and an integer sequence of length N: p_1, \ldots, p_N. Among the integers not contained in the sequence p_1, \ldots, p_N (not necessarily positive), find the 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_d = [x-int(i) for i in input().split()]\np_sorted = sorted(p_d,key= lambda x: (-x-0.1, x)[x > 0])\n\nl = [x-k for k in range(1,101)]\nl_sorted = sorted(l,key= lambda x: (-x-0.1, x)[x > 0])\n\nfor i in range(n):\n ans = l_sorted[i]\n if p_sorted[i] != ans:\n print(x+ans)... | ['Wrong Answer', 'Accepted'] | ['s574591248', 's995620123'] | [9204.0, 9204.0] | [22.0, 24.0] | [347, 274] |
p02641 | u139441419 | 2,000 | 1,048,576 | Given are an integer X and an integer sequence of length N: p_1, \ldots, p_N. Among the integers not contained in the sequence p_1, \ldots, p_N (not necessarily positive), find the 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 a=list(map(int,input().split()))\n\n flag=0\n i=0\n while flag==0:\n continueflag=0\n for j in a:\n if j==x-i:\n continueflag=1\n break\n if continueflag==0:\n print(x-i)\n break\n \n for j in a:\n if j=... | ['Time Limit Exceeded', 'Runtime Error', 'Accepted'] | ['s241429788', 's441448392', 's881067541'] | [9108.0, 9180.0, 9204.0] | [2205.0, 21.0, 26.0] | [408, 179, 443] |
p02641 | u143322814 | 2,000 | 1,048,576 | Given are an integer X and an integer sequence of length N: p_1, \ldots, p_N. Among the integers not contained in the sequence p_1, \ldots, p_N (not necessarily positive), find the integer nearest to X, that is, find the integer whose absolute difference with X is the minimum. If there are multiple such integers, repo... | ['def main():\n x, n = map(int, input().split())\n p = set(map(int, input().split()))\n if not x in p:\n print(x)\n else:\n a = [abs(i-x) if not i in p else 1000 for i in range(-1, 102)]\n print(a.index(min(a))+1)\n\nif __name__ == "__main__":\n main()', 'def main():\n x, n = map(... | ['Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Accepted'] | ['s001330876', 's450068751', 's609506772', 's679998653'] | [9084.0, 9104.0, 9224.0, 9080.0] | [27.0, 27.0, 25.0, 28.0] | [276, 276, 293, 277] |
p02641 | u145145077 | 2,000 | 1,048,576 | Given are an integer X and an integer sequence of length N: p_1, \ldots, p_N. Among the integers not contained in the sequence p_1, \ldots, p_N (not necessarily positive), find the 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()))\nall=set(range(1,101))\ns_p=set(p)\n\nmin_dis=100\nfor i in all-s_p:\n dis=abs(i-x)\n if min_dis > dis:\n min_i=i\n min_dis=dis\nprint(min_dis, min_i)', 'x,n=map(int, input().split())\nif n == 0:\n print(x)\n ... | ['Runtime Error', 'Accepted'] | ['s182157271', 's569286965'] | [9196.0, 9084.0] | [22.0, 25.0] | [243, 255] |
p02641 | u146575240 | 2,000 | 1,048,576 | Given are an integer X and an integer sequence of length N: p_1, \ldots, p_N. Among the integers not contained in the sequence p_1, \ldots, p_N (not necessarily positive), find the 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())\np= list(map(int,input().split()))\nA= list(range(1,X+1))\nfor i in range(N):\n A.remove(p[i])\n\nD = 101\nans = 0\nfor j in range(len(A)):\n if D >= abs(X - A[j]):\n D = abs(X - A[j])\n ans = A[j]\n else:\n pass\nprint(ans)', '"""#D - Not Divisible\nN= ma... | ['Runtime Error', 'Accepted'] | ['s704410256', 's598669930'] | [9200.0, 9208.0] | [22.0, 21.0] | [290, 396] |
p02641 | u146597538 | 2,000 | 1,048,576 | Given are an integer X and an integer sequence of length N: p_1, \ldots, p_N. Among the integers not contained in the sequence p_1, \ldots, p_N (not necessarily positive), find the 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()))\nif len(p) == 0:\n print(x)\n exit(0)\nfor abs in range(n+1):\n print(f'{x} {abs}')\n if (x - abs) not in p:\n print(x-abs)\n exit(0)\n elif (x + abs) not in p:\n print(x+abs)\n exit(0)", 'x, n = map(int... | ['Wrong Answer', 'Accepted'] | ['s623506101', 's591427468'] | [9220.0, 9192.0] | [21.0, 24.0] | [287, 263] |
p02641 | u159144188 | 2,000 | 1,048,576 | Given are an integer X and an integer sequence of length N: p_1, \ldots, p_N. Among the integers not contained in the sequence p_1, \ldots, p_N (not necessarily positive), find the 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 not N == 0:\n p_l = list(map(int, input().split()))\nif N == 0:\n print(X)\n exit()\na = b = X\nwhile True:\n if a in p_l and b in p_l:\n continue\n if not a in p_l:\n if not b in p_l:\n if a > b:\n print(b)\n exit()\n else:\n print(a)\n ... | ['Time Limit Exceeded', 'Accepted'] | ['s073925418', 's218975422'] | [9112.0, 9264.0] | [2206.0, 30.0] | [502, 904] |
p02641 | u160224209 | 2,000 | 1,048,576 | Given are an integer X and an integer sequence of length N: p_1, \ldots, p_N. Among the integers not contained in the sequence p_1, \ldots, p_N (not necessarily positive), find the 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 = 9999999999\nlists = []\nif n == 0:\n print(x)\n exit()\nfor i in range(101):\n if i not in p:\n print(i)\n lists.append(i)\nfor i in lists:\n if ans > abs(x - i):\n ans = abs(x-i)\n m = i\n\nprint(m)\n... | ['Wrong Answer', 'Runtime Error', 'Accepted'] | ['s122800309', 's475506383', 's424638933'] | [9100.0, 9172.0, 9056.0] | [27.0, 31.0, 35.0] | [301, 304, 292] |
p02641 | u161411695 | 2,000 | 1,048,576 | Given are an integer X and an integer sequence of length N: p_1, \ldots, p_N. Among the integers not contained in the sequence p_1, \ldots, p_N (not necessarily positive), find the 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]: a=X+s*d\n if p.count(a) == 0:\n print(a)\n exit(0)', 'X, N = map(int, input().split())\np = list(map(int, input().split()))\nfor d in range(X + 1):\n for s in [-1, +1]: a=X+s*d\n if p.c... | ['Runtime Error', 'Runtime Error', 'Accepted'] | ['s560666390', 's630949381', 's361637421'] | [9028.0, 9024.0, 9104.0] | [26.0, 25.0, 26.0] | [173, 174, 179] |
p02641 | u165318982 | 2,000 | 1,048,576 | Given are an integer X and an integer sequence of length N: p_1, \ldots, p_N. Among the integers not contained in the sequence p_1, \ldots, p_N (not necessarily positive), find the integer nearest to X, that is, find the integer whose absolute difference with X is the minimum. If there are multiple such integers, repo... | ['X,N = map(int, input().split())\nP = list(map(int, input().split()))\n\ntable = [0] * 102\nans = X\ndist = 102\n\nfor p in range(P):\n table[p] = 1\n\nfor i in range(102):\n if abs(i - X) < dist:\n ans = i\n dist = abs(i - X)\n elif abs(i - X) == dist:\n ans = min(i, ans)\n\nprint(str(ans))', 'X,N = map(i... | ['Runtime Error', 'Runtime Error', 'Accepted'] | ['s769638682', 's827301263', 's113731311'] | [9184.0, 8980.0, 9128.0] | [25.0, 26.0, 29.0] | [286, 302, 312] |
p02641 | u167908302 | 2,000 | 1,048,576 | Given are an integer X and an integer sequence of length N: p_1, \ldots, p_N. Among the integers not contained in the sequence p_1, \ldots, p_N (not necessarily positive), find the 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\nx, n = map(int, input().split())\np = list(map(int, input().split()))\n\n\nif n == 0:\n print(x)\nelse:\n ps = sorted(p)\n tmp = list(range(-201, 200))\n ans_list = list(set(tmp) ^ set(ps))\n ans_list = sorted(ans_list)\n # print(tmp, ans_list)\n diff = []\n\n for i in ans_list... | ['Wrong Answer', 'Accepted'] | ['s074795256', 's377273442'] | [9260.0, 9140.0] | [22.0, 25.0] | [438, 381] |
p02641 | u173644182 | 2,000 | 1,048,576 | Given are an integer X and an integer sequence of length N: p_1, \ldots, p_N. Among the integers not contained in the sequence p_1, \ldots, p_N (not necessarily positive), find the integer nearest to X, that is, find the integer whose absolute difference with X is the minimum. If there are multiple such integers, repo... | ['def main():\n x, n = map(int, input().split())\n p = list(map(int, input().split()))\n _near = 0\n for i in range(101):\n if i in p:\n continue\n if abs(abs(_near)) - x > abs(abs(i)-x):\n _near = i\n print(_near)\n\n\nif __name__ == "__main__":\n main()\n', 'def m... | ['Wrong Answer', 'Wrong Answer', 'Accepted'] | ['s327364003', 's521412330', 's880987000'] | [9200.0, 9180.0, 9180.0] | [24.0, 22.0, 23.0] | [295, 317, 296] |
p02641 | u174831560 | 2,000 | 1,048,576 | Given are an integer X and an integer sequence of length N: p_1, \ldots, p_N. Among the integers not contained in the sequence p_1, \ldots, p_N (not necessarily positive), find the 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 readInts():\n return list(map(int, input().split()))\n\ndef main():\n a = input()\n a =a.split(" ")\n p = readInts()\n x = int(a[0])\n n = int(a[1])\n i= x -1\n j = x + 1\n \n while i not in p:\n i -=1\n \n while j not in p:\n j += 1\n \n if abs(x-i) <= abs(x-j):\n print(i)\n else:\n p... | ['Wrong Answer', 'Wrong Answer', 'Accepted'] | ['s373989426', 's737473339', 's695198327'] | [9196.0, 9200.0, 9200.0] | [2205.0, 2205.0, 22.0] | [346, 346, 379] |
p02641 | u175217658 | 2,000 | 1,048,576 | Given are an integer X and an integer sequence of length N: p_1, \ldots, p_N. Among the integers not contained in the sequence p_1, \ldots, p_N (not necessarily positive), find the 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()))\ndif = 1\n\nif(X not in p):\n print(X)\nelse:\n while True:\n if(X-dif not in p):\n dif = dif*(-1)\n break\n elif(X+dif not in p):\n break\n else:\n dif=dif+1\n print(X+dif)... | ['Runtime Error', 'Accepted'] | ['s774362354', 's718862978'] | [8808.0, 9172.0] | [23.0, 28.0] | [303, 301] |
p02641 | u175590965 | 2,000 | 1,048,576 | Given are an integer X and an integer sequence of length N: p_1, \ldots, p_N. Among the integers not contained in the sequence p_1, \ldots, p_N (not necessarily positive), find the integer nearest to X, that is, find the integer whose absolute difference with X is the minimum. If there are multiple such integers, repo... | ['x,n = map(int,input()split())\np = list(map(int,input().split()))\nfor i in range(101):\n if x-i not in p:\n print(x-i)\n exit()\n elif x+i not in p:\n print(x+i)\n exit()\n', 'x,n = map(int,input()split())\np = lsit(map(int,input().split()))\nfor i in range(101):\n if x-i not in p:\n... | ['Runtime Error', 'Runtime Error', 'Accepted'] | ['s449960147', 's914298236', 's781392126'] | [9008.0, 8948.0, 9172.0] | [26.0, 23.0, 27.0] | [194, 194, 199] |
p02641 | u179376941 | 2,000 | 1,048,576 | Given are an integer X and an integer sequence of length N: p_1, \ldots, p_N. Among the integers not contained in the sequence p_1, \ldots, p_N (not necessarily positive), find the integer nearest to X, that is, find the integer whose absolute difference with X is the minimum. If there are multiple such integers, repo... | ['n, m = map(int, input().split())\nif m == 0:\n lst = []\nelse:\n lst = [int(i) for i in k.split()]\n\nnums = []\nmin_num = 1000\nfor i in range(1, 101):\n if i in lst:\n continue\n l = abs(i - n)\n if l < min_num:\n min_num = l\n nums.append(i)\n elif l > min_num:\n break\nprint(nums[-1])', 'n, m = ... | ['Runtime Error', 'Accepted'] | ['s933581994', 's266483301'] | [9116.0, 9052.0] | [29.0, 26.0] | [290, 282] |
p02641 | u180172332 | 2,000 | 1,048,576 | Given are an integer X and an integer sequence of length N: p_1, \ldots, p_N. Among the integers not contained in the sequence p_1, \ldots, p_N (not necessarily positive), find the 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\ninput()\n\ndef no_Divisible(num,num_list):\n for row in set(num_list):\n if num%row==0:\n return 0\n return 1\n\ninput_list = np.array(sorted(list(map(lambda x:int(x),input().split(" "))),reverse=True))\ncount = 0\nprev_num = 0\nfor i,num in enumerate(input_list):\n if n... | ['Runtime Error', 'Accepted'] | ['s738754816', 's904496923'] | [27148.0, 9196.0] | [119.0, 23.0] | [520, 326] |
p02641 | u181159654 | 2,000 | 1,048,576 | Given are an integer X and an integer sequence of length N: p_1, \ldots, p_N. Among the integers not contained in the sequence p_1, \ldots, p_N (not necessarily positive), find the integer nearest to X, that is, find the integer whose absolute difference with X is the minimum. If there are multiple such integers, repo... | ['X, N = map(int, input().split())\np = list(map(int, input().split()))\n\nif N == 0:\n print(X)\nelse:\n p = sorted(p)\n for i in range(0, 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().... | ['Wrong Answer', 'Accepted'] | ['s360318237', 's016908782'] | [9184.0, 9188.0] | [18.0, 23.0] | [243, 279] |
p02641 | u181644161 | 2,000 | 1,048,576 | Given are an integer X and an integer sequence of length N: p_1, \ldots, p_N. Among the integers not contained in the sequence p_1, \ldots, p_N (not necessarily positive), find the 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=101\nif x in p:\n for i in range(102):\n if i in p:\n continue\n ans=min(ans,abs(p[i]-x))\n if x+ans in p:\n ans*=-1\nelse:\n ans=0\nprint(x+ans)\n', 'x,N=map(int,input().split())\np=list(map(int,input().split... | ['Runtime Error', 'Accepted'] | ['s137167495', 's470781468'] | [9192.0, 9184.0] | [20.0, 25.0] | [243, 240] |
p02641 | u183840468 | 2,000 | 1,048,576 | Given are an integer X and an integer sequence of length N: p_1, \ldots, p_N. Among the integers not contained in the sequence p_1, \ldots, p_N (not necessarily positive), find the 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 = [int(i) for i in input().split()]\nl = {int(i) for i in input().split()}\n\nxl = {int(i) for i in range(x+2)}\n\nans_list = list(xl - l)\n\nans = bisect.bisect_right(ans_list,x)\n\nprint(ans_list[ans-1] if ans != 0 else ans[1])\n\n\n\n', 'x,n = [int(i) for i in input().split()]\nl = [int(i) for i... | ['Wrong Answer', 'Accepted'] | ['s380423451', 's905180505'] | [9120.0, 9188.0] | [31.0, 27.0] | [242, 232] |
p02641 | u184661160 | 2,000 | 1,048,576 | Given are an integer X and an integer sequence of length N: p_1, \ldots, p_N. Among the integers not contained in the sequence p_1, \ldots, p_N (not necessarily positive), find the 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())\nls=inp()\nls.sort()\nif n==0:\n print(x)\n exit(0)\nelse:\n a=x-1\n b=x+1\n flag=False\n while(not flag):\n if a not in ls:\n print(a)\n exit(0)\n else:\n a-=1\n if b not in ls:\n print(b)\n exi... | ['Runtime Error', 'Runtime Error', 'Accepted'] | ['s969731226', 's974723920', 's911895881'] | [9196.0, 9208.0, 9192.0] | [27.0, 22.0, 22.0] | [335, 301, 255] |
p02641 | u185350737 | 2,000 | 1,048,576 | Given are an integer X and an integer sequence of length N: p_1, \ldots, p_N. Among the integers not contained in the sequence p_1, \ldots, p_N (not necessarily positive), find the 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=x\njudge=True\nif(n!=0):\n p=list(map(int, input().split()))\nelse:\n ans=x\n judge=False\n\nif(judge):\n check=True\n s_list=[]\n l_list=[]\n for i in range(n):\n for j in range(n):\n if(x-i==p[j]):\n check=False\n if(check):\n s_list.append(x-i)\n ... | ['Runtime Error', 'Runtime Error', 'Wrong Answer', 'Accepted'] | ['s334888190', 's435513251', 's680491436', 's739311951'] | [9188.0, 9212.0, 9228.0, 9256.0] | [122.0, 117.0, 34.0, 136.0] | [732, 689, 630, 828] |
p02641 | u187462782 | 2,000 | 1,048,576 | Given are an integer X and an integer sequence of length N: p_1, \ldots, p_N. Among the integers not contained in the sequence p_1, \ldots, p_N (not necessarily positive), find the 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()]\n\nif n = 0:\n print(x)\n exit()\n\nP = [int(x) for x in input().split()]\n\nbefore = x\nafter = x\nwhile True:\n if before not in P:\n print(before)\n break\n elif after not in P:\n print(after)\n break\n before -= 1\n after += 1\... | ['Runtime Error', 'Accepted'] | ['s188180167', 's424680350'] | [9008.0, 9180.0] | [20.0, 21.0] | [300, 301] |
p02641 | u188305619 | 2,000 | 1,048,576 | Given are an integer X and an integer sequence of length N: p_1, \ldots, p_N. Among the integers not contained in the sequence p_1, \ldots, p_N (not necessarily positive), find the integer nearest to X, that is, find the integer whose absolute difference with X is the minimum. If there are multiple such integers, repo... | ['X, N = map(int, input().split())\np = list(map(int, input().split()))\nprint(X,N,p)\n\nnot_in_p = list(range(1,101))\nfor pn in p:\n if pn in not_in_p:\n not_in_p.remove(pn)\nprint(not_in_p)\n\ndiff_p = []\nfor not_in_pn in not_in_p:\n diff_p.append(abs(not_in_pn - X))\nmin_value_index = [j for j, value... | ['Wrong Answer', 'Accepted'] | ['s303944292', 's247276199'] | [9216.0, 9192.0] | [23.0, 20.0] | [529, 304] |
p02641 | u188827677 | 2,000 | 1,048,576 | Given are an integer X and an integer sequence of length N: p_1, \ldots, p_N. Among the integers not contained in the sequence p_1, \ldots, p_N (not necessarily positive), find the 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\na = 0\nfor i in range(x-1, -1, -1):\n if i not in p:\n a = i\n exit()\nb = 0\nfor i in range(x, 101):\n if i not in p:\n b = i\n break\n\nif abs(x-a) <= abs(x-b):\n print(a)\nelse:\n print(b)', 'x... | ['Wrong Answer', 'Accepted'] | ['s402021664', 's576122128'] | [9204.0, 9084.0] | [21.0, 22.0] | [293, 177] |
p02641 | u190178779 | 2,000 | 1,048,576 | Given are an integer X and an integer sequence of length N: p_1, \ldots, p_N. Among the integers not contained in the sequence p_1, \ldots, p_N (not necessarily positive), find the 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()))\nif X < 1 or 100 < X:\n sys.exit()\nif N < 0 or 100 < N:\n sys.exit()\n\nP_number = len(P)\nif P_number < 1 or 100 < P_number:\n sys.exit()\n\nres = [100,100]\ni = 0\nwhile i < N:\n if res[0] > abs(X - P[i]) and res[1] > P[i]... | ['Wrong Answer', 'Runtime Error', 'Wrong Answer', 'Runtime Error', 'Accepted'] | ['s194885312', 's750408217', 's798677951', 's907066252', 's844962419'] | [9212.0, 9140.0, 9212.0, 9056.0, 9108.0] | [24.0, 27.0, 26.0, 24.0, 29.0] | [381, 316, 381, 557, 570] |
p02641 | u190850294 | 2,000 | 1,048,576 | Given are an integer X and an integer sequence of length N: p_1, \ldots, p_N. Among the integers not contained in the sequence p_1, \ldots, p_N (not necessarily positive), find the 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 _typeshed import ReadableBuffer\nimport sys\ndef LI(): return list(map(int, sys.stdin.buffer.readline().split()))\ndef I(): return int(sys.stdin.buffer.readline())\ndef LS(): return sys.stdin.buffer.readline().rstrip().decode('utf-8').split()\ndef S(): return sys.stdin.buffer.readline().rstrip().decode('utf-8')\... | ['Runtime Error', 'Accepted'] | ['s049885782', 's673225465'] | [9160.0, 9264.0] | [28.0, 33.0] | [916, 1197] |
p02641 | u192433528 | 2,000 | 1,048,576 | Given are an integer X and an integer sequence of length N: p_1, \ldots, p_N. Among the integers not contained in the sequence p_1, \ldots, p_N (not necessarily positive), find the 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(input()) for i in range(N)]\n\nL = sorted([abs(X-p) for p in P])\nif 0 not in L :\n print(X)\n exit()\n\nDL = list(set([x for x in L if L.count(x) > 1]))\n\nans_abs = 1\nfor i,x in enumerate(DL) :\n if x == i+1 :\n ans_abs += 1\n else :\n break\n\nif ... | ['Runtime Error', 'Accepted'] | ['s410139356', 's873418779'] | [9184.0, 9220.0] | [26.0, 28.0] | [367, 419] |
p02641 | u197968862 | 2,000 | 1,048,576 | Given are an integer X and an integer sequence of length N: p_1, \ldots, p_N. Among the integers not contained in the sequence p_1, \ldots, p_N (not necessarily positive), find the 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 quit()\n\np.sort()\nd = 10 ** 9\nfor i in range(-1000,1000):\n if d > abs(i-x) and i not in p:\n d = abs(i-x)\n ans = i\n print(i)\nprint(ans)', 'x, n = map(int,input().split())\nif n ... | ['Wrong Answer', 'Accepted'] | ['s767224592', 's997104073'] | [9168.0, 9192.0] | [25.0, 24.0] | [262, 245] |
p02641 | u201986772 | 2,000 | 1,048,576 | Given are an integer X and an integer sequence of length N: p_1, \ldots, p_N. Among the integers not contained in the sequence p_1, \ldots, p_N (not necessarily positive), find the 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=sorted(list(map(int,input().split())))\nif n==0:\n print(x)\n exit()\nelse:\n for i in range(100):\n aa=x-i\n if aa not in a:\n print(aa)\n exit()\n bb=x+i\n if bb not in a:\n print(bb)\n exit()\n \n ', 'x,n=map(int,input().split())\na=sorted(l... | ['Runtime Error', 'Accepted'] | ['s626242711', 's078815948'] | [8820.0, 9136.0] | [26.0, 24.0] | [258, 247] |
p02641 | u203383537 | 2,000 | 1,048,576 | Given are an integer X and an integer sequence of length N: p_1, \ldots, p_N. Among the integers not contained in the sequence p_1, \ldots, p_N (not necessarily positive), find the 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 = [int(input()) for i in range(n)]\ns = 1000000000\n\nfor i in range(1,101):\n if i in p:\n continue\n s = min(abs(x-i),s)\n \n\nif not x-s in p:\n print(x - s)\nelse:\n print(x + s)', 'x,n = map(int,input().split())\n\nif n != 0:\n p = list(map(int,input()... | ['Runtime Error', 'Accepted'] | ['s002893067', 's464777655'] | [9188.0, 9196.0] | [21.0, 23.0] | [226, 273] |
p02641 | u214209871 | 2,000 | 1,048,576 | Given are an integer X and an integer sequence of length N: p_1, \ldots, p_N. Among the integers not contained in the sequence p_1, \ldots, p_N (not necessarily positive), find the 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())\nplist = list(map(int, input().split()))\n\nlist = []\n\na = x\nwhile True:\n if not a in plist:\n list.append(a)\n break\n a += 1\n\nb = x-1\nwhile True:\n if not b in plist:\n list.append(b)\n break\n b -= 1\n\nprint(min(list))\n', 'x, n = map... | ['Wrong Answer', 'Accepted'] | ['s447355890', 's474661320'] | [9140.0, 9168.0] | [28.0, 25.0] | [284, 322] |
p02641 | u218108604 | 2,000 | 1,048,576 | Given are an integer X and an integer sequence of length N: p_1, \ldots, p_N. Among the integers not contained in the sequence p_1, \ldots, p_N (not necessarily positive), find the 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# from collections import deque\n# from collections import Counter\n# from math import sqrt\n# from math import log\n# from math import ceil\n\n\n# \tif(a==0):\n# \t\treturn b \n\n\n\n\n# \tp=2\n# \twhile(p*p<=n): \n\n\n\n# \t\tp+=1\n\n\n# \ts=set()\n\n\n# \t\ts.add(i)\n\n\n# alpha=['a', 'b', 'c', 'd', 'e... | ['Wrong Answer', 'Wrong Answer', 'Accepted'] | ['s006759815', 's200447445', 's276781631'] | [9108.0, 9136.0, 9216.0] | [24.0, 2206.0, 20.0] | [1251, 1243, 1251] |
p02641 | u221272125 | 2,000 | 1,048,576 | Given are an integer X and an integer sequence of length N: p_1, \ldots, p_N. Among the integers not contained in the sequence p_1, \ldots, p_N (not necessarily positive), find the 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()))\n for i in range(100):\n x = X - i\n y = X - i\n if x not in A:\n print(x)\n quit()\n if y not in A:\n print(y)\n quit()\nelse:\n print(N)\n', 'X,N = map(int,input())\nif N > 0:\n A = lis... | ['Runtime Error', 'Runtime Error', 'Accepted'] | ['s558921485', 's658152602', 's518530482'] | [9144.0, 9180.0, 9144.0] | [22.0, 22.0, 23.0] | [254, 245, 371] |
p02641 | u221998589 | 2,000 | 1,048,576 | Given are an integer X and an integer sequence of length N: p_1, \ldots, p_N. Among the integers not contained in the sequence p_1, \ldots, p_N (not necessarily positive), find the 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#from numba import njit\n\ndef getVar():\n return map(int, input().split())\ndef getArray():\n return np.array(list(map(int, input().split())))\n\n(X,N) = getVar()\np = getArray()\n\nif (len(p) == 0):\n print(X)\nelse:\n subp = p - X\n i = 0\n while (True):\n if (not i in subp):\n ... | ['Time Limit Exceeded', 'Wrong Answer', 'Accepted'] | ['s329798834', 's393323420', 's624592702'] | [26860.0, 27192.0, 27224.0] | [2206.0, 119.0, 122.0] | [322, 333, 393] |
p02641 | u223215060 | 2,000 | 1,048,576 | Given are an integer X and an integer sequence of length N: p_1, \ldots, p_N. Among the integers not contained in the sequence p_1, \ldots, p_N (not necessarily positive), find the 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_str = input().split()\nlist = []\nfor i in p_str :\n p = int(i)\n list.append(p)\n\nif not x in list :\n print(x)\nelse :\n for i in range(101):\n y = x - i\n if not y in list :\n print(y)\n break\n z = x + i\n if ... | ['Runtime Error', 'Accepted'] | ['s587280009', 's971263143'] | [9220.0, 9144.0] | [25.0, 23.0] | [366, 394] |
p02641 | u228636605 | 2,000 | 1,048,576 | Given are an integer X and an integer sequence of length N: p_1, \ldots, p_N. Among the integers not contained in the sequence p_1, \ldots, p_N (not necessarily positive), find the 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 = []\nif N == 0:\n print(X)\nelif X not in p:\n print(X)\nelse:\n p = sorted(p)\n p2 = [abs(i-X) for i in p]\n\n for i in range(p[p2.index(min(p2))],101):\n if i not in p:\n ans.append(i)\n break\n ... | ['Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Accepted'] | ['s049938068', 's459508305', 's615502867', 's580946795'] | [9228.0, 9100.0, 9220.0, 9224.0] | [27.0, 21.0, 23.0, 23.0] | [587, 564, 564, 521] |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.