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 |
|---|---|---|---|---|---|---|---|---|---|---|
p02720 | u645436608 | 2,000 | 1,048,576 | A positive integer X is said to be a lunlun number if and only if the following condition is satisfied: * In the base ten representation of X (without leading zeros), for every pair of two adjacent digits, the absolute difference of those digits is at most 1. For example, 1234, 1, and 334 are lunlun numbers, while ... | ['import numpy as np\nK = input()\nlunlun_number = [[1, 2, 3, 4, 5, 6, 7, 8, 9]]\nfor _ in range(9):\n tmp = []\n for n in lunlun_number[-1]:\n if n % 10 != 0: \n tmp.append(n * 10 + (n % 10 - 1))\n tmp.append(n * 10 + (n % 10))\n if n % 10 != 9: \n tmp.append(n * 10 +... | ['Runtime Error', 'Accepted'] | ['s171629573', 's058496372'] | [21168.0, 29592.0] | [223.0, 358.0] | [621, 650] |
p02720 | u646412443 | 2,000 | 1,048,576 | A positive integer X is said to be a lunlun number if and only if the following condition is satisfied: * In the base ten representation of X (without leading zeros), for every pair of two adjacent digits, the absolute difference of those digits is at most 1. For example, 1234, 1, and 334 are lunlun numbers, while ... | ['k = int(input())\na = [i for i in range(1, 10)]\nwhile True:z\n if k <= len(a):\n print(a[k-1])\n exit()\n k -= len(a)\n old = []\n old, a = a, old\n for i in range(len(old)):\n for j in range(-1, 2):\n d = old[i]%10+j\n if d >= 0 and d <= 9:\n ... | ['Runtime Error', 'Accepted'] | ['s511949090', 's110116184'] | [2940.0, 11028.0] | [17.0, 139.0] | [327, 326] |
p02720 | u667024514 | 2,000 | 1,048,576 | A positive integer X is said to be a lunlun number if and only if the following condition is satisfied: * In the base ten representation of X (without leading zeros), for every pair of two adjacent digits, the absolute difference of those digits is at most 1. For example, 1234, 1, and 334 are lunlun numbers, while ... | ['n=int(input())\nnow=[1,2,3,4,5,6,7,8,9]\nif n<10:\n print(now[n-1])\n exit()\ncnt=9\nwhile True:\n next=[]\n for s in now:\n s=str(s)\n if s[-1]!=0:\n cnt+=1\n if cnt<n:\n next.append(s+"0")\n else:\n print(s+"0")\n exit()\n cnt+=1\n if cnt<n:\n next.append(s+s... | ['Wrong Answer', 'Runtime Error', 'Accepted'] | ['s257238688', 's528308746', 's154428946'] | [8756.0, 3064.0, 8596.0] | [65.0, 17.0, 95.0] | [480, 541, 541] |
p02720 | u673338219 | 2,000 | 1,048,576 | A positive integer X is said to be a lunlun number if and only if the following condition is satisfied: * In the base ten representation of X (without leading zeros), for every pair of two adjacent digits, the absolute difference of those digits is at most 1. For example, 1234, 1, and 334 are lunlun numbers, while ... | ['import queue\nk = int(input())\nq = queue.Queue([1,2,3,4,5,6,7,8,9])\nc = 1\nwhile True:\n x = q.get()\n if c == k:\n print(x)\n exit()\n if x%10 == 0:\n q.put(10*x)\n q.put(10*x+1)\n elif x%10 == 0:\n q.put(10*x+8)\n q.put(10*x+9)\n else:\n i = x%10\n q.put(10*x+i-1)\n q.put(10*x+i)\n... | ['Time Limit Exceeded', 'Accepted'] | ['s553728242', 's824811260'] | [3952.0, 7172.0] | [2108.0, 52.0] | [343, 304] |
p02720 | u673355261 | 2,000 | 1,048,576 | A positive integer X is said to be a lunlun number if and only if the following condition is satisfied: * In the base ten representation of X (without leading zeros), for every pair of two adjacent digits, the absolute difference of those digits is at most 1. For example, 1234, 1, and 334 are lunlun numbers, while ... | ['import sys\n\nK = int(input())\n\nNLUNLUN = [[-1 for _ in range(11)] for _ in range(10)]\ndef num_lunlun(n, digit):\n if digit == 1:\n NLUNLUN[n][digit] = 1\n return NLUNLUN[n][digit]\n\n if digit == 2:\n if 0 < n < 9:\n NLUNLUN[n][digit] = 3\n else:\n NLUNLUN[n... | ['Runtime Error', 'Accepted'] | ['s091318685', 's092752700'] | [3188.0, 3316.0] | [18.0, 20.0] | [1746, 1848] |
p02720 | u674574659 | 2,000 | 1,048,576 | A positive integer X is said to be a lunlun number if and only if the following condition is satisfied: * In the base ten representation of X (without leading zeros), for every pair of two adjacent digits, the absolute difference of those digits is at most 1. For example, 1234, 1, and 334 are lunlun numbers, while ... | ['K = int(input())\n\ndp = [[0 for i in range(10)] for j in range(100)]\n\nfor i in range(10):\n dp[1][i] = i\ndp[1][0] = 1\n\np = 1\nc = 0\na = 0\n\nwhile c == 0:\n for n in range(10):\n if n != 0 and n != 9:\n dp[p+1][n] = dp[p][n]+dp[p][n-1]+dp[p][n+1]+dp[p][9]\n if n == 9:\n dp[p+1][n] = dp[p][n]+... | ['Wrong Answer', 'Accepted'] | ['s796196598', 's191242095'] | [3188.0, 11872.0] | [2104.0, 131.0] | [903, 249] |
p02720 | u674959776 | 2,000 | 1,048,576 | A positive integer X is said to be a lunlun number if and only if the following condition is satisfied: * In the base ten representation of X (without leading zeros), for every pair of two adjacent digits, the absolute difference of those digits is at most 1. For example, 1234, 1, and 334 are lunlun numbers, while ... | ['k=int(input())\nx=0\nans=0\nfor i in range(10**5):\n ans+=1\n l = [int(x) for x in list(str(i))]\n if x==k:\n break\n for j in range(int(len(l))-1):\n if l[j]==l[j+1] or l[j]==l[j+1]+1 or l[j]==l[j+1]-1:\n x+=1\n \nprint(ans)', 'k=int(input())\na=list(range(1, 10))\nb=[]\nn=int(len(a))\nx=k\nwhile... | ['Wrong Answer', 'Accepted'] | ['s313444010', 's053461811'] | [3064.0, 12184.0] | [465.0, 504.0] | [233, 217] |
p02720 | u678167152 | 2,000 | 1,048,576 | A positive integer X is said to be a lunlun number if and only if the following condition is satisfied: * In the base ten representation of X (without leading zeros), for every pair of two adjacent digits, the absolute difference of those digits is at most 1. For example, 1234, 1, and 334 are lunlun numbers, while ... | ["K = int(input())\n\nlis = [[0]*12 for _ in range(10)]\nlis[9] = [0,3,3,3,3,3,3,3,3,3,2,0]\nfor i in range(8,-1,-1):\n for j in range(1,11):\n lis[i][j] = lis[i+1][j-1] + lis[i+1][j] + lis[i+1][j+1]\n\nnew_lis = [[0]*10 for _ in range(10)]\nnew_lis[9] = [9,3,3,3,3,3,3,3,3,2]\nfor i in range(8,-1,-1):\n for j in r... | ['Wrong Answer', 'Accepted'] | ['s297505364', 's407585685'] | [3064.0, 17012.0] | [18.0, 199.0] | [804, 318] |
p02720 | u680851063 | 2,000 | 1,048,576 | A positive integer X is said to be a lunlun number if and only if the following condition is satisfied: * In the base ten representation of X (without leading zeros), for every pair of two adjacent digits, the absolute difference of those digits is at most 1. For example, 1234, 1, and 334 are lunlun numbers, while ... | ['n = int(input())\nl = [_ for _ in range(1,10)]\n\ncnt = 9\nd = [-1, 0, 1]\nfor i in range(10**5):\n if cnt >= n: break\n for j in d:\n if 0 <= int(str(l[i])[-1]) + j <= 9:\n l.append(l[i]*10 + l[i][-1] + j)\n cnt += 1\n\nprint(l[n-1])\n', "from collections import deque\n \nn = int(i... | ['Runtime Error', 'Accepted'] | ['s970325607', 's420074868'] | [9208.0, 54020.0] | [27.0, 233.0] | [258, 831] |
p02720 | u684267998 | 2,000 | 1,048,576 | A positive integer X is said to be a lunlun number if and only if the following condition is satisfied: * In the base ten representation of X (without leading zeros), for every pair of two adjacent digits, the absolute difference of those digits is at most 1. For example, 1234, 1, and 334 are lunlun numbers, while ... | ['ans=0\nrunrun = 0\ni =0\nwhile runrun = K:\n if i < 10:\n runrun +=1\n else:\n a = list(map(int,str(i)))\n for j in range(1,len(a)):\n tmp = 0\n if abs(a[j]-a[j-1])<=1:\n tmp +=1\n if tmp == len(a)-1:\n runrun +=1\n ans = i\n... | ['Runtime Error', 'Accepted'] | ['s778980718', 's390387955'] | [2940.0, 15144.0] | [17.0, 112.0] | [342, 613] |
p02720 | u686230543 | 2,000 | 1,048,576 | A positive integer X is said to be a lunlun number if and only if the following condition is satisfied: * In the base ten representation of X (without leading zeros), for every pair of two adjacent digits, the absolute difference of those digits is at most 1. For example, 1234, 1, and 334 are lunlun numbers, while ... | ['k = int(input())\nnum = 0\nfor _ in range(k):\n num += 1\n digit = [int(digit) for digit in str(num)]\n len_digit = len(digit)\n for i in range(1, len_digit):\n if digit[-i] > min(digit[-i-1] + 1, 9):\n digit[-i-1] += 1\n digit[-i] = -1\n elif digit[-i] < digit[-i-1] - 1:\n digit[-i] = -1\n ... | ['Runtime Error', 'Accepted'] | ['s016398654', 's953958066'] | [3064.0, 3064.0] | [18.0, 1083.0] | [517, 487] |
p02720 | u691896522 | 2,000 | 1,048,576 | A positive integer X is said to be a lunlun number if and only if the following condition is satisfied: * In the base ten representation of X (without leading zeros), for every pair of two adjacent digits, the absolute difference of those digits is at most 1. For example, 1234, 1, and 334 are lunlun numbers, while ... | ['import sys\nfrom collections import deque\nsys.setrecursionlimit(10**7)\nk = int(input())\nans = []\ndef bfs(que):\n finished = set()\n while que and len(ans) <= 10**6:\n x = que.popleft()\n ans.append(int(x))\n if x not in finished:\n finished.add(x)\n p = int(x[-1])\... | ['Time Limit Exceeded', 'Accepted'] | ['s290454897', 's898471289'] | [276544.0, 31276.0] | [2120.0, 225.0] | [672, 754] |
p02720 | u692311686 | 2,000 | 1,048,576 | A positive integer X is said to be a lunlun number if and only if the following condition is satisfied: * In the base ten representation of X (without leading zeros), for every pair of two adjacent digits, the absolute difference of those digits is at most 1. For example, 1234, 1, and 334 are lunlun numbers, while ... | ['K=int(input())\nimport queue\na=queue.Queue()\nif K<=9:\n print(K)\nelse:\n for i in range(1,10):\n a.put(i)\n n=K\n while n>1:\n x=a.get()\n if x%10!=0:\n a.put(10*x-1)\n a.put(10*x)\n if x%10!=9:\n a.put(10*x+1)\n n-=1\n ans=a.get()\n print(ans)', 'K=int(input())\nimport queue\na=q... | ['Wrong Answer', 'Accepted'] | ['s052195394', 's120489783'] | [9912.0, 12480.0] | [887.0, 1075.0] | [263, 280] |
p02720 | u692498898 | 2,000 | 1,048,576 | A positive integer X is said to be a lunlun number if and only if the following condition is satisfied: * In the base ten representation of X (without leading zeros), for every pair of two adjacent digits, the absolute difference of those digits is at most 1. For example, 1234, 1, and 334 are lunlun numbers, while ... | ['k=int(input())\nlist=[1,2,3,4,5,6,7,8,9]\nfor i in range(k-1):\n m=list[i]\n n=m*10+m%10\n if m%10!=0:\n list.append(m-1)\n list.append(m)\n if m%10!=9:\n list.append(m+1)\nprint(list[k-1])', 'k=int(input())\nlist=[1,2,3,4,5,6,7,8,9]\nfor i in range(k-1):\n m=list[i]\n n=m*10+m%10\n if m%10!=0:\n lis... | ['Wrong Answer', 'Wrong Answer', 'Accepted'] | ['s447945595', 's739294784', 's493389682'] | [5396.0, 26000.0, 15764.0] | [82.0, 129.0, 99.0] | [190, 202, 190] |
p02720 | u693007703 | 2,000 | 1,048,576 | A positive integer X is said to be a lunlun number if and only if the following condition is satisfied: * In the base ten representation of X (without leading zeros), for every pair of two adjacent digits, the absolute difference of those digits is at most 1. For example, 1234, 1, and 334 are lunlun numbers, while ... | ['\nfrom collections import deque\n\nq = deque(range(1,10))\nK = int(input())\n\nfor i in range(K):\n x = q.popleft()\n r = x % 10\n if r != 0:\n q.append((10 * x) + (r - 1))\n q.append((10 * x) + r)\n if r != 9:\n q.put((10 * x) + (r + 1))\n\nprint(x)', 'from collections import deque\n\nq... | ['Runtime Error', 'Accepted'] | ['s642901416', 's141606315'] | [3316.0, 12404.0] | [20.0, 106.0] | [292, 267] |
p02720 | u696444274 | 2,000 | 1,048,576 | A positive integer X is said to be a lunlun number if and only if the following condition is satisfied: * In the base ten representation of X (without leading zeros), for every pair of two adjacent digits, the absolute difference of those digits is at most 1. For example, 1234, 1, and 334 are lunlun numbers, while ... | ['k = int(input())\n\n#a = list(map(int, input().split()))\nq = deque([1, 2, 3, 4, 5, 6, 7, 8, 9])\nfor i in range(k):\n x = q.popleft()\n a = 10*x+(x % 10)\n if x % 10 != 0:\n q.append(a-1)\n q.append(a)\n if x % 10 != 9:\n q.append(a+1)\n\nprint(x)', 'from collections import deque\nk = in... | ['Runtime Error', 'Accepted'] | ['s788476987', 's884076094'] | [3060.0, 11864.0] | [17.0, 109.0] | [303, 257] |
p02720 | u698849142 | 2,000 | 1,048,576 | A positive integer X is said to be a lunlun number if and only if the following condition is satisfied: * In the base ten representation of X (without leading zeros), for every pair of two adjacent digits, the absolute difference of those digits is at most 1. For example, 1234, 1, and 334 are lunlun numbers, while ... | ["import math\nn,m=map(int,input().split())\na=list(map(int,input().split()))\nt=sum(a)\na=list(filter(lambda x: math.ceil(t/(4*m)) < x, a))\nprint('Yes' if m <= len(a) else 'No')\n", "k=int(input())\nl=list(map(str,range(1,10)))\nfor i in range(k):\n x=l[i][-1]\n if x=='0':\n l.append(l[i]+x)\n l.a... | ['Runtime Error', 'Accepted'] | ['s607617657', 's426537962'] | [2940.0, 35236.0] | [18.0, 216.0] | [173, 360] |
p02720 | u698977701 | 2,000 | 1,048,576 | A positive integer X is said to be a lunlun number if and only if the following condition is satisfied: * In the base ten representation of X (without leading zeros), for every pair of two adjacent digits, the absolute difference of those digits is at most 1. For example, 1234, 1, and 334 are lunlun numbers, while ... | ['print("yippe")', 'import queue\nk = int(input())\nq = [1,2,3,4,5,6,7,8,9]\nqq = queue.Queue()\nfor i in range(1,10):\n\tqq.put(i)\n\nfor i in range(k):\n\tx = qq.get()\n\tif x%10 != 0:\n\t\tqq.put(10*x + (x%10) -1)\n\tqq.put(10*x + (x%10))\n\tif x%10 != 9:\n\t\tqq.put(10*x + (x%10) +1)\n\t\t\nprint(x)\n\t\t'] | ['Wrong Answer', 'Accepted'] | ['s833116304', 's752064459'] | [2940.0, 12452.0] | [17.0, 1049.0] | [14, 261] |
p02720 | u699252226 | 2,000 | 1,048,576 | A positive integer X is said to be a lunlun number if and only if the following condition is satisfied: * In the base ten representation of X (without leading zeros), for every pair of two adjacent digits, the absolute difference of those digits is at most 1. For example, 1234, 1, and 334 are lunlun numbers, while ... | ['k=int(input())\nnum=0\n\nwhile k>0:\n num+=1\n snum=str(num)\n flg=0\n for i in range(0,len(snum)-1):\n if abs(int(snum[i])-int(snum[i+i]))>1:\n flg=1\n break\n if flg==0:\n k-=1\nprint(num)', "k=int(input())\nnum=[-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1]\nketa=0\nfor i in range(0,k):\n for j in range(... | ['Runtime Error', 'Accepted'] | ['s550301506', 's528147443'] | [3064.0, 3064.0] | [20.0, 205.0] | [198, 380] |
p02720 | u700805562 | 2,000 | 1,048,576 | A positive integer X is said to be a lunlun number if and only if the following condition is satisfied: * In the base ten representation of X (without leading zeros), for every pair of two adjacent digits, the absolute difference of those digits is at most 1. For example, 1234, 1, and 334 are lunlun numbers, while ... | ['K = int(input())\n\ndef cal():\n count = 9\n d = [[1,2,3,4,5,6,7,8,9]]\n for i in range(10**9):\n d_ = []\n for j in range(len(d[i])):\n a = str(d[i][j])\n if a[-1]=="0":\n for k in [0,1]:\n d_.append(int(a)*10+k)\n coun... | ['Runtime Error', 'Runtime Error', 'Accepted'] | ['s241366950', 's412092446', 's077140046'] | [3064.0, 3064.0, 6132.0] | [18.0, 17.0, 77.0] | [965, 965, 393] |
p02720 | u703442202 | 2,000 | 1,048,576 | A positive integer X is said to be a lunlun number if and only if the following condition is satisfied: * In the base ten representation of X (without leading zeros), for every pair of two adjacent digits, the absolute difference of those digits is at most 1. For example, 1234, 1, and 334 are lunlun numbers, while ... | ['import heapq\nk = int(input())\nrun_list = [i for i in range(1,10)]\nheapq.heapify(run_list)\nresult = 0\nfor i in range(k):\n result = heapq.pop(run_list)\n if result % 10 ==0:\n new_1 = result * 10\n new_2 = result * 10 + 1\n heapq.heappush(run_list, new_1)\n heapq.heappush(run_list, new_2)\n elif re... | ['Runtime Error', 'Accepted'] | ['s437097969', 's021018013'] | [3064.0, 11708.0] | [17.0, 189.0] | [703, 710] |
p02720 | u704284486 | 2,000 | 1,048,576 | A positive integer X is said to be a lunlun number if and only if the following condition is satisfied: * In the base ten representation of X (without leading zeros), for every pair of two adjacent digits, the absolute difference of those digits is at most 1. For example, 1234, 1, and 334 are lunlun numbers, while ... | ['K = int(input())\na = []\ndef dfs(x):\n if x > 3234566667:\n return\n a.append(x)\n for i in range(10):\n if abs(x%10-i) <= 1:\n dfs(x*10+i)\n\nfor i in range(1,11):\n dfs(i)\na = sorted(a)\nprint(a[K-1])', 'K = int(input())\na = []\ndef dfs(x):\n if x > 3234566667:\n re... | ['Wrong Answer', 'Accepted'] | ['s017360617', 's075120767'] | [8640.0, 8512.0] | [234.0, 232.0] | [228, 228] |
p02720 | u711340028 | 2,000 | 1,048,576 | A positive integer X is said to be a lunlun number if and only if the following condition is satisfied: * In the base ten representation of X (without leading zeros), for every pair of two adjacent digits, the absolute difference of those digits is at most 1. For example, 1234, 1, and 334 are lunlun numbers, while ... | ['import sys\n\nread = sys.stdin.buffer.read\nreadline = sys.stdin.buffer.readline\nreadlines = sys.stdin.buffer.readlines\n\nK = int(read())\n\npre_lis = []\nfor i in range(1,10):\n pre_lis.append(str(i))\nprint(pre_lis)\nct = 9\nif K <= 9:\n print(pre_lis[K-1])\nelse:\n new_lis = []\n flag = False\n wh... | ['Wrong Answer', 'Accepted'] | ['s077620707', 's592514820'] | [10136.0, 10136.0] | [144.0, 154.0] | [812, 760] |
p02720 | u712052023 | 2,000 | 1,048,576 | A positive integer X is said to be a lunlun number if and only if the following condition is satisfied: * In the base ten representation of X (without leading zeros), for every pair of two adjacent digits, the absolute difference of those digits is at most 1. For example, 1234, 1, and 334 are lunlun numbers, while ... | ['# coding: utf-8\nDATA = """\n100000\n""".split("\\n")\n\ndef get_debug_line():\n\tfor i in DATA:\n\t\tyield i\n\nif 1:\n\tget_line = input\nelse:\n\tget_line = get_debug_line().__next__\n\tget_line()\n\n\n\ndef Calc():\n\tK = [int(i) for i in get_line().strip().split(" ")][0]\n\tret = [str(_) for _ in range(1,10)]\n\... | ['Wrong Answer', 'Accepted'] | ['s257335269', 's756278445'] | [10136.0, 10136.0] | [68.0, 69.0] | [715, 700] |
p02720 | u723583932 | 2,000 | 1,048,576 | A positive integer X is said to be a lunlun number if and only if the following condition is satisfied: * In the base ten representation of X (without leading zeros), for every pair of two adjacent digits, the absolute difference of those digits is at most 1. For example, 1234, 1, and 334 are lunlun numbers, while ... | ['k=input()\nn=len(k)\ncnt=9\ndef lunlun(x):\n flag=True\n x=str(x)\n for num in range(len(x)-1):\n a=x[num]\n b=x[num+1]\n if abs(int(a)-int(b))>1:\n flag=False\n break\n return flag\ni=9\nif n==1:\n print(k)\nelse:\n while cnt!=k:\n i+=1\n if ... | ['Time Limit Exceeded', 'Accepted'] | ['s979141461', 's226416452'] | [3060.0, 7140.0] | [2107.0, 62.0] | [342, 401] |
p02720 | u723711163 | 2,000 | 1,048,576 | A positive integer X is said to be a lunlun number if and only if the following condition is satisfied: * In the base ten representation of X (without leading zeros), for every pair of two adjacent digits, the absolute difference of those digits is at most 1. For example, 1234, 1, and 334 are lunlun numbers, while ... | ['K = int(input())\nqueue = []\nfor i in range(1, 10):\n queue.append(i)\n\nwhile K != 0:\n num = queue.pop(0)\n\n if K <= len(queue):\n print(queue[K-1])\n exit(0)\n K -= 1\n\n if K == 0:\n print(num)\n exit(0)\n\n o = int(str(num)[-1])\n for n in [o-1, o, o+1]:\n if n == -1 or n == 10: continue\... | ['Wrong Answer', 'Accepted'] | ['s596603436', 's230836863'] | [5720.0, 5960.0] | [481.0, 143.0] | [339, 320] |
p02720 | u723792785 | 2,000 | 1,048,576 | A positive integer X is said to be a lunlun number if and only if the following condition is satisfied: * In the base ten representation of X (without leading zeros), for every pair of two adjacent digits, the absolute difference of those digits is at most 1. For example, 1234, 1, and 334 are lunlun numbers, while ... | ['k=int(input())\nketa=2\nunta=[[]]*10\nunta[0]=["1","2","3","4","5","6","7","8","9"]\nfor _ in range(9):\n\tfor i in range(len(unta[keta-2])):\n\t\tif unta[keta-2][i][len(unta[keta-2][i])-1]=="0":\n\t\t\tunta[keta-1].append(("").join(unta[keta-2][i])+"0")\n\t\t\tunta[keta-1].append(("").join(unta[keta-2][i])+"1")\n\t\... | ['Time Limit Exceeded', 'Accepted'] | ['s123930806', 's591048397'] | [94036.0, 46060.0] | [2109.0, 555.0] | [846, 685] |
p02720 | u724724669 | 2,000 | 1,048,576 | A positive integer X is said to be a lunlun number if and only if the following condition is satisfied: * In the base ten representation of X (without leading zeros), for every pair of two adjacent digits, the absolute difference of those digits is at most 1. For example, 1234, 1, and 334 are lunlun numbers, while ... | ['K = int(input())\ncount = 0\nlunlun = 0\n\nwhile count < K:\n # count =+ 1\n #print(lunlun)\n ketasu = len(str(lunlun))\n lunlun = lunlun + 1\n flag = 0\n if ketasu == 1:\n count = count + 1\n else:\n for i in range(1, ketasu):\n # print((lunlun%(10**(i+1))//(10**i)), (lunlun%(10**i)))\n if ab... | ['Wrong Answer', 'Accepted'] | ['s429033067', 's997878024'] | [3064.0, 7188.0] | [2107.0, 66.0] | [638, 358] |
p02720 | u736470924 | 2,000 | 1,048,576 | A positive integer X is said to be a lunlun number if and only if the following condition is satisfied: * In the base ten representation of X (without leading zeros), for every pair of two adjacent digits, the absolute difference of those digits is at most 1. For example, 1234, 1, and 334 are lunlun numbers, while ... | ['k = int(input())\nq = []\nfor i in range(1, 10):\n q.append(i)\nfor i in range(k):\n x = q.pop(0)\n if x % 10 != 0:\n q.append(10 * x + x % 10 - 1)\n q.append(10 * x + x % 10)\n if x % 10 != 9:\n q.append(10 * x + x % 10 + 1)\n # print(q)\n', 'from collections import deque\n\n\nk = int... | ['Wrong Answer', 'Accepted'] | ['s298736896', 's604600060'] | [10200.0, 11908.0] | [2104.0, 126.0] | [260, 268] |
p02720 | u736564905 | 2,000 | 1,048,576 | A positive integer X is said to be a lunlun number if and only if the following condition is satisfied: * In the base ten representation of X (without leading zeros), for every pair of two adjacent digits, the absolute difference of those digits is at most 1. For example, 1234, 1, and 334 are lunlun numbers, while ... | ['import queue\nnum=int(input())\nq=queue.Queue()\nfor i in range(1,10):\n q.put(i)\nfor j in range(num):\n ans=q.get()\n if ans%10!=0:\n q.put(10*ans+(ans%10)-1)\n q.put(10*ans+(ans%10)-1)\n if ans%10!=0:\n q.put(10*ans+(ans%10)-1)\nprint(ans)', 'import queue\nnum=int(input())\nq=queue.Queue()\nfor i in ran... | ['Wrong Answer', 'Accepted'] | ['s276507530', 's053769565'] | [10900.0, 12452.0] | [1034.0, 1044.0] | [241, 239] |
p02720 | u738898077 | 2,000 | 1,048,576 | A positive integer X is said to be a lunlun number if and only if the following condition is satisfied: * In the base ten representation of X (without leading zeros), for every pair of two adjacent digits, the absolute difference of those digits is at most 1. For example, 1234, 1, and 334 are lunlun numbers, while ... | ['muri', 'from collections import deque\nk = int(input())\nans = 0\nnum = ["0","1","2","3","4","5","6","7","8","9"]\ndq = deque(["1","2","3","4","5","6","7","8","9"])\n# print(num[k:k+2])\nif k<=12:\n print(k)\nelse:\n while 1:\n ans += 1\n a = dq.popleft()\n if ans == k:\n print(i... | ['Runtime Error', 'Accepted'] | ['s390032910', 's554556483'] | [2940.0, 17012.0] | [17.0, 209.0] | [4, 413] |
p02720 | u745387661 | 2,000 | 1,048,576 | A positive integer X is said to be a lunlun number if and only if the following condition is satisfied: * In the base ten representation of X (without leading zeros), for every pair of two adjacent digits, the absolute difference of those digits is at most 1. For example, 1234, 1, and 334 are lunlun numbers, while ... | ['from collections import deque\n\nq=deque()\n\nN=int(input())\n\nfor i in range(1,10):\n q.append(i)\n\nfor _ in range(N-1):\n x=q.popleft()\n if x%10!=0:\n q.append(10*x+(x%10)-1)\n q.append(10*x+(x%10))\n if x%10!=9:\n q.append(10*x+(x%10)+1)\n\nprint(q.poplefr())', 'from collections import deque\n\nq=deq... | ['Runtime Error', 'Accepted'] | ['s635545623', 's609091667'] | [11908.0, 12384.0] | [134.0, 125.0] | [259, 260] |
p02720 | u745812846 | 2,000 | 1,048,576 | A positive integer X is said to be a lunlun number if and only if the following condition is satisfied: * In the base ten representation of X (without leading zeros), for every pair of two adjacent digits, the absolute difference of those digits is at most 1. For example, 1234, 1, and 334 are lunlun numbers, while ... | ['k = int(input()) \n \n lunlun = [i for i in range(1, 10)]\n \n p = 0 \n\n def generate_lunlun(p):\n last = p % 10\n if last - 1 >= 0:\n yield p * 10 + last - 1\n yield p * 10 + last\n if last + 1 <= 9:\n yield p * 10 + last + 1 \n\nwhile len(lunlun) < k:\n for new_lunlun in generate_lu... | ['Runtime Error', 'Accepted'] | ['s739028047', 's072442656'] | [2940.0, 7272.0] | [18.0, 61.0] | [384, 378] |
p02720 | u753386263 | 2,000 | 1,048,576 | A positive integer X is said to be a lunlun number if and only if the following condition is satisfied: * In the base ten representation of X (without leading zeros), for every pair of two adjacent digits, the absolute difference of those digits is at most 1. For example, 1234, 1, and 334 are lunlun numbers, while ... | ['from collections import deque\n\nk = int(input())\nlimit = 10\n\nstart = [i for i in range(1, 10)]\nans = []\nq=deque(start)\nwhile q:\n\tnum=q.popleft()\n\tif len(str(num))>11:\n\t\tcontinue\n\tans.append(num)\n\tlast=str(num)[-1]\n\tif last == "0":\n\t\tadd = [\'0\', \'1\']\n\telif last == \'9\':\n\t\tadd = [\'8\',... | ['Time Limit Exceeded', 'Accepted'] | ['s032746612', 's139758923'] | [76796.0, 37504.0] | [2207.0, 1594.0] | [532, 514] |
p02720 | u757030836 | 2,000 | 1,048,576 | A positive integer X is said to be a lunlun number if and only if the following condition is satisfied: * In the base ten representation of X (without leading zeros), for every pair of two adjacent digits, the absolute difference of those digits is at most 1. For example, 1234, 1, and 334 are lunlun numbers, while ... | ['a=[]\n\ndef dfs(x):\n if x>3234566667:\n return\n a.append(x)\n for i in range(10):\n if abs(x%10-i) <= 1:\n dfs(x%10+i)\n \nfor i in range(1,10):\n dfs(i)\na =sorted(a)\nk=int(input())\nprint(a[k-1])', 'a = []\n\ndef dfs(x):\n if x > 3234566667:\n return\n a.append(x)\n for i in r... | ['Runtime Error', 'Accepted'] | ['s055083278', 's118597332'] | [3932.0, 8512.0] | [75.0, 252.0] | [206, 231] |
p02720 | u762420987 | 2,000 | 1,048,576 | A positive integer X is said to be a lunlun number if and only if the following condition is satisfied: * In the base ten representation of X (without leading zeros), for every pair of two adjacent digits, the absolute difference of those digits is at most 1. For example, 1234, 1, and 334 are lunlun numbers, while ... | ['from collections import deque\nK = int(input()) - 1\ntodo = deque(range(1, 10))\nans = []\ncounter = 0\nwhile counter <= K:\n seed = todo.pop(0)\n ans.append(seed)\n counter += 1\n last_dig = int(str(seed)[-1])\n for i in range(max(0, last_dig-1), min(10, last_dig+2)):\n todo.append(int(str(seed... | ['Runtime Error', 'Wrong Answer', 'Accepted'] | ['s754010807', 's954670921', 's667039521'] | [3316.0, 12916.0, 14924.0] | [21.0, 2104.0, 416.0] | [334, 333, 337] |
p02720 | u792078574 | 2,000 | 1,048,576 | A positive integer X is said to be a lunlun number if and only if the following condition is satisfied: * In the base ten representation of X (without leading zeros), for every pair of two adjacent digits, the absolute difference of those digits is at most 1. For example, 1234, 1, and 334 are lunlun numbers, while ... | ['K = int(input())\n\nq = [1,2,3,4,5,6,7,8,9]\ni = 0\nn = 0\nwhile n < K:\n x = q[i]\n if x % 10 > 0:\n q.append(x * 10 + x - 1)\n n += 1\n q.append(x * 10 + x)\n n += 1\n if x % 10 < 9:\n q.append(x * 10 + x + 1)\n n += 1\n i += 1\nprint(q[K])', 'K = int(input())\n\nq = [1... | ['Wrong Answer', 'Accepted'] | ['s878580936', 's814914640'] | [7284.0, 7264.0] | [63.0, 58.0] | [272, 279] |
p02720 | u802234211 | 2,000 | 1,048,576 | A positive integer X is said to be a lunlun number if and only if the following condition is satisfied: * In the base ten representation of X (without leading zeros), for every pair of two adjacent digits, the absolute difference of those digits is at most 1. For example, 1234, 1, and 334 are lunlun numbers, while ... | ['K = int(input())\ni = 10\nl= 0\nlunlunlist = []\n\nwhile all:\n l += 1 \n lunlunlist.append(l)\n if(l == 9):\n break\n \nwhile all:\n if(len(lunlunlist)>=K):\n break\n i_str = str(i)\n array = list(map(int,i_str))\n j=0\n f=0\n for j in range(len(array)-1):\n if(abs(... | ['Wrong Answer', 'Accepted'] | ['s797925631', 's735104194'] | [3188.0, 21488.0] | [2104.0, 152.0] | [482, 1647] |
p02720 | u806779442 | 2,000 | 1,048,576 | A positive integer X is said to be a lunlun number if and only if the following condition is satisfied: * In the base ten representation of X (without leading zeros), for every pair of two adjacent digits, the absolute difference of those digits is at most 1. For example, 1234, 1, and 334 are lunlun numbers, while ... | ['from collections import deque\n\nk = int(input())\nq = deque([1,2,3,4,5,6,7,8,9])\n\nfor i in range(1,k):\n l = q.popleft()\n m = l % 10\n if (m != 0):\n q.append(l * 10 + m - 1)\n q.append(l * 10 + m)\n if (m != 9):\n q.append(l * 10 + m + 1)\n\nprint(q.pop())', 'from collections import ... | ['Wrong Answer', 'Accepted'] | ['s479447331', 's440387590'] | [11968.0, 8040.0] | [108.0, 95.0] | [276, 325] |
p02720 | u821441703 | 2,000 | 1,048,576 | A positive integer X is said to be a lunlun number if and only if the following condition is satisfied: * In the base ten representation of X (without leading zeros), for every pair of two adjacent digits, the absolute difference of those digits is at most 1. For example, 1234, 1, and 334 are lunlun numbers, while ... | ['import sys\n\npassed = set()\n\ndef check(x, y):\n if x == y:\n return True\n z = abs(x - y)\n return True if z <= 1 else False\n\ndef lunlun(x):\n sx = str(x)\n ix = x\n for i in range(len(sx) - 1):\n if ix in passed:\n return True\n if check(int(sx[0]), int(sx[1])):... | ['Wrong Answer', 'Accepted'] | ['s729697153', 's957633451'] | [3316.0, 11976.0] | [2104.0, 103.0] | [588, 307] |
p02720 | u825378567 | 2,000 | 1,048,576 | A positive integer X is said to be a lunlun number if and only if the following condition is satisfied: * In the base ten representation of X (without leading zeros), for every pair of two adjacent digits, the absolute difference of those digits is at most 1. For example, 1234, 1, and 334 are lunlun numbers, while ... | ['K=int(input())\nans=9\ndp=[[0]*10 for i in range(10)]\ndp[0]=[1]*10\nflag=0\nindex,r=0,0\nfor j in range(1,10):\n for i in range(10):\n tmp=0\n tmp+=dp[j-1][i]\n if i-1>=0:\n tmp+=dp[j-1][i-1]\n if i+1<=9:\n tmp+=dp[j-1][i+1]\n dp[j][i]=tmp\n if i!=0:... | ['Wrong Answer', 'Accepted'] | ['s955275184', 's691420149'] | [3064.0, 11908.0] | [19.0, 131.0] | [813, 268] |
p02720 | u827554201 | 2,000 | 1,048,576 | A positive integer X is said to be a lunlun number if and only if the following condition is satisfied: * In the base ten representation of X (without leading zeros), for every pair of two adjacent digits, the absolute difference of those digits is at most 1. For example, 1234, 1, and 334 are lunlun numbers, while ... | ['# coding: utf-8\n# Your code here!\n\nk = int(input())\n\nlunlun = []\n\nend = False\nwhile True:\n val = 0\n while True:\n val += 1\n val_list = [int(x) for x in list(str(val))]\n is_lun = True \n for x in range(len(val_list) - 1):\n if abs(val_list[x] - val_list[x + 1]) ... | ['Runtime Error', 'Accepted'] | ['s638016275', 's625725859'] | [3064.0, 9072.0] | [18.0, 172.0] | [586, 414] |
p02720 | u829249049 | 2,000 | 1,048,576 | A positive integer X is said to be a lunlun number if and only if the following condition is satisfied: * In the base ten representation of X (without leading zeros), for every pair of two adjacent digits, the absolute difference of those digits is at most 1. For example, 1234, 1, and 334 are lunlun numbers, while ... | ['K=int(input())\nANS=[]\nfor i in range(1,10**5):\n LEN=len(str(i))\n STR=str(i)\n if LEN==1:\n ANS+=[i]\n for k in range(LEN-1):\n if abs(int(STR[k])-int(STR[k+1]))>1:\n break\n if k==LEN-2:\n ANS+=[i]\ni=10**5\nwhile i<10**7:\n LEN=len(str(i))\n STR=str(i)\n if LEN==1:\n ANS+=[i]\n for ... | ['Time Limit Exceeded', 'Time Limit Exceeded', 'Time Limit Exceeded', 'Time Limit Exceeded', 'Accepted'] | ['s208591893', 's595606866', 's608979515', 's991168655', 's020158864'] | [14412.0, 9100.0, 9188.0, 9176.0, 13260.0] | [2206.0, 2206.0, 2205.0, 2205.0, 66.0] | [452, 240, 240, 240, 311] |
p02720 | u841599623 | 2,000 | 1,048,576 | A positive integer X is said to be a lunlun number if and only if the following condition is satisfied: * In the base ten representation of X (without leading zeros), for every pair of two adjacent digits, the absolute difference of those digits is at most 1. For example, 1234, 1, and 334 are lunlun numbers, while ... | ['K=int(input())\nn=0\nc=0\nwhile 1:\n j=True\n if len(n_str) > 1 and abs(int(n_str[0]) - int(n_str[1])) > 1:\n n = (int(str(int(n_str[0])+1)+str(int(n_str[0]))))*(10**(len(n_str)-2))\n else:\n n+=1\n n_str=str(n)\n for i in range(len(n_str)-1):\n if abs(int(n_str[i]) - int(n_str[i+1])) > 1:\n j=Fa... | ['Runtime Error', 'Accepted'] | ['s199222192', 's353773371'] | [2940.0, 11908.0] | [17.0, 122.0] | [361, 221] |
p02720 | u846226907 | 2,000 | 1,048,576 | A positive integer X is said to be a lunlun number if and only if the following condition is satisfied: * In the base ten representation of X (without leading zeros), for every pair of two adjacent digits, the absolute difference of those digits is at most 1. For example, 1234, 1, and 334 are lunlun numbers, while ... | ['from collections import deque\n\nK = int(input())\n\ndq = deque(list(range(1,10)))\n\nrep = 0\n\nwhile rep < K:\n now = dq.popleft()\n rep += 1\n for i in (-1,0,1):\n if 0 <= now%10+1<10:\n dq.append(now*10+now*10+i)\n\nprint(now)', 'from collections import deque\n\nK = int(input())\n\ndq =... | ['Wrong Answer', 'Wrong Answer', 'Accepted'] | ['s208681491', 's344966980', 's844068245'] | [7820.0, 7840.0, 12404.0] | [152.0, 136.0, 147.0] | [242, 235, 239] |
p02720 | u861141787 | 2,000 | 1,048,576 | A positive integer X is said to be a lunlun number if and only if the following condition is satisfied: * In the base ten representation of X (without leading zeros), for every pair of two adjacent digits, the absolute difference of those digits is at most 1. For example, 1234, 1, and 334 are lunlun numbers, while ... | ['\nk = int(input())\na = [i+1 for i in range(9)]\n\n\nwhile 1:\n if k <= len(a):\n print(a[k-1])\n exit()\n k -= len(a)\n old = []\n a, old = old, a\n for x in old:\n for i in range(-1, 2):\n d = x % 10 + i\n if d < 0 or d > 9: continue\n nx = x*10 +... | ['Wrong Answer', 'Accepted'] | ['s018394180', 's664561902'] | [17028.0, 11956.0] | [149.0, 109.0] | [356, 305] |
p02720 | u873616440 | 2,000 | 1,048,576 | A positive integer X is said to be a lunlun number if and only if the following condition is satisfied: * In the base ten representation of X (without leading zeros), for every pair of two adjacent digits, the absolute difference of those digits is at most 1. For example, 1234, 1, and 334 are lunlun numbers, while ... | ['K = 12\ntable = [1, 2, 3, 4, 5, 6, 7, 8, 9]\nfor i in table:\n if len(table) > K:\n break\n x = i % 10\n for j in range(max(0, x - 1), min(x + 2, 10)):\n table.append(i * 10 + j)\n\nprint(table[K-1])', "import numpy as np\nK = int(input())\ntable = ['1', '2', '3', '4', '5', '6', '7', '8', '9']\nc = 9\nresult... | ['Wrong Answer', 'Accepted'] | ['s319239507', 's910413808'] | [2940.0, 19400.0] | [18.0, 227.0] | [199, 634] |
p02720 | u875449556 | 2,000 | 1,048,576 | A positive integer X is said to be a lunlun number if and only if the following condition is satisfied: * In the base ten representation of X (without leading zeros), for every pair of two adjacent digits, the absolute difference of those digits is at most 1. For example, 1234, 1, and 334 are lunlun numbers, while ... | ['from collections import deque\n\n\nk = int(input())\nd = deque([1,2,3,4,5,6,7,8,9])\n\nfor i in range(k):\n a = d.popleft()\n d.append(i*10 + i % 10 - 1)\n d.append(i*10 + i % 10)\n if a != 9:\n d.append(i*10 + i % 10 + 1)\n\nprint(a)\n\n\n', 'from collections import deque\n\n\nk = int(input())\nd ... | ['Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Accepted'] | ['s052724851', 's372757840', 's508018287', 's799873966'] | [11284.0, 11284.0, 10716.0, 11908.0] | [114.0, 109.0, 117.0, 130.0] | [243, 241, 272, 272] |
p02720 | u881816188 | 2,000 | 1,048,576 | A positive integer X is said to be a lunlun number if and only if the following condition is satisfied: * In the base ten representation of X (without leading zeros), for every pair of two adjacent digits, the absolute difference of those digits is at most 1. For example, 1234, 1, and 334 are lunlun numbers, while ... | ['k=int(input())\na=[i for i in range(10)]\n\nwhile True:\n \n if k<=len(a):\n print(a[k-1])\n break\n \n k-=len(a)\n old=[]\n old, a=a, old\n for x in old:\n for i in range(-1,2):\n d=x%10+d\n if d<0 or d>9:\n continue\n new_x=x*... | ['Runtime Error', 'Accepted'] | ['s617208195', 's209703044'] | [3064.0, 11028.0] | [17.0, 129.0] | [739, 741] |
p02720 | u888337853 | 2,000 | 1,048,576 | A positive integer X is said to be a lunlun number if and only if the following condition is satisfied: * In the base ten representation of X (without leading zeros), for every pair of two adjacent digits, the absolute difference of those digits is at most 1. For example, 1234, 1, and 334 are lunlun numbers, while ... | ["import sys\nimport re\nimport math\nimport collections\nimport decimal\nimport bisect\nimport itertools\nimport fractions\nimport functools\nimport copy\nimport heapq\nimport decimal\nimport statistics\nimport queue\n\nsys.setrecursionlimit(10000001)\nINF = sys.maxsize\nMOD = 10 ** 9 + 7\n\nni = lambda: int(sys.stdin... | ['Wrong Answer', 'Accepted'] | ['s893207956', 's552033575'] | [45984.0, 13792.0] | [2207.0, 234.0] | [963, 961] |
p02720 | u891504219 | 2,000 | 1,048,576 | A positive integer X is said to be a lunlun number if and only if the following condition is satisfied: * In the base ten representation of X (without leading zeros), for every pair of two adjacent digits, the absolute difference of those digits is at most 1. For example, 1234, 1, and 334 are lunlun numbers, while ... | ['def is_lunlun(n):\n m = str(n)\n for i in range(1,len(m)):\n if abs(int(m[i]) - int(m[i-1])) > 1:\n return False\n return True\n\ndef main():\n K = int(input())\n A = [i for i in range(100000) if is_lunlun(i)]\n B = [int(str(a1)+str(a2)) for a1 in A for a2 in A if is_lunlun(int(str... | ['Time Limit Exceeded', 'Accepted'] | ['s635272804', 's212153014'] | [9172.0, 11980.0] | [2104.0, 94.0] | [441, 447] |
p02720 | u896726004 | 2,000 | 1,048,576 | A positive integer X is said to be a lunlun number if and only if the following condition is satisfied: * In the base ten representation of X (without leading zeros), for every pair of two adjacent digits, the absolute difference of those digits is at most 1. For example, 1234, 1, and 334 are lunlun numbers, while ... | ['from collections import deque\n\nK = int(input())\nQ = list(range(1, 10))\n\nfor i in range(K):\n x = Q[i]\n y = x%10\n if y != 0:\n Q.append(10*x + y-1)\n Q.append(10*x + y)\n if y != 9:\n Q.append(10*x + y+1)\n\nprint(Q[K])', 'from collections import deque\n\nK = int(input())\nQ = list(... | ['Wrong Answer', 'Accepted'] | ['s505383946', 's607731867'] | [16120.0, 16120.0] | [110.0, 110.0] | [240, 242] |
p02720 | u900993244 | 2,000 | 1,048,576 | A positive integer X is said to be a lunlun number if and only if the following condition is satisfied: * In the base ten representation of X (without leading zeros), for every pair of two adjacent digits, the absolute difference of those digits is at most 1. For example, 1234, 1, and 334 are lunlun numbers, while ... | ['a = int(input())\n\nN = [1,2,3,4,5,6,7,8,9]\n\nFor x in range(a):\n tmp = N[x]\n if tmp%10 != 0:\n N.append(tmp*10+tmp%10-1)\n N.append(tmp*10+tmp%10)\n if tmp%10 != 9:\n N.append(tmp*10+tmp%10+1)\nprint(N[a-1])\n', 'k = int(input())\nlunlun = [0] * 100\nlunlun[1] = [1, 2, 3, 4, 5, 6, 7, 8, 9]\ni = 1\n\n... | ['Runtime Error', 'Runtime Error', 'Accepted'] | ['s349303646', 's949367940', 's437861732'] | [2940.0, 3064.0, 11636.0] | [17.0, 17.0, 95.0] | [214, 502, 502] |
p02720 | u909616675 | 2,000 | 1,048,576 | A positive integer X is said to be a lunlun number if and only if the following condition is satisfied: * In the base ten representation of X (without leading zeros), for every pair of two adjacent digits, the absolute difference of those digits is at most 1. For example, 1234, 1, and 334 are lunlun numbers, while ... | ['import numpy as np\nK=100000\n\nn=np.zeros((10,11),dtype=int)\nfor i in range(9):\n\tn[i+1,1]=1\n\tn[i+1,2]=3\nn[9,2]=2\n\nfor i in range(3,11):\n\tn[1,i]=n[2,i-1]+np.sum(n[1,:])\n\tn[2,i]=n[1,i-1]+n[2,i-1]+n[3,i-1]\n\tn[3,i]=n[4,i-1]+n[2,i-1]+n[3,i-1]\n\tn[4,i]=n[4,i-1]+n[5,i-1]+n[3,i-1]\n\tn[5,i]=n[4,i-1]+n[5,i-1]+... | ['Wrong Answer', 'Accepted'] | ['s286761285', 's963667517'] | [13068.0, 22052.0] | [151.0, 314.0] | [1673, 1716] |
p02720 | u914948583 | 2,000 | 1,048,576 | A positive integer X is said to be a lunlun number if and only if the following condition is satisfied: * In the base ten representation of X (without leading zeros), for every pair of two adjacent digits, the absolute difference of those digits is at most 1. For example, 1234, 1, and 334 are lunlun numbers, while ... | ['from collections import deque\n\nk = int(input())\na = deque(range(1, 10))\ncnt = 0\n\nfor i in range(k):\n x = a.popleft()\n mod = x % 10\n if mod != 0:\n a.append(x*10 + mod -1)\n a.append(x * 10 + mod)\n if mod != 9:\n a.append(x*10 + mod + 1)\n print(a)\n\nprint(x)', 'from collecti... | ['Runtime Error', 'Accepted'] | ['s945609729', 's183716273'] | [134972.0, 11956.0] | [1491.0, 117.0] | [285, 264] |
p02720 | u919730120 | 2,000 | 1,048,576 | A positive integer X is said to be a lunlun number if and only if the following condition is satisfied: * In the base ten representation of X (without leading zeros), for every pair of two adjacent digits, the absolute difference of those digits is at most 1. For example, 1234, 1, and 334 are lunlun numbers, while ... | ["def main():\n k=int(input())\n l=[[] for _ in range(20)]\n l[1]=[0,1,2,3,4,5,6,7,8,9]\n cnt=9\n if cnt>=k:\n print(l[k])\n exit()\n for i in range(2,20):\n for keta in range(1,i):\n for j in l[keta]:\n f=j//10**(i-2)\n if j==0:\n ... | ['Wrong Answer', 'Accepted'] | ['s927638315', 's364472912'] | [12384.0, 12384.0] | [211.0, 209.0] | [1266, 1165] |
p02720 | u922449550 | 2,000 | 1,048,576 | A positive integer X is said to be a lunlun number if and only if the following condition is satisfied: * In the base ten representation of X (without leading zeros), for every pair of two adjacent digits, the absolute difference of those digits is at most 1. For example, 1234, 1, and 334 are lunlun numbers, while ... | ['cands = [1, 2, 3, 4, 5, 6, 7, 8, 9]\n\ndef add_v(v):\n global cands\n global K\n v0 = v % 10\n v0 = int(v[-1])\n if v0 == 0:\n cands += [v*10, v*10+1]\n K -=2\n elif v0 == 9:\n cands += [v*10+8, v*10+9]\n K -= 2\n else:\n cands += [v*10+v0-1, v*10+v0, v*10+v0+1]\n K -= 3\n\nK = int(input())\n... | ['Runtime Error', 'Accepted'] | ['s801212432', 's750139843'] | [3064.0, 7156.0] | [19.0, 49.0] | [388, 370] |
p02720 | u927839462 | 2,000 | 1,048,576 | A positive integer X is said to be a lunlun number if and only if the following condition is satisfied: * In the base ten representation of X (without leading zeros), for every pair of two adjacent digits, the absolute difference of those digits is at most 1. For example, 1234, 1, and 334 are lunlun numbers, while ... | ['import collections\nk=int(input())\nif k<=9:\n print(k)\nelse:\n k-=9\n l =list(range(9,0,-1))\n print(l)\n q = collections.deque(l)\n counter=0\n while counter<k:\n x=q.pop()\n xrem=x%10\n if xrem!=0:\n q.appendleft(10*x+xrem-1)\n counter+=1\n ... | ['Wrong Answer', 'Accepted'] | ['s530053688', 's433117255'] | [6108.0, 6108.0] | [63.0, 61.0] | [534, 535] |
p02720 | u944643608 | 2,000 | 1,048,576 | A positive integer X is said to be a lunlun number if and only if the following condition is satisfied: * In the base ten representation of X (without leading zeros), for every pair of two adjacent digits, the absolute difference of those digits is at most 1. For example, 1234, 1, and 334 are lunlun numbers, while ... | ['import queue\nK = int(intut())\nq = queue.Queue()\nfor i in range(9):\n q.put(i + 1)\nfor i in range(K):\n tmp = q.get()\n if tmp % 10 == 0:\n q.put(10 * tmp)\n q.put(10 * tmp + 1)\n elif tmp % 10 == 9:\n q.put(10 * tmp + 8)\n q.put(10 * tmp + 9)\n else:\n for t in range(-1,2):\n q.put(10 * t... | ['Runtime Error', 'Runtime Error', 'Runtime Error', 'Runtime Error', 'Runtime Error', 'Runtime Error', 'Accepted'] | ['s019702755', 's062504311', 's114333484', 's571463812', 's698938961', 's854041267', 's936600406'] | [4080.0, 4080.0, 12972.0, 13788.0, 12512.0, 14424.0, 17520.0] | [33.0, 29.0, 160.0, 155.0, 151.0, 153.0, 1273.0] | [332, 341, 607, 669, 576, 574, 424] |
p02720 | u952669998 | 2,000 | 1,048,576 | A positive integer X is said to be a lunlun number if and only if the following condition is satisfied: * In the base ten representation of X (without leading zeros), for every pair of two adjacent digits, the absolute difference of those digits is at most 1. For example, 1234, 1, and 334 are lunlun numbers, while ... | ['K = int(input())\nlun = [1, 2, 3, 4, 5, 6, 7, 8, 9]\ncnt = 0\n\nwhile(len(lun) < K):\n target = lun[cnt]\n num = target % 10\n print(lun,target,num)\n if num != 0:\n lun.append(target * 10 + num - 1)\n lun.append(target * 10 + num)\n if num != 9:\n lun.append(target * 10 + num + 1)\n cnt += 1\n\nprin... | ['Runtime Error', 'Accepted'] | ['s085114859', 's449428533'] | [134824.0, 7140.0] | [1698.0, 53.0] | [315, 291] |
p02720 | u961945062 | 2,000 | 1,048,576 | A positive integer X is said to be a lunlun number if and only if the following condition is satisfied: * In the base ten representation of X (without leading zeros), for every pair of two adjacent digits, the absolute difference of those digits is at most 1. For example, 1234, 1, and 334 are lunlun numbers, while ... | ['from collections import deque\n\nK = int(input()) \na = deque()\n\nfor i in range(1,10):\n a.append(i)\n \nfor i in range(K):\n j = a.popleft()\n print(j)\n if j%10 != 0:\n a.append((10*j) + ((j%10) -1))\n \n a.append((10*j)+j%10)\n \n if j%10 != 9:\n a.append((10*j) +((j%... | ['Wrong Answer', 'Wrong Answer', 'Runtime Error', 'Accepted'] | ['s019184181', 's376113316', 's516141258', 's253211281'] | [13576.0, 12384.0, 3316.0, 12384.0] | [208.0, 128.0, 21.0, 125.0] | [309, 299, 310, 305] |
p02720 | u969850098 | 2,000 | 1,048,576 | A positive integer X is said to be a lunlun number if and only if the following condition is satisfied: * In the base ten representation of X (without leading zeros), for every pair of two adjacent digits, the absolute difference of those digits is at most 1. For example, 1234, 1, and 334 are lunlun numbers, while ... | ["from collections import deque\n\ndef main():\n \tK = int(input())\n que = deque(['1', '2', '3', '4', '5', '6', '7', '8', '9'])\n\n while K:\n if K == 1:\n ans = que.popleft()\n break\n K -= 1\n v = que.popleft()\n if v[-1] == '0':\n que.append(v + '0... | ['Runtime Error', 'Accepted'] | ['s752353666', 's522832367'] | [2940.0, 12404.0] | [17.0, 133.0] | [638, 449] |
p02720 | u973972117 | 2,000 | 1,048,576 | A positive integer X is said to be a lunlun number if and only if the following condition is satisfied: * In the base ten representation of X (without leading zeros), for every pair of two adjacent digits, the absolute difference of those digits is at most 1. For example, 1234, 1, and 334 are lunlun numbers, while ... | ['K = int(input())\ndef L(x):\n X = int(x)\n if X < 10:\n return True\n elif X <100:\n if abs(int(x[-2]) -int(x[-1])) <= 1:\n return True\n else:\n return False\n elif X <(10 ** 3):\n if abs(int(x[-3]) - int(x[-2])) <= 1 and abs(int(x[-2]) -int(x[-1])) <= 1:... | ['Wrong Answer', 'Accepted'] | ['s374989637', 's142052849'] | [16752.0, 16304.0] | [2104.0, 240.0] | [952, 615] |
p02720 | u979823197 | 2,000 | 1,048,576 | A positive integer X is said to be a lunlun number if and only if the following condition is satisfied: * In the base ten representation of X (without leading zeros), for every pair of two adjacent digits, the absolute difference of those digits is at most 1. For example, 1234, 1, and 334 are lunlun numbers, while ... | ['k=int(input())\nL=[]\ndef f(d,now,L):\n L.append(now)\n \n if d==10:\n return\n \n for j in range(-1,2):\n v=now%10+j\n if 0<=v<=9:\n f(d+1,now*10+v,L)\n\nf(0,0,L)\nprint(L[k-1])\n ', 'from collections import deque\n\nk=int(input())\n\nlunlun=deque(i for i in range(1,10))\nfor _ in range(k-1):... | ['Runtime Error', 'Accepted'] | ['s148581822', 's114803942'] | [10184.0, 18972.0] | [41.0, 104.0] | [190, 266] |
p02720 | u982152304 | 2,000 | 1,048,576 | A positive integer X is said to be a lunlun number if and only if the following condition is satisfied: * In the base ten representation of X (without leading zeros), for every pair of two adjacent digits, the absolute difference of those digits is at most 1. For example, 1234, 1, and 334 are lunlun numbers, while ... | ['for i in range(K-1):\n x = q.get()\n print(x)\n if x%10 != 0:\n q.put(10*x + (x%10 -1) )\n q.put(10*x+x%10)\n if x%10 != 9:\n q.put(10*x + (x %10 + 1) )\nprint(q.get())', 'for i in range(K-1):\n x = q.get()\n if x%10 != 0:\n q.put(10*x + (x%10 -1) )\n q.put(10*x+x%10)\n if x%10 != 9:\n q.put(10*x... | ['Runtime Error', 'Runtime Error', 'Accepted'] | ['s062447790', 's659007374', 's927955958'] | [2940.0, 2940.0, 13016.0] | [17.0, 17.0, 1033.0] | [171, 160, 251] |
p02720 | u985972698 | 2,000 | 1,048,576 | A positive integer X is said to be a lunlun number if and only if the following condition is satisfied: * In the base ten representation of X (without leading zeros), for every pair of two adjacent digits, the absolute difference of those digits is at most 1. For example, 1234, 1, and 334 are lunlun numbers, while ... | ['# -*- coding: utf-8 -*-\n\ndef input_multiple_number():\n return map(int, input().split())\n\ndef input_multiple_number_as_list():\n return list(map(int, input().split()))\n\n\nK = int(input())\n\nbase = [1,2,3,4,5,6,7,8,9]\nans = [1,2,3,4,5,6,7,8,9]\n\nfor i in range(100000):\n\tfor j in range(3):\n\t\tif ans[... | ['Wrong Answer', 'Accepted'] | ['s715506833', 's818937592'] | [16280.0, 16408.0] | [256.0, 257.0] | [433, 434] |
p02720 | u986889396 | 2,000 | 1,048,576 | A positive integer X is said to be a lunlun number if and only if the following condition is satisfied: * In the base ten representation of X (without leading zeros), for every pair of two adjacent digits, the absolute difference of those digits is at most 1. For example, 1234, 1, and 334 are lunlun numbers, while ... | ['from collections import deque\n\nk = int(input())\nlunlun = []\nq = deque([1,2,3,4,5,6,7,8,9])\nfor i in range(k-1):\n first = q.popleft()\n if first%10-1 >= 0:\n q.append(first*10 + (first%10-1))\n q.append(first*10 + first%10)\n if first%10+1 <= 9:\n q.append(10*first + (first%10+1))\n ... | ['Runtime Error', 'Accepted'] | ['s225881994', 's415641704'] | [134976.0, 16596.0] | [1538.0, 144.0] | [326, 348] |
p02720 | u989345508 | 2,000 | 1,048,576 | A positive integer X is said to be a lunlun number if and only if the following condition is satisfied: * In the base ten representation of X (without leading zeros), for every pair of two adjacent digits, the absolute difference of those digits is at most 1. For example, 1234, 1, and 334 are lunlun numbers, while ... | ['k=int(input())\nans=[[i for i in range(1,10)]]\nd=9\nwhile d<k:\n ans.append([])\n for i in ans[-2]:\n x=str(i)\n z=int(x[-1])\n ans[-1].append(x+str(z))\n if z<=8:\n ans[-1].append(x+str(z+1))\n if z>=1:\n ans[-1].append(x+str(z-1))\n d+=len(ans[-1])\... | ['Wrong Answer', 'Runtime Error', 'Accepted'] | ['s126674501', 's594042610', 's054837106'] | [17268.0, 3064.0, 23796.0] | [141.0, 18.0, 317.0] | [326, 530, 244] |
p02720 | u992951814 | 2,000 | 1,048,576 | A positive integer X is said to be a lunlun number if and only if the following condition is satisfied: * In the base ten representation of X (without leading zeros), for every pair of two adjacent digits, the absolute difference of those digits is at most 1. For example, 1234, 1, and 334 are lunlun numbers, while ... | ['k = int(input())\nque = []\nfor i in range(1,10):\n que.append(i)\nct = 0\nwhile(len(que) < k):\n ct += 1\n value = que[0]\n que.remove(value)\n for i in [-1,0,1]:\n if 0 <= (value%10) + i and (value%10) + i <= 9:\n tmp = 10*value + (value%10) + i\n q.append(tmp) \nprint(que[k-1-ct])', 'k = int(inp... | ['Runtime Error', 'Runtime Error', 'Accepted'] | ['s452110159', 's603572350', 's385276753'] | [3064.0, 7488.0, 7512.0] | [18.0, 852.0, 904.0] | [290, 269, 292] |
p02720 | u997641430 | 2,000 | 1,048,576 | A positive integer X is said to be a lunlun number if and only if the following condition is satisfied: * In the base ten representation of X (without leading zeros), for every pair of two adjacent digits, the absolute difference of those digits is at most 1. For example, 1234, 1, and 334 are lunlun numbers, while ... | ["def generate(n):\n if n == 1:\n for i in range(1, 10):\n yield [i]\n else:\n for A in generate(n - 1):\n for i in range(10):\n if abs(A[-1] - i) <= 1:\n yield A + [i]\n\n\nL = []\nfor n in range(1, 11):\n for A in generate(n):\n L.a... | ['Wrong Answer', 'Accepted'] | ['s674652799', 's143244705'] | [16976.0, 17060.0] | [542.0, 538.0] | [392, 378] |
p02721 | u017050982 | 2,000 | 1,048,576 | Takahashi has decided to work on K days of his choice from the N days starting with tomorrow. You are given an integer C and a string S. Takahashi will choose his workdays as follows: * After working for a day, he will refrain from working on the subsequent C days. * If the i-th character of S is `x`, he will not... | ['kinmu = 0\nniti = 0\np = 0\nfor i in range(N):\n if S[i] == "o" and tyousa[i] == p:\n kinmu = 0\n niti = 0\n route.clear()\n while kinmu < K and niti < N:\n if S[niti] == "o" and niti != i:\n route.append(niti)\n kinmu += 1\n niti += C\n niti += 1\n if niti >= N and kinm... | ['Runtime Error', 'Accepted'] | ['s508406946', 's608699336'] | [3064.0, 20664.0] | [17.0, 408.0] | [408, 422] |
p02721 | u078932560 | 2,000 | 1,048,576 | Takahashi has decided to work on K days of his choice from the N days starting with tomorrow. You are given an integer C and a string S. Takahashi will choose his workdays as follows: * After working for a day, he will refrain from working on the subsequent C days. * If the i-th character of S is `x`, he will not... | ["k = int(input())\nlunluns = list(map(str, range(1,10)))\nnew = list(map(str, range(1,10)))\nnew_fueta = 9\nend = False\nwhile len(lunluns) < k:\n new_new_fueta = 0\n for x in lunluns[-new_fueta:]:\n str_x = str(x)\n if str_x[-1] == '0':\n lunluns += [int(str_x+'0'),int(str_x+'1')]\n new_new_fueta +=... | ['Runtime Error', 'Accepted'] | ['s814655156', 's030680280'] | [3064.0, 20772.0] | [17.0, 445.0] | [617, 394] |
p02721 | u089032001 | 2,000 | 1,048,576 | Takahashi has decided to work on K days of his choice from the N days starting with tomorrow. You are given an integer C and a string S. Takahashi will choose his workdays as follows: * After working for a day, he will refrain from working on the subsequent C days. * If the i-th character of S is `x`, he will not... | ["import sys\ninput = sys.stdin.readline\n\n\ndef inpl():\n return list(map(int, input().split()))\n\n\ndef GetBase(s=0):\n ret = []\n last = -C * 2 - 1\n for i, s in enumerate(S[s:]):\n if s == 'x':\n continue\n elif last + C >= i + s:\n continue\n\n ret.append(i ... | ['Runtime Error', 'Accepted'] | ['s014292037', 's831619587'] | [6308.0, 50208.0] | [24.0, 321.0] | [1274, 1205] |
p02721 | u095021077 | 2,000 | 1,048,576 | Takahashi has decided to work on K days of his choice from the N days starting with tomorrow. You are given an integer C and a string S. Takahashi will choose his workdays as follows: * After working for a day, he will refrain from working on the subsequent C days. * If the i-th character of S is `x`, he will not... | ["\nN, K, C=map(int, input().split())\nS='x'+input() \n\n\nA=[] \ni=1 \nwhile len(A)<K:\n if S[i]=='o':\n \n A.append(i+1)\n i+=(C+1)\n else:\n \n i+=1\n \n\nB=[]\ni=N \nwhile len(B)<K:\n if S[i]=='o':\n \n B.append(i)\n i-=(C+1)\n else:\n \n i-=1\n \nB=B[::-1] \nfor i in range(K... | ['Wrong Answer', 'Accepted'] | ['s560269574', 's450231323'] | [20932.0, 20836.0] | [194.0, 345.0] | [1124, 1122] |
p02721 | u100277898 | 2,000 | 1,048,576 | Takahashi has decided to work on K days of his choice from the N days starting with tomorrow. You are given an integer C and a string S. Takahashi will choose his workdays as follows: * After working for a day, he will refrain from working on the subsequent C days. * If the i-th character of S is `x`, he will not... | ['N, K, C = map(int,input().split())\nS = list(input())\n\nA = list()\nB = list()\n\ni = 0\nnum = 0\nwhile num < K:\n if S[i] == "o":\n A.append(i)\n num += 1\n i += C\n i += 1\ni = len(S)-1\nnum = 0\nwhile num < K:\n if S[i] == "o":\n B.append(i)\n num+=1\n i -= C\n i -= 1\nB.sort()\n\nprint(A)\n... | ['Wrong Answer', 'Accepted'] | ['s053242153', 's311374483'] | [27580.0, 21996.0] | [388.0, 391.0] | [351, 332] |
p02721 | u103902792 | 2,000 | 1,048,576 | Takahashi has decided to work on K days of his choice from the N days starting with tomorrow. You are given an integer C and a string S. Takahashi will choose his workdays as follows: * After working for a day, he will refrain from working on the subsequent C days. * If the i-th character of S is `x`, he will not... | ["n,k,c= map(int,input().split())\ns = input()\ni = 0\n\ndef func(s,k,c):\n i = 0\n res = []\n while 1:\n if s[i] == 'o':\n res.append(i)\n if len(ans1)== k:\n break\n i += c\n return res\nans1 = set(func(s,k,c))\nans2 = set(func(s[::-1],k,c))\n\nans = list(ans1.intersection(ans2))\nfor a i... | ['Runtime Error', 'Wrong Answer', 'Accepted'] | ['s327178939', 's874193117', 's509822698'] | [3500.0, 47200.0, 27496.0] | [2103.0, 296.0, 320.0] | [317, 330, 368] |
p02721 | u127499732 | 2,000 | 1,048,576 | Takahashi has decided to work on K days of his choice from the N days starting with tomorrow. You are given an integer C and a string S. Takahashi will choose his workdays as follows: * After working for a day, he will refrain from working on the subsequent C days. * If the i-th character of S is `x`, he will not... | ["def main():\n from itertools import groupby\n n, k, c = map(int, input().split())\n s = list(input())\n\n if c == 0:\n if s.count('o') == k:\n ans = '\\n'.join(map(str,range(1,n+1)))\n print(ans)\n return\n else:\n return\n\n check_f = []\n ... | ['Runtime Error', 'Accepted'] | ['s168998849', 's556076877'] | [2940.0, 17316.0] | [17.0, 116.0] | [902, 907] |
p02721 | u163320134 | 2,000 | 1,048,576 | Takahashi has decided to work on K days of his choice from the N days starting with tomorrow. You are given an integer C and a string S. Takahashi will choose his workdays as follows: * After working for a day, he will refrain from working on the subsequent C days. * If the i-th character of S is `x`, he will not... | ["n,k,c=map(int,input().split())\ns=input()\nl=len(s)\ncand=[]\nfor i in range(l):\n if s[i]=='o':\n cand.append(i+1)\ncnt1=[0]*(n+2)\ncnt2=[0]*(n+2)\nprev=0\ncnt=0\nfor i in range(l):\n if s[i]=='o' and i>=prev:\n cnt+=1\n cnt1[i+1]=cnt\n prev=i+(c+1)\n else:\n cnt1[i+1]=cnt\nprev=l\ncnt=0\nfor i in ... | ['Wrong Answer', 'Wrong Answer', 'Accepted'] | ['s185255853', 's989332383', 's273534860'] | [33176.0, 30164.0, 30112.0] | [338.0, 439.0, 443.0] | [526, 534, 544] |
p02721 | u167681750 | 2,000 | 1,048,576 | Takahashi has decided to work on K days of his choice from the N days starting with tomorrow. You are given an integer C and a string S. Takahashi will choose his workdays as follows: * After working for a day, he will refrain from working on the subsequent C days. * If the i-th character of S is `x`, he will not... | ['n, k, c = map(int, input().split())\ns = input()\n\nl, r = [], []\ncur = 0\ncount = 0\n\nwhile cur <= n:\n if s[cur] == "o":\n count += 1\n l.append((count, cur+1))\n cur += c\n\n cur += 1\n\ncur = n\ncount = k\n\nwhile cur >= 0:\n if s[cur] == "o":\n r.append((count, cur+1))\n ... | ['Runtime Error', 'Wrong Answer', 'Accepted'] | ['s399100779', 's664877656', 's541015934'] | [30468.0, 3444.0, 88500.0] | [137.0, 2104.0, 654.0] | [417, 549, 423] |
p02721 | u173148629 | 2,000 | 1,048,576 | Takahashi has decided to work on K days of his choice from the N days starting with tomorrow. You are given an integer C and a string S. Takahashi will choose his workdays as follows: * After working for a day, he will refrain from working on the subsequent C days. * If the i-th character of S is `x`, he will not... | ['N,K,C=map(int,input().split())\nS=input()\n\nl=[]\nla=[]\ni=0\nc=0\nwhile True:\n if S[i]=="o":\n l.append(i)\n i+=C\n c+=1\n i+=1\n\nif c>K:\n exit()\n\ni=N-1\nc=0\n\nwhile True:\n if S[i]=="o":\n la.append(i)\n i-=C\n c+=1\n i-=1\n if c==K:\n break\... | ['Runtime Error', 'Accepted'] | ['s647938818', 's107146565'] | [11368.0, 7872.0] | [95.0, 364.0] | [342, 385] |
p02721 | u212263866 | 2,000 | 1,048,576 | Takahashi has decided to work on K days of his choice from the N days starting with tomorrow. You are given an integer C and a string S. Takahashi will choose his workdays as follows: * After working for a day, he will refrain from working on the subsequent C days. * If the i-th character of S is `x`, he will not... | ['k,y,c = map( int, input().split(" "))\nss = input()\n\nasc = []\ndsc = []\n\ncnt = 0\nerr_flg = 0\nwhile( True ):\n if(len(ss) <= cnt):\n err_flg = 1\n break\n if( ss[cnt] == "o"):\n asc.append( cnt )\n cnt += c+1\n else:\n cnt += 1\n \n if( len(asc)==y ):\n break\n\ncnt = 0\nss = ss[::-1]\nw... | ['Wrong Answer', 'Wrong Answer', 'Accepted'] | ['s366420031', 's601324267', 's224318906'] | [26228.0, 20584.0, 20588.0] | [460.0, 446.0, 439.0] | [680, 682, 684] |
p02721 | u296150111 | 2,000 | 1,048,576 | Takahashi has decided to work on K days of his choice from the N days starting with tomorrow. You are given an integer C and a string S. Takahashi will choose his workdays as follows: * After working for a day, he will refrain from working on the subsequent C days. * If the i-th character of S is `x`, he will not... | ['exit()', 'n,k,c=map(int,input().split())\ns=input()\nl=list();r=list()\nnex=0\nfor i in range(n):\n\tif i<nex:\n\t\tcontinue\n\tif s[i]=="o":\n\t\tnex=i+c+1\n\t\tl.append(i)\n\t\tif len(l)==k:\n\t\t\tbreak\nnex=-1\nfor i in range(n):\n\tif i<nex:\n\t\tcontinue\n\tif s[-i-1]=="o":\n\t\tnex=i+c+1\n\t\tr.append(n-i-1)\n... | ['Wrong Answer', 'Accepted'] | ['s294454904', 's956784187'] | [9096.0, 26392.0] | [22.0, 277.0] | [6, 353] |
p02721 | u391540332 | 2,000 | 1,048,576 | Takahashi has decided to work on K days of his choice from the N days starting with tomorrow. You are given an integer C and a string S. Takahashi will choose his workdays as follows: * After working for a day, he will refrain from working on the subsequent C days. * If the i-th character of S is `x`, he will not... | ['#!/usr/bin/env python3\n# coding: utf-8\nimport time\n\ndef main():\n N, K, C = map(int, input().split())\n S = dict(enumerate(str(input()), 1))\n\n # time.sleep(0.05 * len(str(C)))\n \n if N == 100000 and K == 66666 and C == 0:\n XXXX\nif __name__ == "__main__":\n main()', '#!/usr/bin/env py... | ['Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Runtime Error', 'Runtime Error', 'Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Runtime Error', 'Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Runtime Error', 'Runtime Error', 'Accepted'] | ['s024676300', 's063987147', 's172090263', 's213170207', 's332843088', 's409010313', 's431892161', 's478280785', 's482403867', 's515002837', 's580449449', 's656079722', 's708403870', 's724193303', 's740130834', 's832760414', 's848521872', 's920530985', 's854837337'] | [27224.0, 27224.0, 27224.0, 27224.0, 2940.0, 27224.0, 27224.0, 27344.0, 27344.0, 27224.0, 27224.0, 27224.0, 27344.0, 27224.0, 2940.0, 27344.0, 27224.0, 27224.0, 30744.0] | [40.0, 340.0, 291.0, 343.0, 18.0, 40.0, 40.0, 280.0, 340.0, 40.0, 324.0, 40.0, 317.0, 40.0, 17.0, 46.0, 490.0, 340.0, 281.0] | [319, 258, 258, 258, 55, 361, 384, 258, 218, 319, 221, 213, 222, 319, 4, 183, 258, 258, 806] |
p02721 | u392319141 | 2,000 | 1,048,576 | Takahashi has decided to work on K days of his choice from the N days starting with tomorrow. You are given an integer C and a string S. Takahashi will choose his workdays as follows: * After working for a day, he will refrain from working on the subsequent C days. * If the i-th character of S is `x`, he will not... | ["print('')", "N, K, C = map(int, input().split())\nS = input()\n\ndef calc(S):\n now = 1\n ret = [0] * (N + 1)\n while now <= N:\n if S[now] == 'x':\n now += 1\n continue\n ret[now] += 1\n now += C + 1\n for i in range(N):\n ret[i + 1] += ret[i]\n\n retu... | ['Wrong Answer', 'Accepted'] | ['s915776148', 's035078008'] | [2940.0, 31672.0] | [17.0, 357.0] | [9, 531] |
p02721 | u399298563 | 2,000 | 1,048,576 | Takahashi has decided to work on K days of his choice from the N days starting with tomorrow. You are given an integer C and a string S. Takahashi will choose his workdays as follows: * After working for a day, he will refrain from working on the subsequent C days. * If the i-th character of S is `x`, he will not... | ['N, K, C = map(int, input().split())\nS = list(input())\nS_work = []\ns = []\nf = []\ni = 0\nwhile len(s) < K:\n if S[i] == "o":\n s.append(i)\n i += C + 1\n elif S[i] == "x":\n i += 1\n elif i == len(S):\n break\ni = 1\nwhile len(f) < K:\n if S[N - i] == "o":\n f.append(i)\n i += C + 1\n elif S... | ['Wrong Answer', 'Wrong Answer', 'Accepted'] | ['s443627416', 's619097015', 's601701089'] | [20728.0, 20732.0, 22012.0] | [226.0, 201.0, 354.0] | [414, 417, 426] |
p02721 | u424768586 | 2,000 | 1,048,576 | Takahashi has decided to work on K days of his choice from the N days starting with tomorrow. You are given an integer C and a string S. Takahashi will choose his workdays as follows: * After working for a day, he will refrain from working on the subsequent C days. * If the i-th character of S is `x`, he will not... | ["for i in range(N):\n if s[i]=='o':\n si=copy.copy(s)\n si[i]='x'\n day=N\n count=0\n flag=False\n while day>K-1 and count<K:\n if si[day-1]=='x':\n day-=1\n else:\n count+=1\n day-=C+1\n if c... | ['Runtime Error', 'Accepted'] | ['s028651841', 's838082176'] | [3064.0, 18544.0] | [18.0, 719.0] | [390, 547] |
p02721 | u442877951 | 2,000 | 1,048,576 | Takahashi has decided to work on K days of his choice from the N days starting with tomorrow. You are given an integer C and a string S. Takahashi will choose his workdays as follows: * After working for a day, he will refrain from working on the subsequent C days. * If the i-th character of S is `x`, he will not... | ["N,K,C = map(int,input().split())\nS = str(input())\nworks1 = 0\nworks2 = 0\nl1 = []\nl2 = []\nfor i in range(N):\n if S[i] == 'o':\n works1 += 1\n l1.append(i+1)\n i += C-1\n if works1 == K:\n break\n\nfor i in range(N):\n if S[-i-1] == 'o':\n works2 += 1\n l2.append(N-i)\n i += C-1\n if work... | ['Wrong Answer', 'Accepted'] | ['s912606513', 's926483607'] | [33236.0, 20620.0] | [2105.0, 384.0] | [411, 418] |
p02721 | u456353530 | 2,000 | 1,048,576 | Takahashi has decided to work on K days of his choice from the N days starting with tomorrow. You are given an integer C and a string S. Takahashi will choose his workdays as follows: * After working for a day, he will refrain from working on the subsequent C days. * If the i-th character of S is `x`, he will not... | ['N, K, C = list(map(int, input().split()))\nS = list(input())\no = "o"\nx = "x"\n\nW = [0] * N\n\nif S[0] == o:\n W[0] = 1\n\nfor i in range(1, N):\n W[i] = W[i - 1]\n if S[i] == o:\n W[i] += 1\n\nBDP = [0] * N\ncnt = 0\nif S[0] == o:\n BDP[0] = 1\n cnt = C\nfor i in range(1, N):\n BDP[i] = BDP[i - 1]\n if c... | ['Wrong Answer', 'Accepted'] | ['s231842223', 's201561949'] | [31584.0, 31468.0] | [930.0, 930.0] | [1703, 1694] |
p02721 | u515647766 | 2,000 | 1,048,576 | Takahashi has decided to work on K days of his choice from the N days starting with tomorrow. You are given an integer C and a string S. Takahashi will choose his workdays as follows: * After working for a day, he will refrain from working on the subsequent C days. * If the i-th character of S is `x`, he will not... | ['line1 = input().split()\nn = int(line1[0])\nk = int(line1[1])\nc = int(line1[2])\ns = list(input())\nl = [s.index("o") + 1]\nr = [len(s) - s[::-1].index("o")]\nfor i in range(1, k):\n j = l[i - 1]\n m = r[i - 1]\n while j - l[i - 1] <= c or s[j - 1] != "o":\n j += 1\n while r[i - 1] - m <= c or s[m - 1] != "o"... | ['Wrong Answer', 'Accepted'] | ['s088096400', 's789893245'] | [23420.0, 24860.0] | [320.0, 497.0] | [402, 417] |
p02721 | u526780498 | 2,000 | 1,048,576 | Takahashi has decided to work on K days of his choice from the N days starting with tomorrow. You are given an integer C and a string S. Takahashi will choose his workdays as follows: * After working for a day, he will refrain from working on the subsequent C days. * If the i-th character of S is `x`, he will not... | ['n,k,c=[int(x) for x in input().split()]\ns=list(input())\n\nL=[]\nR=[]\ni=0\nwhile i < n:\n \n if s[i]=="o":\n L.append(i)\n i+=2\n i+=1\n\ni=0\nwhile i < n:\n \n if s[n-i-1]=="o":\n R.append(n-i-1)\n i+=2\n i+=1\n \n\n\ndays=[]\n\nfor i in range(k):\n \n if L[i]... | ['Runtime Error', 'Runtime Error', 'Wrong Answer', 'Accepted'] | ['s050759415', 's309543355', 's403416699', 's808020809'] | [10116.0, 3064.0, 27736.0, 23676.0] | [109.0, 17.0, 258.0, 408.0] | [371, 298, 366, 363] |
p02721 | u568576853 | 2,000 | 1,048,576 | Takahashi has decided to work on K days of his choice from the N days starting with tomorrow. You are given an integer C and a string S. Takahashi will choose his workdays as follows: * After working for a day, he will refrain from working on the subsequent C days. * If the i-th character of S is `x`, he will not... | ["L=[]\nR=[]\nN,K,C=map(int,input().split())\nS=list(input())\ns=S[::-1]\ni=0\nwhile len(L)<K:\n if S[i]=='o':\n L.append(i+1)\n if i+C<N:\n for j in range(1,C+1):\n S[i+j]='x'\n i+=1\nprint(L)\nk=0\nwhile len(R)<K:\n if s[k]=='o':\n R.append(N-k)\n if k+C<... | ['Wrong Answer', 'Accepted'] | ['s991885137', 's256686694'] | [29636.0, 28304.0] | [444.0, 458.0] | [465, 456] |
p02721 | u645436608 | 2,000 | 1,048,576 | Takahashi has decided to work on K days of his choice from the N days starting with tomorrow. You are given an integer C and a string S. Takahashi will choose his workdays as follows: * After working for a day, he will refrain from working on the subsequent C days. * If the i-th character of S is `x`, he will not... | ['N, K, C = map(int, input().split())\nS = input()\nL = []\nR = []\nL_index = 0\nL_count = 0\nR_index = N - 1\nR_count = K - 1\n\nwhile L_index < N and L_count < K:\n if S[L_index] == "o":\n L.append(L_index)\n L_index += (C + 1)\n L_count += 1\n else:\n L_index += 1\nwhile R_index >= ... | ['Runtime Error', 'Wrong Answer', 'Accepted'] | ['s212396991', 's844552244', 's484656691'] | [11472.0, 26228.0, 20616.0] | [100.0, 576.0, 375.0] | [525, 557, 536] |
p02721 | u664373116 | 2,000 | 1,048,576 | Takahashi has decided to work on K days of his choice from the N days starting with tomorrow. You are given an integer C and a string S. Takahashi will choose his workdays as follows: * After working for a day, he will refrain from working on the subsequent C days. * If the i-th character of S is `x`, he will not... | ['n,k,c=map(int,input().split())\ns=input()\nne=10**6*(-1)\nfow=[]\nbac=[]\nfor i in range(n):\n if i>ne and s[i]!="x":\n ne=i+c\n fow.append(i)\n if len(fow)==k:\n break\nne=10**6\nfor i in range(n-1,-1,-1):\n if i<ne and s[i]!="x":\n ne=i-c\n bac.append(i)\n if len(bac)=... | ['Wrong Answer', 'Accepted'] | ['s060346209', 's364462911'] | [20728.0, 20724.0] | [338.0, 358.0] | [385, 387] |
p02721 | u674052742 | 2,000 | 1,048,576 | Takahashi has decided to work on K days of his choice from the N days starting with tomorrow. You are given an integer C and a string S. Takahashi will choose his workdays as follows: * After working for a day, he will refrain from working on the subsequent C days. * If the i-th character of S is `x`, he will not... | ['# -*- coding: utf-8 -*-\n"""\nCreated on Sun Apr 5 22:11:18 2020\n\n@author: Kanaru Sato\n"""\n\nn,k,c = list(map(int, input().split()))\ns = list(input())\n\nearly = []\nlate = []\n\ni = 0\ncount = 0\nwhile i < n and count < k:\n if s[i] == "o":\n early.append(i)\n i = i+c+1\n count = count+... | ['Wrong Answer', 'Wrong Answer', 'Accepted'] | ['s114629287', 's329513208', 's494770737'] | [23576.0, 23572.0, 22104.0] | [401.0, 399.0, 418.0] | [585, 585, 572] |
p02721 | u692311686 | 2,000 | 1,048,576 | Takahashi has decided to work on K days of his choice from the N days starting with tomorrow. You are given an integer C and a string S. Takahashi will choose his workdays as follows: * After working for a day, he will refrain from working on the subsequent C days. * If the i-th character of S is `x`, he will not... | ['N,K,C=map(int,input().split())\nS=input()\nL=[0 for i in range(K)]\nR=[0 for i in range(K)]\nn=0\nrc=0\nlc=0\nwhile True:\n if lc==K:\n break\n if S[n]=="o":\n L[lc]=n+1\n n+=C+1\n lc+=1\n else:\n n+=1\nn=N-1\nwhile True:\n if rc==K:\n break\n if S[n]=="o":\n R[N-1-rc]=n+1\n n-=C+1\n r... | ['Runtime Error', 'Accepted'] | ['s361305486', 's090028497'] | [20660.0, 20664.0] | [354.0, 376.0] | [369, 369] |
p02721 | u698176039 | 2,000 | 1,048,576 | Takahashi has decided to work on K days of his choice from the N days starting with tomorrow. You are given an integer C and a string S. Takahashi will choose his workdays as follows: * After working for a day, he will refrain from working on the subsequent C days. * If the i-th character of S is `x`, he will not... | ["# -*- coding: utf-8 -*-\nimport sys\n\nN,K,C = map(int,input().split())\nS = input()\n#%%\nassign_t = [False]*N\nassign_b = [False]*N\n\n\nfor i in range(10):\n nassign_t = [False]*N\n i = 0\n num = 0\n while i<N and num<K:\n if S[i]=='o':\n nassign_t[i] = True\n num += 1\n ... | ['Wrong Answer', 'Wrong Answer', 'Accepted'] | ['s243970991', 's903844945', 's641006150'] | [9580.0, 11576.0, 7876.0] | [1219.0, 855.0, 327.0] | [774, 764, 509] |
p02721 | u699765883 | 2,000 | 1,048,576 | Takahashi has decided to work on K days of his choice from the N days starting with tomorrow. You are given an integer C and a string S. Takahashi will choose his workdays as follows: * After working for a day, he will refrain from working on the subsequent C days. * If the i-th character of S is `x`, he will not... | ["import copy\n\nn, k, c = map(int, input().split())\ns = list(input())\n\ntmp = copy.deepcopy(s)\nwait = 0\nlast_day = k\ncount = set()\n\nfor num, i in enumerate(tmp):\n if wait>0:\n wait -= 1\n continue\n if i == 'o':\n count.add(num)\n wait = c\n last_day -= 1\n if la... | ['Wrong Answer', 'Accepted'] | ['s119391928', 's071823783'] | [42488.0, 42488.0] | [718.0, 657.0] | [810, 807] |
p02721 | u700805562 | 2,000 | 1,048,576 | Takahashi has decided to work on K days of his choice from the N days starting with tomorrow. You are given an integer C and a string S. Takahashi will choose his workdays as follows: * After working for a day, he will refrain from working on the subsequent C days. * If the i-th character of S is `x`, he will not... | ['import itertools\nn, k, c = map(int, input().split())\ns = input()\ncounto = s.count("o")\ncount = 0\na = []\nb = [0]\nfor i in range(n):\n if s[i] == "o":\n a.append(i)\nfor i in list(itertools.combinations(a, k)):\n for j in range(len(i)-1):\n if i[j] - i[j-1]<=c:\n break\n count +... | ['Wrong Answer', 'Accepted'] | ['s043169075', 's218824293'] | [1919600.0, 20644.0] | [2224.0, 355.0] | [337, 392] |
p02721 | u703528810 | 2,000 | 1,048,576 | Takahashi has decided to work on K days of his choice from the N days starting with tomorrow. You are given an integer C and a string S. Takahashi will choose his workdays as follows: * After working for a day, he will refrain from working on the subsequent C days. * If the i-th character of S is `x`, he will not... | ['N,K,C=map(int,input().split())\nSL=input()\nSR=SL[::-1]\nLeft=[]\nRight=[]\nLast=-N\nRast=-N\ncL=cR=0\nfor i in range(N):\n if SL[i]=="o" and i-Last>C and cL<=K:\n Left.append(i)\n Last=i\n cL+=1\n if SR[i]=="o" and i-Rast>C and cR<=K:\n Right.append(N-i-1)\n Rast=i\n c... | ['Runtime Error', 'Accepted'] | ['s151437901', 's206601141'] | [32032.0, 29044.0] | [296.0, 389.0] | [419, 481] |
p02721 | u707960254 | 2,000 | 1,048,576 | Takahashi has decided to work on K days of his choice from the N days starting with tomorrow. You are given an integer C and a string S. Takahashi will choose his workdays as follows: * After working for a day, he will refrain from working on the subsequent C days. * If the i-th character of S is `x`, he will not... | ["N, K, C = map(int, input().split())\nS = input()\nL, R = [0]*N, [0]*N\ni = 0\ncount = 1\nwhile count <= K:\n if S[i] == 'x':\n i += 1\n continue\n L[i] = count\n count += 1\n i += C+1\ni = N-1\ncount = K\nwhile count > 0:\n if S[i] == 'x':\n i -= 1\n continue\n print(i, c... | ['Wrong Answer', 'Accepted'] | ['s947939302', 's235173279'] | [23124.0, 20628.0] | [619.0, 376.0] | [444, 424] |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.