problem_id stringlengths 6 6 | buggy_code stringlengths 8 526k | fixed_code stringlengths 12 526k | labels listlengths 0 15 ⌀ | buggy_submission_id int64 1 1.54M | fixed_submission_id int64 2 1.54M | user_id stringlengths 10 10 | language stringclasses 8
values |
|---|---|---|---|---|---|---|---|
p02720 | from collections import deque
K = int(input())
Q = deque([i for i in range(1,10)])
for _ in range(K-1):
q = Q.popleft()
if q%10 != 0:
Q.append(q*10+q%10-1)
Q.append(q*10+q%10)
if q%9 != 0:
Q.append(q*10+q%10+1)
print(Q.popleft()) | from collections import deque
K = int(input())
Q = deque([i for i in range(1,10)])
for _ in range(K-1):
q = Q.popleft()
if q%10 != 0:
Q.append(q*10+q%10-1)
Q.append(q*10+q%10)
if q%10 != 9:
Q.append(q*10+q%10+1)
print(Q.popleft()) | [
"literal.number.integer.change",
"control_flow.branch.if.condition.change"
] | 492,826 | 492,827 | u442877951 | python |
p02720 | k = int(input())
A = [i for i in range(1, 10)]
while k:
if k <= len(A):
print(A[k-1])
exit()
k -= len(A)
old = []
old, A = A, old
for x in old:
for i in range(-1, 2):
d = (x % 10) + i
if d < 0 and d > 9: continue
nx = (x * 10... | k = int(input())
A = [i for i in range(1, 10)]
while k:
if k <= len(A):
print(A[k-1])
exit()
k -= len(A)
old = []
old, A = A, old
for x in old:
for i in range(-1, 2):
d = (x % 10) + i
if d < 0 or d > 9: continue
nx = (x * 10)... | [
"control_flow.branch.if.condition.change"
] | 492,828 | 492,829 | u968404618 | python |
p02720 | from collections import deque
n = int(input())
q = deque(range(1, 10))
for _ in range(n - 1):
x = q.popleft()
r = x % 10
y = 10 * x
if r == 0:
q.extend([y, y+1, y+9])
elif r == 9:
q.extend([y, y+8, y+9])
else:
q.extend([y+r-1, y+r, y+r+1])
print(q.popleft()) | from collections import deque
n = int(input())
q = deque(range(1, 10))
for _ in range(n - 1):
x = q.popleft()
r = x % 10
y = 10 * x
if r == 0:
q.extend([y, y+1])
elif r == 9:
q.extend([y+8, y+9])
else:
q.extend([y+r-1, y+r, y+r+1])
print(q.popleft()) | [] | 492,832 | 492,833 | u085059942 | python |
p02720 | k = int(input())
cur = [[1]*10 for i in range(11)]
if k <= 9:
print(k)
exit()
c = 9
i = 0
while c < k:
i += 1
for j in range(10):
cur[i][j] = cur[i-1][j]
if j != 0:
cur[i][j] += cur[i-1][j-1]
if j != 9:
cur[i][j] += cur[i-1][j+1]
if sum(cur[i]) >= k:
break
else:
c += sum(cur[... | k = int(input())
cur = [[1]*10 for i in range(11)]
if k <= 9:
print(k)
exit()
c = 9
i = 0
while c < k:
i += 1
for j in range(10):
cur[i][j] = cur[i-1][j]
if j != 0:
cur[i][j] += cur[i-1][j-1]
if j != 9:
cur[i][j] += cur[i-1][j+1]
if c+sum(cur[i][1:]) >= k:
break
else:
c += su... | [
"control_flow.branch.if.condition.change"
] | 492,836 | 492,837 | u410118019 | python |
p02720 | from collections import deque
K = int(input())
que = deque()
que.extend([i for i in range(1,10)])
for k in range(K-2):
out = que.popleft()
div = out%10
if div==0:
que.extend([out*10,out*10+1])
elif out%10==9:
que.extend([out*10+8,out*10+9])
else:
que.extend([out*10-1+div,out... | from collections import deque
K = int(input())
que = deque()
que.extend([i for i in range(1,10)])
for k in range(K-1):
out = que.popleft()
div = out%10
if div==0:
que.extend([out*10,out*10+1])
elif out%10==9:
que.extend([out*10+8,out*10+9])
else:
que.extend([out*10-1+div,out... | [
"literal.number.integer.change",
"call.arguments.change",
"expression.operation.binary.change",
"control_flow.loop.range.bounds.upper.change"
] | 492,866 | 492,867 | u772029934 | python |
p02720 | N = int(input())
R=[["1","2","3","4","5","6","7","8","9"]]
count=9
for i in range(N):
if count>=N:
break
else:
temp=[]
for r in R[i]:
if r[-1]=="9":
temp.append(str(r)+str(int(r[-1])-1))
temp.append(str(r)+str(int(r[-1])))
elif r[-1]=="0":
temp.append(str(r)+str(int(r... | N = int(input())
R=[["1","2","3","4","5","6","7","8","9"]]
count=9
temp=[]
for i in range(N):
if count>=N:
break
else:
temp=[]
for r in R[i]:
if r[-1]=="9":
temp.append(str(r)+str(int(r[-1])-1))
temp.append(str(r)+str(int(r[-1])))
elif r[-1]=="0":
temp.append(str(r)+s... | [
"assignment.add"
] | 492,883 | 492,884 | u845536647 | python |
p02720 | K = 12
table = [1, 2, 3, 4, 5, 6, 7, 8, 9]
for i in table:
if len(table) > K:
break
x = i % 10
for j in range(max(0, x - 1), min(x + 2, 10)):
table.append(i * 10 + j)
print(table[K-1]) | K = int(input())
table = [1, 2, 3, 4, 5, 6, 7, 8, 9]
for i in table:
if len(table) > K:
break
x = i % 10
for j in range(max(0, x - 1), min(x + 2, 10)):
table.append(i * 10 + j)
print(table[K-1]) | [
"assignment.value.change",
"identifier.replace.add",
"literal.replace.remove",
"call.arguments.add"
] | 492,894 | 492,895 | u873616440 | python |
p02720 | k = int(input())
l = [1,2,3,4,5,6,7,8,9]
c = 0
while k>len(l):
f = str(l[c])
if f[-1]!=0:
l.append(int(f)*10 + int(f[-1])-1)
l.append(int(f)*10 + int(f[-1]))
if f[-1]!=9:
l.append(int(f)*10 + int(f[-1])+1)
c += 1
print(l[k-1]) | k = int(input())
l = [1,2,3,4,5,6,7,8,9]
c = 0
while k>len(l):
f = str(l[c])
if int(f[-1])!=0:
l.append(int(f)*10 + int(f[-1])-1)
l.append(int(f)*10 + int(f[-1]))
if int(f[-1])!=9:
l.append(int(f)*10 + int(f[-1])+1)
c += 1
print(l[k-1]) | [
"control_flow.branch.if.condition.change",
"call.add"
] | 492,900 | 492,901 | u183657342 | python |
p02720 | def dfs(r):
global l
if len(r) == 11:
return
l.append(int(r))
for i in range(-1, 2):
tmp = int(r[-1]) + i
if 0 <= tmp <= 9:
dfs(r + str(tmp))
k = int(input())
l = []
for i in range(1, 10):
dfs(str(i))
print(sorted(l)[k]) | def dfs(r):
global l
if len(r) == 11:
return
l.append(int(r))
for i in range(-1, 2):
tmp = int(r[-1]) + i
if 0 <= tmp <= 9:
dfs(r + str(tmp))
k = int(input())
l = []
for i in range(1, 10):
dfs(str(i))
print(sorted(l)[k - 1]) | [
"expression.operation.binary.add"
] | 492,915 | 492,916 | u377989038 | python |
p02720 | cur = []
def recur(n):
if n > 10 ** 9:
return
cur.append(n)
for i in range(10):
if abs(n % 10 - i) <= 1:
recur(10 * n + i)
for i in range(1, 10):
recur(i)
cur.sort()
n = int(input())
print((cur[n - 1])) | cur = []
def recur(n):
if n > 10 ** 10:
return
cur.append(n)
for i in range(10):
if abs(n % 10 - i) <= 1:
recur(10 * n + i)
for i in range(1, 10):
recur(i)
cur.sort()
n = int(input())
print((cur[n - 1])) | [
"literal.number.integer.change",
"control_flow.branch.if.condition.change"
] | 492,919 | 492,918 | u572138437 | python |
p02720 | from collections import deque
def main():
K = int(input())
if K <= 0:
print(K)
que = deque(range(1,10))
# print(que)
cnt = 9
while True:
x = que.popleft()
mod = x % 10
if mod != 0:
que.append(10 * x + mod - 1)
# print(que)
cn... | from collections import deque
def main():
K = int(input())
if K <= 9:
print(K)
return
que = deque(range(1,10))
# print(que)
cnt = 9
while True:
x = que.popleft()
mod = x % 10
if mod != 0:
que.append(10 * x + mod - 1)
# print(que)... | [
"literal.number.integer.change",
"control_flow.branch.if.condition.change",
"control_flow.return.add"
] | 492,928 | 492,927 | u165394332 | python |
p02720 | K = int(input())
def cal():
count = 9
d = [[1,2,3,4,5,6,7,8,9]]
for i in range(10**9):
d_ = []
for j in range(len(d[i])):
a = str(d[i][j])
if a[-1]=="0":
for k in [0,1]:
d_.append(int(a)*10+k)
count += 1
... | K = int(input())
def cal():
count = 9
d = [[1,2,3,4,5,6,7,8,9]]
for i in range(10**9):
d_ = []
for j in range(len(d[i])):
a = str(d[i][j])
if a[-1]=="0":
for k in [0, 1]:
d_.append(int(a)*10+k)
count += 1
... | [
"identifier.change",
"control_flow.branch.if.condition.change"
] | 492,931 | 492,932 | u700805562 | python |
p02720 | K = int(input())
def cal():
count = 9
d = [[1,2,3,4,5,6,7,8,9]]
for i in range(10**9):
d_ = []
for j in range(len(d[i])):
a = str(d[i][j])
if a[-1]=="0":
for k in [0,1]:
d_.append(int(a)*10+k)
count += 1
... | K = int(input())
def cal():
count = 9
d = [[1,2,3,4,5,6,7,8,9]]
for i in range(10**9):
d_ = []
for j in range(len(d[i])):
a = str(d[i][j])
if a[-1]=="0":
for k in [0, 1]:
d_.append(int(a)*10+k)
count += 1
... | [
"identifier.change",
"control_flow.branch.if.condition.change",
"call.arguments.change",
"io.output.change"
] | 492,933 | 492,932 | u700805562 | python |
p02720 | import math
import queue
def readInt():
return int(input())
def readInts():
return list(map(int, input().split()))
def readChars():
return input().split()
q = queue.Queue()
for i in range(1,10):
q.put(i)
n = readInt()
for i in range(1,100000):
a = str(q.get())
b = int(a[-1])
print(b)
if b!=0:
q.put(in... | import math
import queue
def readInt():
return int(input())
def readInts():
return list(map(int, input().split()))
def readChars():
return input().split()
q = queue.Queue()
for i in range(1,10):
q.put(i)
n = readInt()
for i in range(1,100001):
a = str(q.get())
b = int(a[-1])
if b!=0:
q.put(int(a+str(b-... | [
"literal.number.integer.change",
"call.arguments.change",
"control_flow.loop.range.bounds.upper.change",
"call.remove",
"misc.opposites",
"expression.operator.compare.change",
"control_flow.branch.if.condition.change"
] | 492,934 | 492,935 | u509739538 | python |
p02720 | def jud(n1,n2):
if abs(n1-int(str(n2)[0]))<=1:
return 1
else:
return 0
rnrn = [[1,2,3,4,5,6,7,8,9],[10,11,12,21,22,23,32,33,34,43,44,45,54,55,56,65,66,67,76,77,78,87,88,89,98,99]]
for div in range(1,12):
rnrn.append([])
for i in range(len(rnrn[div])):
y = str(rnrn[div][i])
x = int(y[-1])
if x-1!=-1:
... | def jud(n1,n2):
if abs(n1-int(str(n2)[0]))<=1:
return 1
else:
return 0
rnrn = [[1,2,3,4,5,6,7,8,9],[10,11,12,21,22,23,32,33,34,43,44,45,54,55,56,65,66,67,76,77,78,87,88,89,98,99]]
for div in range(1,10):
rnrn.append([])
for i in range(len(rnrn[div])):
y = str(rnrn[div][i])
x = int(y[-1])
if x-1!=-1:
... | [
"literal.number.integer.change",
"call.arguments.change",
"control_flow.loop.range.bounds.upper.change"
] | 492,936 | 492,937 | u509739538 | python |
p02720 | K = int(input())
import queue
q = queue.Queue()
for i in range(1,10):
q.put(i)
for i in range(K-1):
num = q.get()
if num%10!=0:
q.put(10*num+(num%10)-1)
q.put(num*10)
if num%10!=9:
q.put(10*num+(num%10)+1)
print(q.get()) | K = int(input())
import queue
q = queue.Queue()
for i in range(1,10):
q.put(i)
for i in range(K-1):
num = q.get()
if num%10!=0:
q.put(10*num+(num%10)-1)
q.put(num*10+(num%10))
if num%10!=9:
q.put(10*num+(num%10)+1)
print(q.get()) | [
"expression.operation.binary.add"
] | 492,951 | 492,952 | u004312392 | python |
p02720 | import queue
k = int(input())
q = queue.Queue()
for i in range(1,10):
q.put(i)
c = 1
while c<k:
x = q.get()
r = x%10
if r != 0 and r != 9:
q.put(10*x+r-1)
q.put(10*x+r)
q.put(10*x+r+1)
c = c+1
if r == 0:
q.put(10*x)
q.put(10*x+1)
c = c+... | import queue
k = int(input())
q = queue.Queue()
for i in range(1,10):
q.put(i)
c = 0
while c<k:
x = q.get()
r = x%10
if r != 0 and r != 9:
q.put(10*x+r-1)
q.put(10*x+r)
q.put(10*x+r+1)
c = c+1
if r == 0:
q.put(10*x)
q.put(10*x+1)
c = c+... | [
"literal.number.integer.change",
"assignment.value.change"
] | 492,961 | 492,962 | u952773501 | python |
p02720 | k = int(input())
#n, k = list(map(int, input().split()))
#a = list(map(int, input().split()))
q = deque([1, 2, 3, 4, 5, 6, 7, 8, 9])
for i in range(k):
x = q.popleft()
a = 10*x+(x % 10)
if x % 10 != 0:
q.append(a-1)
q.append(a)
if x % 10 != 9:
q.append(a+1)
print(x) | from collections import deque
k = int(input())
q = deque([1, 2, 3, 4, 5, 6, 7, 8, 9])
for i in range(k):
x = q.popleft()
a = 10*x+(x % 10)
if x % 10 != 0:
q.append(a-1)
q.append(a)
if x % 10 != 9:
q.append(a+1)
print(x)
| [] | 492,969 | 492,970 | u696444274 | python |
p02720 | import sys
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines
K = int(read())
pre_lis = []
for i in range(1,10):
pre_lis.append(str(i))
print(pre_lis)
ct = 9
if K <= 9:
print(pre_lis[K-1])
else:
new_lis = []
flag = False
while ct < K:
... | import sys
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines
K = int(read())
pre_lis = []
for i in range(1,10):
pre_lis.append(str(i))
ct = 9
if K <= 9:
print(pre_lis[K-1])
else:
new_lis = []
flag = False
while ct < K:
for num in... | [
"call.remove"
] | 492,971 | 492,972 | u711340028 | python |
p02720 | # import numpy as np
def solve():
print(ll_no_dup[k-1])
return
#a = [int(i) for i in input().split(" ")]
lunluns = [str(i) for i in range(1, 10)]
it = 0
count = 0
all_count = len(lunluns)
while count <= 2*10 ** 5:
it = len(lunluns)
last_count = all_count
all_count = 0
for i in range... | # import numpy as np
def solve():
print(ll_no_dup[k-1])
return
#a = [int(i) for i in input().split(" ")]
lunluns = [str(i) for i in range(1, 10)]
it = 0
count = 0
all_count = len(lunluns)
while count <= 10 ** 5:
it = len(lunluns)
last_count = all_count
all_count = 0
for i in range(i... | [
"expression.operation.binary.remove",
"control_flow.loop.for.condition.change",
"literal.number.integer.change",
"assignment.value.change",
"call.arguments.change"
] | 492,978 | 492,979 | u618101737 | python |
p02720 | # import numpy as np
def solve():
print(ll_no_dup[k-1])
return
#a = [int(i) for i in input().split(" ")]
lunluns = [str(i) for i in range(1, 10)]
it = 0
count = 0
all_count = len(lunluns)
while count <= 10 ** 5:
it = len(lunluns)
last_count = all_count
all_count = 0
for i in range(i... | # import numpy as np
def solve():
print(ll_no_dup[k-1])
return
#a = [int(i) for i in input().split(" ")]
lunluns = [str(i) for i in range(1, 10)]
it = 0
count = 0
all_count = len(lunluns)
while count <= 10 ** 5:
it = len(lunluns)
last_count = all_count
all_count = 0
for i in range(i... | [
"literal.number.integer.change",
"assignment.value.change",
"call.arguments.change"
] | 492,981 | 492,979 | u618101737 | python |
p02720 | import collections
k = int(input())
li = [str(i) for i in range(1,10)]
st_li = li[:]
q = collections.deque(li)
count = 0
n = 10 ** 10
for i in range(1,n):
# print(st_li)
a = q.popleft()
num = int(a[-1])
# print(num)
if num != 0:
aa = a + str(num-1)
st_li.append(aa)
q.append... | import collections
k = int(input())
li = [str(i) for i in range(1,10)]
st_li = li[:]
q = collections.deque(li)
count = 0
n = 10 ** 10
for i in range(1,n):
# print(st_li)
a = q.popleft()
num = int(a[-1])
# print(num)
if num != 0:
aa = a + str(num-1)
st_li.append(aa)
q.append... | [
"call.add"
] | 492,995 | 492,996 | u737758066 | python |
p02720 | k = int(input())
a[i] = [1, 2, 3, 4, 5, 6, 7, 8, 9]
for i in range(k):
if a[i] % 10 != 0:
a.append(10*a[i] + a[i] % 10 - 1)
a.append(10*a[i] + a[i] % 10)
if a[i] % 10 != 9:
a.append(10*a[i] + a[i] % 10 + 1)
print(a[k - 1])
| k = int(input())
a = [1, 2, 3, 4, 5, 6, 7, 8, 9]
for i in range(k):
if a[i] % 10 != 0:
a.append(10*a[i] + a[i] % 10 - 1)
a.append(10*a[i] + a[i] % 10)
if a[i] % 10 != 9:
a.append(10*a[i] + a[i] % 10 + 1)
print(a[k - 1])
| [] | 492,999 | 493,000 | u065578867 | python |
p02720 | k = int(input())
def fun(k):
lun_luns = [1, 2, 3, 4, 5, 6, 7, 8, 9]
index = 0
while True:
if len(lun_luns) >= k:
break
num = lun_luns[index]
mod = num%10
n = num*10
if mod == 9:
lun_luns.extend([n+mod-1, n+mod])
elif mod == 0:
... | k = int(input())
def fun(k):
lun_luns = [1, 2, 3, 4, 5, 6, 7, 8, 9]
index = 0
while True:
if len(lun_luns) >= k:
break
num = lun_luns[index]
mod = num%10
n = num*10
if mod == 9:
lun_luns.extend([n+mod-1, n+mod])
elif mod == 0:
... | [
"expression.operation.binary.remove"
] | 493,006 | 493,007 | u130203301 | python |
p02720 | k = int(input())
def fun(k):
lun_luns = [1, 2, 3, 4, 5, 6, 7, 8, 9]
index = 0
while True:
if len(lun_luns) >= k:
break
num = lun_luns[index]
mod = num%10
n = num*10
if mod == 9:
lun_luns.extend([n+mod-1, n+mod])
elif mod == 0:
... | k = int(input())
def fun(k):
lun_luns = [1, 2, 3, 4, 5, 6, 7, 8, 9]
index = 0
while True:
if len(lun_luns) >= k:
break
num = lun_luns[index]
mod = num%10
n = num*10
if mod == 9:
lun_luns.extend([n+mod-1, n+mod])
elif mod == 0:
... | [
"expression.operation.binary.add"
] | 493,008 | 493,007 | u130203301 | python |
p02720 | K = int(input())
# 1桁
K1 = [x for x in range(1, 10)]
#2桁
def add_2(Kn):
K_ = []
for i in Kn:
K_.append(10*i + (i % 10 - 1))
K_.append(10*i + i % 10)
if i % 10 < 9:
K_.append(10*i + (i % 10+ 1))
return K_
def add_(Kn):
K_ = []
for i in Kn:
if i%... | K = int(input())
# 1桁
K1 = [x for x in range(1, 10)]
#2桁
def add_2(Kn):
K_ = []
for i in Kn:
K_.append(10*i + (i % 10 - 1))
K_.append(10*i + i % 10)
if i % 10 < 9:
K_.append(10*i + (i % 10+ 1))
return K_
def add_(Kn):
K_ = []
for i in Kn:
if i%... | [
"call.remove"
] | 493,022 | 493,023 | u705877417 | python |
p02720 | k = int(input())
lunlun = list(range(1, 10))
for i in range(k - 1):
a = lunlun[i]
b = a * 10 + a % 10
if a % 10 != 0:
lunlun.append(b - 1)
lunlun.append(b)
if a % 10 != 9:
lunlun.append(b + 1)
print(lunlun)
print(lunlun[k - 1]) | k = int(input())
lunlun = list(range(1, 10))
for i in range(k - 1):
a = lunlun[i]
b = a * 10 + a % 10
if a % 10 != 0:
lunlun.append(b - 1)
lunlun.append(b)
if a % 10 != 9:
lunlun.append(b + 1)
print(lunlun[k - 1]) | [
"call.remove"
] | 493,024 | 493,025 | u152331265 | python |
p02720 | k = int(input())
lunlun = list(range(1, 10))
for i in range(k - 1):
a = lunlun[i]
b = a * 10 + a % 10
if a % 10 != 0:
lunlun.append(b - 1)
lunlun.append(b)
if a % 10 != 9:
lunlun.append(b + 1)
print(lunlun)
print(lunlun[k - 1]) | k = int(input())
lunlun = list(range(1, 10))
for i in range(k-1):
a = lunlun[i]
b = a * 10 + a % 10
if a % 10 != 0:
lunlun.append(b - 1)
lunlun.append(b)
if a % 10 != 9:
lunlun.append(b + 1)
print(lunlun[k-1]) | [
"call.remove"
] | 493,024 | 493,027 | u152331265 | python |
p02720 | def resolve():
from collections import deque
k = int(input())
a = [1,2,3,4,5,6,7,8,9]
a = deque(a)
c = 0
if k < 10:
print(k)
else:
while c != k:
c += 1
t = a.popleft()
if t % 10 == 0:
a.append(t*10)
a.append(... | def resolve():
from collections import deque
k = int(input())
a = [1,2,3,4,5,6,7,8,9]
a = deque(a)
c = 0
if k < 10:
print(k)
else:
while c != k:
c += 1
t = a.popleft()
if t % 10 == 0:
a.append(t*10)
a.append(... | [
"call.remove",
"call.add"
] | 493,035 | 493,036 | u793868662 | python |
p02720 | import sys
from itertools import accumulate
K = int(input())
MAX = 22
dp = [[0]*10 for _ in [0]*MAX]
for j in range(0, 10):
dp[1][j] = 1
for i in range(2, MAX):
for j in range(1, 9):
dp[i][j] = dp[i-1][j-1] + dp[i-1][j] + dp[i-1][j+1]
dp[i][0] = dp[i-1][0] + dp[i-1][1]
dp[i][9] = dp[i-1][8] +... | import sys
from itertools import accumulate
K = int(input())
MAX = 22
dp = [[0]*10 for _ in [0]*MAX]
for j in range(0, 10):
dp[1][j] = 1
for i in range(2, MAX):
for j in range(1, 9):
dp[i][j] = dp[i-1][j-1] + dp[i-1][j] + dp[i-1][j+1]
dp[i][0] = dp[i-1][0] + dp[i-1][1]
dp[i][9] = dp[i-1][8] +... | [
"call.add",
"call.arguments.change"
] | 493,041 | 493,042 | u223663729 | python |
p02720 | k = int(input())
que = []
for i in range(1,10):
que.append(i)
ct = 0
while(len(que) < k):
ct += 1
value = que[0]
que.remove(value)
for i in [-1,0,1]:
if 0 <= (value%10) + i and (value%10) + i <= 9:
tmp = 10*value + (value%10) + i
q.append(tmp)
print(que[k-1-ct]) | k = int(input())
que = []
for i in range(1,10):
que.append(i)
ct = 0
while(len(que) < k):
ct += 1
value = que[0]
que.remove(value)
for i in [-1,0,1]:
if 0 <= (value%10) + i and (value%10) + i <= 9:
tmp = 10*value + (value%10) + i
que.append(tmp)
print(que[k-1-ct]) | [
"identifier.change"
] | 493,047 | 493,048 | u992951814 | python |
p02720 | #n桁のるんるん数のrisutoを求める
import sys
sys.setrecursionlimit(10**9)
def runrun(n):
if n == 1:
return [['1','2','3','4','5','6','7','8','9']]
else:
li = runrun(n-1)
li2 = []
for i in range(len(li[n-2])):
p = int(li[n-2][i][-1])
if p == 0:
li2.app... | #n桁のるんるん数のrisutoを求める
import sys
sys.setrecursionlimit(10**9)
def runrun(n):
if n == 1:
return [['1','2','3','4','5','6','7','8','9']]
else:
li = runrun(n-1)
li2 = []
for i in range(len(li[n-2])):
p = int(li[n-2][i][-1])
if p == 0:
li2.app... | [
"call.remove"
] | 493,062 | 493,063 | u594803920 | python |
p02720 | # coding: utf-8
DATA = """
100000
""".split("\n")
def get_debug_line():
for i in DATA:
yield i
if 1:
get_line = input
else:
get_line = get_debug_line().__next__
get_line()
def Calc():
K = [int(i) for i in get_line().strip().split(" ")][0]
ret = [str(_) for _ in range(1,10)]
size = len(ret)
start = 0
pri... | # coding: utf-8
DATA = """
100000
""".split("\n")
def get_debug_line():
for i in DATA:
yield i
if 1:
get_line = input
else:
get_line = get_debug_line().__next__
get_line()
def Calc():
K = [int(i) for i in get_line().strip().split(" ")][0]
ret = [str(_) for _ in range(1,10)]
size = len(ret)
start = 0
count... | [
"call.remove"
] | 493,070 | 493,071 | u712052023 | python |
p02720 | from collections import deque
q=deque([1,2,3,4,5,6,7,8,9])
n=int(input())
def check(k):
while k<=n:
a=q.popleft()
if a%10-1>=0:
q.append(a*10+a%10-1)
k=k+1
if k==n:
return a*10+a%10-1
k=k+1
q.append(a*10+a%10)
if k==n:
return a*10+a%10
if a%10+1<=9:
q.app... | from collections import deque
q=deque([1,2,3,4,5,6,7,8,9])
n=int(input())
def check(k):
while k<=n:
a=q.popleft()
if a%10-1>=0:
q.append(a*10+a%10-1)
k=k+1
if k==n:
return a*10+a%10-1
k=k+1
q.append(a*10+a%10)
if k==n:
return a*10+a%10
if a%10+1<=9:
q.app... | [
"expression.operator.arithmetic.change",
"function.return_value.change",
"expression.operation.binary.change"
] | 493,074 | 493,075 | u437351386 | python |
p02720 | from collections import deque
q=deque([1,2,3,4,5,6,7,8,9])
n=int(input())
def check(k):
while k<n:
a=q.popleft()
if a%10-1>=0:
q.append(a*10+a%10-1)
k=k+1
if k==n:
return a*10+a%10-1
k=k+1
q.append(a*10+a%10)
if k==n:
return a*10+a%10
if a%10+1<=9:
q.appe... | from collections import deque
q=deque([1,2,3,4,5,6,7,8,9])
n=int(input())
def check(k):
while k<=n:
a=q.popleft()
if a%10-1>=0:
q.append(a*10+a%10-1)
k=k+1
if k==n:
return a*10+a%10-1
k=k+1
q.append(a*10+a%10)
if k==n:
return a*10+a%10
if a%10+1<=9:
q.app... | [
"expression.operator.compare.change",
"control_flow.loop.condition.change",
"expression.operator.arithmetic.change",
"function.return_value.change",
"expression.operation.binary.change"
] | 493,076 | 493,075 | u437351386 | python |
p02720 | import queue
num=int(input())
q=queue.Queue()
for i in range(1,10):
q.put(i)
for j in range(num):
ans=q.get()
if ans%10!=0:
q.put(10*ans+(ans%10)-1)
q.put(10*ans+(ans%10))
if ans%10!=0:
q.put(10*ans+(ans%10)+1)
print(ans) | import queue
num=int(input())
q=queue.Queue()
for i in range(1,10):
q.put(i)
for j in range(num):
ans=q.get()
if ans%10!=0:
q.put(10*ans+(ans%10)-1)
q.put(10*ans+(ans%10))
if ans%10!=9:
q.put(10*ans+(ans%10)+1)
print(ans) | [
"literal.number.integer.change",
"control_flow.branch.if.condition.change"
] | 493,101 | 493,102 | u736564905 | python |
p02720 | import queue
num=int(input())
q=queue.Queue()
for i in range(1,10):
q.put(i)
for j in range(num):
ans=q.get()
if ans%10!=0:
q.put(10*ans+(ans%10)-1)
q.put(10*ans+(ans%10)-1)
if ans%10!=0:
q.put(10*ans+(ans%10)+1)
print(ans) | import queue
num=int(input())
q=queue.Queue()
for i in range(1,10):
q.put(i)
for j in range(num):
ans=q.get()
if ans%10!=0:
q.put(10*ans+(ans%10)-1)
q.put(10*ans+(ans%10))
if ans%10!=9:
q.put(10*ans+(ans%10)+1)
print(ans) | [
"expression.operation.binary.remove",
"literal.number.integer.change",
"control_flow.branch.if.condition.change"
] | 493,103 | 493,102 | u736564905 | python |
p02720 | import queue
num=int(input())
q=queue.Queue()
for i in range(1,10):
q.put(i)
for j in range(num):
ans=q.get()
if ans%10!=0:
q.put(10*ans+(ans%10)-1)
q.put(10*ans+(ans%10)-1)
if ans%10!=0:
q.put(10*ans+(ans%10)-1)
print(ans) | import queue
num=int(input())
q=queue.Queue()
for i in range(1,10):
q.put(i)
for j in range(num):
ans=q.get()
if ans%10!=0:
q.put(10*ans+(ans%10)-1)
q.put(10*ans+(ans%10))
if ans%10!=9:
q.put(10*ans+(ans%10)+1)
print(ans) | [
"expression.operation.binary.remove",
"literal.number.integer.change",
"control_flow.branch.if.condition.change",
"misc.opposites",
"expression.operator.arithmetic.change",
"call.arguments.change",
"expression.operation.binary.change"
] | 493,104 | 493,102 | u736564905 | python |
p02720 | import queue
n = int(input())
q = queue.Queue()
for i in range(1,10):
q.put(i)
x = 0
for i in range(n):
x = q.get()
l = x % 10
print(x,l)
if l != 0:
q.put(x*10 + l - 1)
q.put(x*10 + l)
if l != 9:
q.put(x*10 + l + 1)
#while not q.empty():
# print (q.get())
... | import queue
n = int(input())
q = queue.Queue()
for i in range(1,10):
q.put(i)
x = 0
for i in range(n):
x = q.get()
l = x % 10
# print(x,l)
if l != 0:
q.put(x*10 + l - 1)
q.put(x*10 + l)
if l != 9:
q.put(x*10 + l + 1)
#while not q.empty():
# print (q.get())
... | [
"call.remove"
] | 493,114 | 493,115 | u178465329 | python |
p02720 | from collections import deque
k = int(input())
d = deque([1,2,3,4,5,6,7,8,9])
for i in range(k):
a = d.popleft()
if a % 10 != 0:
d.append(a*10 + a % 10 - 1)
d.append(a*10 + a % 10)
if a % 10 != 9:
d.append(i*10 + i % 10 + 1)
print(a)
| from collections import deque
k = int(input())
d = deque([1,2,3,4,5,6,7,8,9])
for i in range(k):
a = d.popleft()
if a % 10 != 0:
d.append(a*10 + a % 10 - 1)
d.append(a*10 + a % 10)
if a % 10 != 9:
d.append(a*10 + a % 10 + 1)
print(a)
| [
"identifier.change",
"call.arguments.change",
"expression.operation.binary.change"
] | 493,118 | 493,119 | u875449556 | python |
p02720 | from collections import deque
k = int(input())
a = deque([1,2,3,4,5,6,7,8,9])
count=0
while count !=k:
b = a.popleft()
count += 1
if b%10==0:
a.append(b*10)
a.append(b*10+1)
elif b%9==0:
a.append(b*11-1)
a.append(b*10+9)
else:
a.append(b*10+b%10-1)
a.append(b*10+b%10)
a.append(b*10... | from collections import deque
k = int(input())
a = deque([1,2,3,4,5,6,7,8,9])
count=0
while count !=k:
b = a.popleft()
count += 1
if b%10==0:
a.append(b*10)
a.append(b*10+1)
elif b%10==9:
a.append(b*10+8)
a.append(b*10+9)
else:
a.append(b*10+b%10-1)
a.append(b*10+b%10)
a.append(b*1... | [
"literal.number.integer.change",
"control_flow.branch.if.condition.change"
] | 493,127 | 493,128 | u288430479 | python |
p02720 | k=int(input())
a=[i+1 for i in range(9)]
while (1):
if k<=len(a):
print(a[k-1])
f=1
break
k=k-len(a)
#print(k)
b=[]
for x in a:
for i in [-1,0,1]:
d=x%10+i
#print(d)
if d<0 or d>10: continue
b.append(x*10+d)
a=b.copy()
| k=int(input())
a=[i+1 for i in range(9)]
while (1):
if k<=len(a):
print(a[k-1])
f=1
break
k=k-len(a)
#print(k)
b=[]
for x in a:
for i in [-1,0,1]:
d=x%10+i
#print(d)
if d<0 or d>=10: continue
b.append(x*10+d)
a=b.copy()
#print(a)
| [
"expression.operator.compare.change",
"control_flow.branch.if.condition.change"
] | 493,129 | 493,130 | u864273141 | python |
p02720 | from copy import deepcopy
k = int(input())
lun = []
for i in range(1,10):
lun.append(i)
if k <= 9:
print(lun[k-1])
exit()
prev_lun = deepcopy(lun)
while True:
size = len(lun)
for pl in prev_lun:
for i in [-1, 0, 1]:
d = pl%10 + i
if 0 <= d <= 9:
lu... | from copy import deepcopy
k = int(input())
lun = []
for i in range(1,10):
lun.append(i)
if k <= 9:
print(lun[k-1])
exit()
prev_lun = deepcopy(lun)
while True:
size = len(lun)
for pl in prev_lun:
for i in [-1, 0, 1]:
d = pl%10 + i
if 0 <= d <= 9:
lu... | [
"expression.operation.binary.remove"
] | 493,131 | 493,132 | u353895424 | python |
p02720 | import queue
k = int(input())
q = [1,2,3,4,5,6,7,8,9]
qq = queue.Queue()
for i in range(1,10):
qq.put(i)
for i in range(k):
x = qq.get()
if x%10 != 0:
qq.put(10*x + (x%10) -1)
qq.put(10*x + (x%10))
if x%9 != 0:
qq.put(10*x + (x%10) +1)
print(x)
| import queue
k = int(input())
q = [1,2,3,4,5,6,7,8,9]
qq = queue.Queue()
for i in range(1,10):
qq.put(i)
for i in range(k):
x = qq.get()
if x%10 != 0:
qq.put(10*x + (x%10) -1)
qq.put(10*x + (x%10))
if x%10 != 9:
qq.put(10*x + (x%10) +1)
print(x)
| [
"literal.number.integer.change",
"control_flow.branch.if.condition.change"
] | 493,133 | 493,134 | u698977701 | python |
p02720 | from collections import deque
n = int(input())
c = 0
q = deque()
for i in range(1, 10):
q.append(i)
k = 1
while c < n:
k = q.popleft()
if k%10:
q.append(10*k + k%10 - 1)
q.append(10 * k + k % 10)
if k%10 != 9:
q.append(10*k + (k%10) + 1)
c += 1
print(k)
# c = 0
#... | from collections import deque
n = int(input())
c = 0
q = deque()
for i in range(1, 10):
q.append(i)
k = 1
while c < n:
k = q.popleft()
# print(k)
if k%10:
q.append(10*k + k%10 - 1)
q.append(10 * k + k % 10)
if k%10 != 9:
q.append(10*k + (k%10) + 1)
c += 1
print(k) | [] | 493,135 | 493,136 | u002166247 | python |
p02720 |
n=int(input())
from collections import deque
k=deque([])
z=9
m=0
if n<10:
print(n)
exit()
for i in range(1,10):
k.append(i)
while z!=n:
m=k.pop()
k.popleft
if m%10!=0:
ans=10*m+(m%10)-1
k.append(ans)
z+=1
if z==n:
print(ans)
exit()
ans... | n=int(input())
from collections import deque
k=deque([])
z=9
m=0
if n<10:
print(n)
exit()
for i in range(1,10):
k.append(i)
while z!=n:
m=k.popleft()
if m%10!=0:
ans=10*m+(m%10)-1
k.append(ans)
z+=1
if z==n:
print(ans)
exit()
ans=10*m+(m%10... | [
"assignment.value.change",
"identifier.change"
] | 493,137 | 493,138 | u185405877 | python |
p02720 | from collections import deque
def make_lunlun():
lst = []
que = deque([1,2,3,4,5,6,7,8,9])
for i in range(10):
str_num = str(que.popleft())
str_one = str_num[-1]
a = str(int(str_one) - 1)
b = str(int(str_one) + 1)
#minus = int(str_num + a)
same = int(str_num ... | from collections import deque
def make_lunlun():
lst = []
que = deque([1,2,3,4,5,6,7,8,9])
for i in range(100000):
str_num = str(que.popleft())
str_one = str_num[-1]
a = str(int(str_one) - 1)
b = str(int(str_one) + 1)
#minus = int(str_num + a)
same = int(str_... | [
"literal.number.integer.change",
"call.arguments.change",
"control_flow.loop.range.bounds.upper.change"
] | 493,139 | 493,140 | u757117214 | python |
p02720 | from collections import deque
def main(k):
q = deque([])
for i in range(1, 10):
q.append(i)
count = 0
top = -1
while True:
top = q.popleft()
count += 1
if count == k:
return top
if top%10 != 0:
q.append(top*10 + top%10-1)
... | from collections import deque
def main(k):
q = deque([])
for i in range(1, 10):
q.append(i)
count = 0
top = -1
while True:
top = q.popleft()
count += 1
if count == k:
return top
if top%10 != 0:
q.append(top*10 + top%10-1)
... | [
"call.add",
"call.arguments.change"
] | 493,145 | 493,146 | u296557772 | python |
p02720 | from collections import deque
def main(k):
q = deque([])
for i in range(10):
q.append(i)
count = 0
top = -1
while True:
top = q.popleft()
count += 1
if count == k:
return top
if top%10 != 0:
q.append(top*10 + top%10-1)
q.... | from collections import deque
def main(k):
q = deque([])
for i in range(1, 10):
q.append(i)
count = 0
top = -1
while True:
top = q.popleft()
count += 1
if count == k:
return top
if top%10 != 0:
q.append(top*10 + top%10-1)
... | [
"call.arguments.add",
"call.add",
"call.arguments.change"
] | 493,147 | 493,146 | u296557772 | python |
p02720 | K = int(input())
queue = list(range(1, 10))
if K < 10:
print(K)
else:
i = 0
while K > len(queue):
if queue[i] % 10 != 0:
l = 10 * queue[i] + queue[i] % 10 - 1
queue.append(l)
l = 10 * queue[i] + queue[i] % 10
queue.append(l)
if queu... | K = int(input())
queue = list(range(1, 10))
if K < 10:
print(K)
else:
i = 0
while K > len(queue):
if queue[i] % 10 != 0:
l = 10 * queue[i] + queue[i] % 10 - 1
queue.append(l)
l = 10 * queue[i] + queue[i] % 10
queue.append(l)
if queu... | [
"expression.operation.binary.add"
] | 493,156 | 493,157 | u471641802 | python |
p02720 | K = int(input())
queue = list(range(1, 10))
if K < 10:
print(K)
else:
i = 0
while K > len(queue):
if queue[i] % 10 != 0:
l = 10 * queue[i] + queue[i] % 10 - 1
queue.append(l)
l = 10 * queue[i] + queue[i] % 10
queue.append(l)
if queu... | K = int(input())
queue = list(range(1, 10))
if K < 10:
print(K)
else:
i = 0
while K > len(queue):
if queue[i] % 10 != 0:
l = 10 * queue[i] + queue[i] % 10 - 1
queue.append(l)
l = 10 * queue[i] + queue[i] % 10
queue.append(l)
if queu... | [
"call.arguments.change"
] | 493,158 | 493,157 | u471641802 | python |
p02720 | K = int(input())
queue = list(range(1, 10))
if K <= 10:
print(K)
else:
i = 0
while K > len(queue):
if queue[i] % 10 != 0:
l = 10 * queue[i] + queue[i] % 10 - 1
queue.append(l)
l = 10 * queue[i] + queue[i] % 10
queue.append(l)
if que... | K = int(input())
queue = list(range(1, 10))
if K < 10:
print(K)
else:
i = 0
while K > len(queue):
if queue[i] % 10 != 0:
l = 10 * queue[i] + queue[i] % 10 - 1
queue.append(l)
l = 10 * queue[i] + queue[i] % 10
queue.append(l)
if queu... | [
"expression.operator.compare.change",
"control_flow.branch.if.condition.change",
"call.arguments.change"
] | 493,159 | 493,157 | u471641802 | python |
p02720 | from collections import deque
def main():
K = int(input())
cnt = 0
mod = 10
q = deque([])
for i in range(1, 10):
q.append(i)
while cnt < K:
x = q.popleft()
cnt += 1
if x%mod == 0:
q.append(10*x + (x%mod))
q.append(10*x + (x%mod)+1... | ## キューとスタックhttp://ailaby.com/deque/
## https://qiita.com/drken/items/6a95b57d2e374a3d3292
from collections import deque
def main():
K = int(input())
cnt = 0
mod = 10
q = deque([])
for i in range(1, 10):
q.append(i)
while cnt < K:
x = q.popleft()
cnt += 1
... | [
"call.remove",
"call.add"
] | 493,160 | 493,161 | u155687575 | python |
p02719 | N, K = map(int,input().split())
q = N % K
ans = min(q, N-q)
print(ans) | N, K = map(int,input().split())
q = N % K
ans = min(q, K-q)
print(ans) | [
"assignment.value.change",
"identifier.change",
"call.arguments.change",
"expression.operation.binary.change"
] | 493,175 | 493,176 | u574211979 | python |
p02720 | #input
K = int(input())
#output
q = queue.Queue()
for i in range(1, 10):
q.put(i)
for i in range(1, K+2):
x = q.get()
if x % 10 != 0:
q.put(10*x + (x % 10)-1)
q.put(10*x+(x % 10))
if x % 10 != 9:
q.put(10*x + (x % 10)+1)
if i == K:
print(x) | import queue
#input
K = int(input())
#output
q = queue.Queue()
for i in range(1, 10):
q.put(i)
for i in range(1, K+2):
x = q.get()
if x % 10 != 0:
q.put(10*x + (x % 10)-1)
q.put(10*x+(x % 10))
if x % 10 != 9:
q.put(10*x + (x % 10)+1)
if i == K:
print(x) | [] | 493,199 | 493,200 | u461454424 | python |
p02720 | import queue
k = int(input())
q = queue.Queue()
for l in range(10)[1:]:
q.put(l)
if k < 10:
print(q.queue[k])
k -= 9
for l in range(k):
dequeued = q.get()
mod = dequeued % 10
if mod != 0:
q.put(dequeued * 10 + mod - 1)
q.put(dequeued * 10 + mod)
if mod != 9:
q.put(dequeued *... | import queue
k = int(input())
q = queue.Queue()
for l in range(10)[1:]:
q.put(l)
if k < 10:
print(q.queue[k-1])
exit()
k -= 9
for l in range(k):
dequeued = q.get()
mod = dequeued % 10
if mod != 0:
q.put(dequeued * 10 + mod - 1)
q.put(dequeued * 10 + mod)
if mod != 9:
q.p... | [
"call.add"
] | 493,207 | 493,208 | u819593641 | python |
p02720 | k = int(input())
from collections import deque
queue = deque(range(1,10))
count = 0
while count < k:
count += 1
tmp = deque.popleft()
tail = tmp % 10
if tail!=0:
deque.append(tmp*10+tail-1)
deque.append(tmp*10+tail)
if tail!=9:
deque.append(tmp*10+tail+1)
print(tmp) | k = int(input())
from collections import deque
queue = deque(range(1,10))
count = 0
while count < k:
count += 1
tmp = queue.popleft()
tail = tmp % 10
if tail!=0:
queue.append(tmp*10+tail-1)
queue.append(tmp*10+tail)
if tail!=9:
queue.append(tmp*10+tail+1)
print(tmp) | [
"assignment.value.change",
"identifier.change"
] | 493,211 | 493,212 | u078181689 | python |
p02720 | k = int(input())
from collections import deque
queue = deque(range(1,10))
count = 0
while count < k:
count += 1
tmp = queue.popleft()
tail = tmp%10
if tail != 0:
queue.append(10*tmp+tail-1)
queue.append(10*tmp)
if tail != 9:
queue.append(10*tmp+tail+1)
print(tmp) | k = int(input())
from collections import deque
queue = deque(range(1,10))
count = 0
while count < k:
count += 1
tmp = queue.popleft()
tail = tmp%10
if tail != 0:
queue.append(10*tmp+tail-1)
queue.append(10*tmp+tail)
if tail != 9:
queue.append(10*tmp+tail+1)
print(tmp) | [
"expression.operation.binary.add"
] | 493,213 | 493,214 | u078181689 | python |
p02720 | k = int(input())
from collection import deque
queue = deque(range(1,10))
count = 0
while count < k:
count += 1
tmp = queue.popleft()
tail = tmp%10
if tail != 0:
queue.append(10*tmp+tail-1)
queue.append(10*tmp)
if tail != 9:
queue.append(10*tmp+tail+1)
print(tmp) | k = int(input())
from collections import deque
queue = deque(range(1,10))
count = 0
while count < k:
count += 1
tmp = queue.popleft()
tail = tmp%10
if tail != 0:
queue.append(10*tmp+tail-1)
queue.append(10*tmp+tail)
if tail != 9:
queue.append(10*tmp+tail+1)
print(tmp) | [
"identifier.change"
] | 493,215 | 493,214 | u078181689 | python |
p02720 | k = int(input())
numset = {i for i in range(1,10)}
flag = False
count = len(numset)
if count >= k:
flag = True
arr = [numset]
index = 0
while not flag:
beforeset = arr[index]
tmpset = set()
for i in beforeset:
tail = str(i)[-1]
if tail == "0":
tmpset.add(int(str(i)+str(0)))... | k = int(input())
numset = {i for i in range(1,10)}
flag = False
count = len(numset)
if count >= k:
flag = True
arr = [numset]
index = 0
while not flag:
beforeset = arr[index]
tmpset = set()
for i in beforeset:
tail = str(i)[-1]
if tail == "0":
tmpset.add(int(str(i)+str(0)))... | [
"expression.operation.binary.add"
] | 493,216 | 493,217 | u078181689 | python |
p02720 | a = [1,2,3,4,5,6,7,8,9,10,100,1000,10000,100000,1000000,10000000,100000000,1000000000]
import heapq
heapq.heapify(a)
cnt = 18
c = 1
while True:
if cnt > 10**5:
break
for i in a:
if len(str(i)) == c:
m = i//10**(c-1)
if i//10**(c-1) == 1:
heapq.heappush(a,i+10**c*(i//10**(c-1)))
h... | a = [1,2,3,4,5,6,7,8,9,10,100,1000,10000,100000,1000000,10000000,100000000,1000000000]
import heapq
heapq.heapify(a)
cnt = 18
c = 1
while True:
if cnt > 10**5:
break
for i in a:
if len(str(i)) == c:
m = i//10**(c-1)
if i//10**(c-1) == 1:
heapq.heappush(a,i+10**c*(i//10**(c-1)))
h... | [
"control_flow.loop.range.bounds.upper.change",
"expression.operation.binary.add"
] | 493,230 | 493,231 | u075595666 | python |
p02720 | a = [1,2,3,4,5,6,7,8,9,10,100,1000,10000,100000,1000000,10000000,100000000,1000000000]
import heapq
heapq.heapify(a)
cnt = 18
c = 1
while True:
if cnt > 10**5:
break
for i in a:
if len(str(i)) == c:
m = i//10**(c-1)
if i//10**(c-1) == 1:
heapq.heappush(a,i+10**c*(i//10**(c-1)))
h... | a = [1,2,3,4,5,6,7,8,9,10,100,1000,10000,100000,1000000,10000000,100000000,1000000000]
import heapq
heapq.heapify(a)
cnt = 18
c = 1
while True:
if cnt > 10**5:
break
for i in a:
if len(str(i)) == c:
m = i//10**(c-1)
if i//10**(c-1) == 1:
heapq.heappush(a,i+10**c*(i//10**(c-1)))
h... | [
"literal.number.integer.change",
"identifier.change",
"call.arguments.change",
"expression.operation.binary.change"
] | 493,232 | 493,231 | u075595666 | python |
p02720 | import heapq
import sys
def solve(k):
if k < 10:
return k
heap = [1,2,3,4,5,6,7,8,9]
heapq.heapify(heap)
for i in range(k-1):
lunlun = heapq.heappop(heap)
lastDigit = lunlun % 10
# print lunlun
heapq.heappush(heap, (lunlun*10) + lastDigit)
if last... | import heapq
import sys
def solve(k):
if k < 10:
return k
heap = [1,2,3,4,5,6,7,8,9]
heapq.heapify(heap)
for i in range(k-1):
lunlun = heapq.heappop(heap)
lastDigit = lunlun % 10
# print lunlun
heapq.heappush(heap, (lunlun*10) + lastDigit)
if last... | [
"assignment.value.change",
"identifier.replace.add",
"literal.replace.remove",
"call.add"
] | 493,235 | 493,236 | u291528105 | python |
p02720 | import sys
from collections import deque
sys.setrecursionlimit(10 ** 6) # 再帰関数の再帰の深さを設定
to_index = lambda x: int(x) - 1 # 入力した数字に1を引いたものを返す
print_list_in_2D = lambda x: print(*x, sep="\n") # リストの要素を改行を挟んで表示する関数
# 入力を整数に変換して受け取る
def input_int():
return int(input())
def map_int_input():
return map(int, input... | import sys
from collections import deque
sys.setrecursionlimit(10 ** 6) # 再帰関数の再帰の深さを設定
to_index = lambda x: int(x) - 1 # 入力した数字に1を引いたものを返す
print_list_in_2D = lambda x: print(*x, sep="\n") # リストの要素を改行を挟んで表示する関数
# 入力を整数に変換して受け取る
def input_int():
return int(input())
def map_int_input():
return map(int, input... | [
"control_flow.return.remove",
"control_flow.exit.add",
"call.add"
] | 493,242 | 493,243 | u199830845 | python |
p02720 | k = int(input())
#print(k)
l = [[0 for i in range(10)] for j in range(10)]
for j in range(10):
l[0][j] = 1
for i in range(1,10):
for j in range(10):
if(j != 0)and(j != 9):
l[i][j] = l[i-1][j-1]+l[i-1][j]+l[i-1][j+1]
elif j == 0:
l[i][j] = l[i-1][j]+l[i-1][j+1]
else:
l[i][j] = l[i-1][j-1]+l[i-1][j]
#... | k = int(input())
#print(k)
l = [[0 for i in range(10)] for j in range(10)]
for j in range(10):
l[0][j] = 1
for i in range(1,10):
for j in range(10):
if(j != 0)and(j != 9):
l[i][j] = l[i-1][j-1]+l[i-1][j]+l[i-1][j+1]
elif j == 0:
l[i][j] = l[i-1][j]+l[i-1][j+1]
else:
l[i][j] = l[i-1][j-1]+l[i-1][j]
#... | [
"expression.operation.binary.remove"
] | 493,252 | 493,253 | u969808621 | python |
p02720 | K = int(input())
from collections import deque
que=deque([1,2,3,4,5,6,7,8,9])
for i in range(K):
x=que.popleft()
if x%10!=0:
que.append(10*x+(x%10-1))
que.append(10*x)
if x%10!=9:
que.append(10*x+(x%10+1))
print(x) | K = int(input())
from collections import deque
que=deque([1,2,3,4,5,6,7,8,9])
for i in range(K):
x=que.popleft()
if x%10!=0:
que.append(10*x+(x%10-1))
que.append(10*x+x%10)
if x%10!=9:
que.append(10*x+(x%10+1))
print(x) | [
"expression.operation.binary.add"
] | 493,254 | 493,255 | u531813438 | python |
p02720 | K = int(input())
cand = [[1, 2, 3, 4, 5, 6, 7, 8, 9]]
for _ in range(4):
tmp = []
for v in cand[-1]:
if v%10 != 0:
tmp.append(v*10 + (v%10-1))
tmp.append(v*10 + (v%10))
if v%10 != 9:
tmp.append(v*10 + (v%10+1))
cand.append(tmp)
ans = []
for i in range(len(cand... | K = int(input())
cand = [[1, 2, 3, 4, 5, 6, 7, 8, 9]]
for _ in range(9):
tmp = []
for v in cand[-1]:
if v%10 != 0:
tmp.append(v*10 + (v%10-1))
tmp.append(v*10 + (v%10))
if v%10 != 9:
tmp.append(v*10 + (v%10+1))
cand.append(tmp)
ans = []
for i in range(len(cand... | [
"literal.number.integer.change",
"call.arguments.change",
"control_flow.loop.range.bounds.upper.change"
] | 493,265 | 493,266 | u268504600 | python |
p02720 |
def make_tree(G,keta,count):
if keta==1:
num =[]
for i in range(1,10):
count+=1
if count ==k:
print(i)
exit()
else:
num.append(i)
G.append(num)
make_tree(G,2,count)
else:
print(G)
... | def make_tree(G,keta,count):
if keta==1:
num =[]
for i in range(1,10):
count+=1
if count ==k:
print(i)
exit()
else:
num.append(i)
G.append(num)
make_tree(G,2,count)
else:
num_list... | [
"call.remove"
] | 493,269 | 493,270 | u572012241 | python |
p02720 |
def make_tree(G,keta,count):
if keta==1:
num =[]
for i in range(1,10):
count+=1
if count ==k:
print(i)
exit()
else:
num.append(i)
G.append(num)
make_tree(G,2,count)
else:
print(G)
... | def make_tree(G,keta,count):
if keta==1:
num =[]
for i in range(1,10):
count+=1
if count ==k:
print(i)
exit()
else:
num.append(i)
G.append(num)
make_tree(G,2,count)
else:
num_list... | [
"call.remove",
"literal.string.change",
"call.arguments.change",
"expression.operation.binary.change",
"io.output.change"
] | 493,271 | 493,270 | u572012241 | python |
p02720 | def make_tree(G,keta,count):
if keta==1:
num =[]
for i in range(1,10):
count+=1
if count ==k:
print(i)
exit()
else:
num.append(i)
G.append(num)
make_tree(G,2,count)
else:
num_list... | def make_tree(G,keta,count):
if keta==1:
num =[]
for i in range(1,10):
count+=1
if count ==k:
print(i)
exit()
else:
num.append(i)
G.append(num)
make_tree(G,2,count)
else:
num_list... | [
"literal.string.change",
"call.arguments.change",
"expression.operation.binary.change",
"io.output.change"
] | 493,272 | 493,270 | u572012241 | python |
p02720 | from collections import deque
K = int(input())
a = deque([1, 2, 3, 4, 5, 6, 7, 8, 9])
for i in range(K-1):
j = a.popleft()
if j%10 != 0:
a.append((10*j) + ((j%10) -1))
a.append((10*j)+j%10)
if j%10 != 9:
a.append((10*j) +((j%10)+1))
a.popleft() | from collections import deque
K = int(input())
a = deque([1, 2, 3, 4, 5, 6, 7, 8, 9])
for i in range(K-1):
j = a.popleft()
if j%10 != 0:
a.append((10*j) + ((j%10) -1))
a.append((10*j)+j%10)
if j%10 != 9:
a.append((10*j) +((j%10)+1))
print(a.popleft()) | [
"call.add",
"call.arguments.change"
] | 493,275 | 493,276 | u961945062 | python |
p02720 | def dp(i, j, memo):
key = "{}.{}".format(i, j)
if i == 1:
memo[key] = 1
return memo[key]
if key in memo:
return memo[key]
if j == 0:
memo[key] = dp(i-1, j, memo) + dp(i-1, j+1, memo)
return memo[key]
if j == 9:
memo[key] = dp(i-1, j-1, memo) + dp(i... | def dp(i, j, memo):
key = "{}.{}".format(i, j)
if i == 1:
memo[key] = 1
return memo[key]
if key in memo:
return memo[key]
if j == 0:
memo[key] = dp(i-1, j, memo) + dp(i-1, j+1, memo)
return memo[key]
if j == 9:
memo[key] = dp(i-1, j-1, memo) + dp(i... | [
"call.remove"
] | 493,277 | 493,278 | u531579566 | python |
p02720 | def dp(i, j, memo):
key = "{}.{}".format(i, j)
if i == 1:
memo[key] = 1
return memo[key]
if key in memo:
return memo[key]
if j == 0:
memo[key] = dp(i-1, j, memo) + dp(i-1, j+1, memo)
return memo[key]
if j == 9:
memo[key] = dp(i-1, j-1, memo) + dp(i... | def dp(i, j, memo):
key = "{}.{}".format(i, j)
if i == 1:
memo[key] = 1
return memo[key]
if key in memo:
return memo[key]
if j == 0:
memo[key] = dp(i-1, j, memo) + dp(i-1, j+1, memo)
return memo[key]
if j == 9:
memo[key] = dp(i-1, j-1, memo) + dp(i... | [
"call.add",
"call.arguments.change"
] | 493,279 | 493,278 | u531579566 | python |
p02720 | def main():
K = int(input())
if K < 10:
print(K)
return
R = [1,2,3,4,5,6,7,8,9]
x = 9
while True:
T = []
for r in R:
if r % 10 > 0:
T.append(r * 10 + (r % 10) - 1)
x += 1
if x >= K:
pri... | def main():
K = int(input())
if K < 10:
print(K)
return
R = [1,2,3,4,5,6,7,8,9]
x = 9
while True:
T = []
for r in R:
if r % 10 > 0:
T.append(r * 10 + (r % 10) - 1)
x += 1
if x >= K:
pri... | [
"expression.operation.binary.add"
] | 493,292 | 493,293 | u652583512 | python |
p02720 | k = int(input())
ans = [str(i) for i in range(1,10)]
c = 0
while len(ans)!=k:
now = ans[c]
t = int(now[-1])
if t != 0:
ans.append(str(now) +str(t-1))
ans.append(str(now) +str(now)[-1])
if t != 9:
ans.append(str(now) +str(t+1))
c += 1
print(ans[k-1]) | k = int(input())
ans = [str(i) for i in range(1,10)]
c = 0
while len(ans) < k:
now = ans[c]
t = int(now[-1])
if t != 0:
ans.append(str(now) +str(t-1))
ans.append(str(now) +str(now)[-1])
if t != 9:
ans.append(str(now) +str(t+1))
c += 1
print(ans[k-1]) | [
"expression.operator.compare.change",
"control_flow.loop.condition.change"
] | 493,296 | 493,297 | u941645670 | python |
p02720 | # -*- coding: utf-8 -*-
def f(n):
C = [[1 for i in range(10)]]
while sum(d for c in C for d in c[1:]) < n:
C.append([sum(C[-1][max(0,i-1):min(i+2,10)]) for i in range(10)])
return C
def solve():
n = int(input())
C = f(n)
X = []
m = sum(d for c in C[:-1] for d in c[1:])
x = 1
... | # -*- coding: utf-8 -*-
def f(n):
C = [[1 for i in range(10)]]
while sum(d for c in C for d in c[1:]) < n:
C.append([sum(C[-1][max(0,i-1):min(i+2,10)]) for i in range(10)])
return C
def solve():
n = int(input())
C = f(n)
X = []
m = sum(d for c in C[:-1] for d in c[1:])
x = 1
... | [
"literal.number.integer.change",
"call.arguments.change",
"control_flow.loop.range.bounds.upper.change"
] | 493,301 | 493,302 | u667469290 | python |
p02720 | def main():
k=int(input())
l=[[] for _ in range(20)]
l[1]=[0,1,2,3,4,5,6,7,8,9]
cnt=9
if cnt>=k:
print(l[k])
exit()
for i in range(2,20):
for keta in range(1,i):
for j in l[keta]:
f=j//10**(i-2)
if j==0:
l[i]... | def main():
k=int(input())
l=[[] for _ in range(20)]
l[1]=[0,1,2,3,4,5,6,7,8,9]
cnt=9
if cnt>=k:
print(l[1][k])
exit()
for i in range(2,20):
for keta in range(1,i):
for j in l[keta]:
f=j//10**(i-2)
if j==0:
l... | [] | 493,303 | 493,304 | u919730120 | python |
p02720 | def main():
k=int(input())
l=[[] for _ in range(20)]
l[1]=[0,1,2,3,4,5,6,7,8,9]
cnt=9
if cnt>=k:
print(l[k])
exit()
for i in range(2,20):
for keta in range(1,i):
for j in l[keta]:
f=j//10**(i-2)
if j==0:
l[i]... | def main():
k=int(input())
l=[[] for _ in range(20)]
l[1]=[0,1,2,3,4,5,6,7,8,9]
cnt=9
if cnt>=k:
print(l[1][k])
exit()
for i in range(2,20):
for keta in range(1,i):
for j in l[keta]:
f=j//10**(i-2)
if j==0:
l... | [] | 493,305 | 493,304 | u919730120 | python |
p02720 | import sys
stdin = sys.stdin
ns = lambda: stdin.readline().rstrip()
ni = lambda: int(stdin.readline().rstrip())
nm = lambda: map(int, stdin.readline().split())
nl = lambda: list(map(int, stdin.readline().split()))
K=int(input())
c=9
cb=0
r_list=[1,2,3,4,5,6,7,8,9]
while(c<K):
tmp=[]
for i in r_list:
i... | import sys
stdin = sys.stdin
ns = lambda: stdin.readline().rstrip()
ni = lambda: int(stdin.readline().rstrip())
nm = lambda: map(int, stdin.readline().split())
nl = lambda: list(map(int, stdin.readline().split()))
K=int(input())
c=9
cb=0
r_list=[1,2,3,4,5,6,7,8,9]
while(c<K):
tmp=[]
for i in r_list:
i... | [
"control_flow.branch.if.replace.remove",
"control_flow.branch.else_if.replace.add"
] | 493,316 | 493,317 | u525796732 | python |
p02720 | #dpより愚直に作るか
k = int(input())
lun = [i for i in range(10)]
while len(lun)<k:
lun2 = []
for i in lun:
lun2.append(i*10+(i%10))
if i%10:
lun2.append(i*10+(i%10)-1)
if (i%10)<9:
lun2.append(i*10+(i%10)+1)
lun = list(set(lun+lun2))
lun.sort()
print(lun[k]) | #dpより愚直に作るか
k = int(input())
lun = [i for i in range(10)]
while len(lun)<k+1:#正の整数
lun2 = []
for i in lun:
lun2.append(i*10+(i%10))
if i%10:
lun2.append(i*10+(i%10)-1)
if (i%10)<9:
lun2.append(i*10+(i%10)+1)
lun = list(set(lun+lun2))
lun.sort()
print(lun[k]) | [
"control_flow.loop.condition.change"
] | 493,320 | 493,321 | u520276780 | python |
p02720 | K = int(input())
list0 = ['0']
list1 = ['1']
list2 = ['2']
list3 = ['3']
list4 = ['4']
list5 = ['5']
list6 = ['6']
list7 = ['7']
list8 = ['8']
list9 = ['9']
an = 0
def AAA(list0,list1,list2,list3,list4,list5,list6,list7,list8,list9):
nlist0 = [0]*(len(list0)+len(list1))
nlist1 = [0]*(len(list0)+len(list1)+l... |
K = int(input())
list0 = ['0']
list1 = ['1']
list2 = ['2']
list3 = ['3']
list4 = ['4']
list5 = ['5']
list6 = ['6']
list7 = ['7']
list8 = ['8']
list9 = ['9']
an = 0
def AAA(list0,list1,list2,list3,list4,list5,list6,list7,list8,list9):
nlist0 = [0]*(len(list0)+len(list1))
nlist1 = [0]*(len(list0)+len(list1... | [
"control_flow.loop.condition.change"
] | 493,327 | 493,328 | u418381221 | python |
p02720 | k=int(input())
def dp(k):
if k<=9:
return k
else:
prev_keta_nums=[1,2,3,4,5,6,7,8,9]
count=9
flag = False
while True:
next_keta_nums=[]
for num in prev_keta_nums:
num_last = int(str(num)[-1])
if num_last == 9:
... | k=int(input())
def dp(k):
if k<=9:
return k
else:
prev_keta_nums=[1,2,3,4,5,6,7,8,9]
count=9
flag = False
while True:
next_keta_nums=[]
for num in prev_keta_nums:
num_last = int(str(num)[-1])
if num_last == 9:
... | [] | 493,349 | 493,350 | u256351611 | python |
p02720 | #!/usr/bin/env python3
import sys
sys.setrecursionlimit(10**6)
count = 0
def solve(K: int):
def cDfs(prev, prevDigit, remainDigit):
global count
if remainDigit == 0:
count += 1
if count == K:
print(prev)
exit()
return
els... | #!/usr/bin/env python3
import sys
sys.setrecursionlimit(10**6)
count = 0
def solve(K: int):
def cDfs(prev, prevDigit, remainDigit):
global count
if remainDigit == 0:
count += 1
if count == K:
print(prev)
exit()
# print(prev)
... | [
"call.remove",
"call.add"
] | 493,355 | 493,356 | u873927631 | python |
p02720 | def d1(x):
y = x % 10
if y == 0:
return [0, 1]
elif y == 9:
return [8, 9]
else:
return [y-1, y, y+1]
K = int(input())
runrun = []
N = 0
digit = 0
while N < K:
d_i = []
if digit == 0:
for i in range(1, 10):
d_i.append(i)
N += len(d_i)
... | def d1(x):
y = x % 10
if y == 0:
return [0, 1]
elif y == 9:
return [8, 9]
else:
return [y-1, y, y+1]
K = int(input())
runrun = []
N = 0
digit = 0
while N < K:
d_i = []
if digit == 0:
for i in range(1, 10):
d_i.append(i)
N += len(d_i)
... | [
"misc.opposites",
"expression.operator.arithmetic.change",
"variable_access.subscript.index.change",
"call.arguments.change",
"expression.operation.binary.change",
"io.output.change"
] | 493,357 | 493,358 | u332933608 | python |
p02720 | def main():
K = int(input())
used = [1,2,3,4,5,6,7,8,9]
ans = used
k = 9
now = 0
add = [-1,0,1]
while True:
if k >= K :
break
else:
keep = []
for i in used:
if (i % 10 == 0 ) :
keep.append(i * 10 + 0)
... | def main():
K = int(input())
used = [1,2,3,4,5,6,7,8,9]
ans = used
k = 9
now = 0
add = [-1,0,1]
while True:
if k >= K :
break
else:
keep = []
for i in used:
if (i % 10 == 0 ) :
keep.append(i * 10 + 0)
... | [
"call.remove",
"call.add"
] | 493,363 | 493,364 | u498620941 | python |
p02720 | # -*- coding: utf-8 -*-
def input_multiple_number():
return map(int, input().split())
def input_multiple_number_as_list():
return list(map(int, input().split()))
K = int(input())
base = [1,2,3,4,5,6,7,8,9]
ans = [1,2,3,4,5,6,7,8,9]
for i in range(100000):
for j in range(3):
if ans[i]%10 == 0 and j ==0:... |
# -*- coding: utf-8 -*-
def input_multiple_number():
return map(int, input().split())
def input_multiple_number_as_list():
return list(map(int, input().split()))
K = int(input())
base = [1,2,3,4,5,6,7,8,9]
ans = [1,2,3,4,5,6,7,8,9]
for i in range(100000):
for j in range(3):
if ans[i]%10 == 0 and j ==0... | [
"misc.opposites",
"expression.operator.arithmetic.change",
"variable_access.subscript.index.change",
"call.arguments.change",
"expression.operation.binary.change",
"io.output.change"
] | 493,369 | 493,370 | u985972698 | python |
p02720 | #!usr/bin/env python3
import sys
import math
import string
import collections
import fractions
import random
from operator import itemgetter
import itertools
from collections import deque
import copy
import heapq
import bisect
MOD = 10 ** 9 + 7
INF = float('inf')
input = lambda: sys.stdin.readline().strip()
sys.setre... | #!usr/bin/env python3
import sys
import math
import string
import collections
import fractions
import random
from operator import itemgetter
import itertools
from collections import deque
import copy
import heapq
import bisect
MOD = 10 ** 9 + 7
INF = float('inf')
input = lambda: sys.stdin.readline().strip()
sys.setre... | [
"control_flow.branch.if.condition.change"
] | 493,373 | 493,374 | u385244248 | python |
p02720 | #!usr/bin/env python3
import sys
import math
import string
import collections
import fractions
import random
from operator import itemgetter
import itertools
from collections import deque
import copy
import heapq
import bisect
MOD = 10 ** 9 + 7
INF = float('inf')
input = lambda: sys.stdin.readline().strip()
sys.setre... | #!usr/bin/env python3
import sys
import math
import string
import collections
import fractions
import random
from operator import itemgetter
import itertools
from collections import deque
import copy
import heapq
import bisect
MOD = 10 ** 9 + 7
INF = float('inf')
input = lambda: sys.stdin.readline().strip()
sys.setre... | [
"literal.number.integer.change",
"control_flow.branch.if.condition.change"
] | 493,375 | 493,374 | u385244248 | python |
p02720 | from collections import deque
k=int(input())
l=deque([i+1 for i in range(9)])
cnt=9
if k<=cnt:print(l[k-1])
else:
while cnt<k:
v=l.popleft()
if v%10==0:l.append(v*10);l.append(v*10+1);cnt+=2
elif v%10==9:l.append(v*10+9);l.append(v*10+8);cnt+=2
else:
rem=v%10
... | from collections import deque
k=int(input())
l=deque([i+1 for i in range(9)])
cnt=9
if k<=cnt:print(l[k-1])
else:
while cnt<k:
v=l.popleft()
if v%10==0:l.append(v*10);l.append(v*10+1);cnt+=2
elif v%10==9:l.append(v*10+8);l.append(v*10+9);cnt+=2
else:
rem=v%10
... | [
"literal.number.integer.change",
"call.arguments.change",
"expression.operation.binary.change"
] | 493,390 | 493,391 | u623687794 | python |
p02720 | import sys
stdin = sys.stdin
ni = lambda: int(ns())
na = lambda: list(map(int, stdin.readline().split()))
ns = lambda: stdin.readline().rstrip() # ignore trailing spaces
K = ni() - 1
for le in range(1, 11):
for h in range(1, 10):
for a in itertools.product((-1, 0, 1), repeat=le-1):
cur = h
... | import sys
import itertools
stdin = sys.stdin
ni = lambda: int(ns())
na = lambda: list(map(int, stdin.readline().split()))
ns = lambda: stdin.readline().rstrip() # ignore trailing spaces
K = ni() - 1
for le in range(1, 11):
for h in range(1, 10):
for a in itertools.product((-1, 0, 1), repeat=le-1):
... | [] | 493,392 | 493,393 | u119714109 | python |
p02720 | from collections import deque
k = int(input())
que = deque([1,2,3,4,5,6,7,8,9])
for n in range(0, k):
x = que.popleft()
if x % 10 != 0:
que.append(x * 10 + x % 10 - 1)
q.append(c * 10 + c % 10)
if x % 10 != 9:
que.append(x * 10 + x % 10 + 1)
print(x) | from collections import deque
k = int(input())
que = deque([1,2,3,4,5,6,7,8,9])
for n in range(0, k):
x = que.popleft()
if x % 10 != 0:
que.append(x * 10 + x % 10 - 1)
que.append(x * 10 + x % 10)
if x % 10 != 9:
que.append(x * 10 + x % 10 + 1)
print(x) | [
"identifier.change",
"call.arguments.change",
"expression.operation.binary.change"
] | 493,406 | 493,407 | u090972687 | python |
p02720 | K = int(input())
a = []
def dfs(x):
if x > 3234566667:
return
a.append(x)
for i in range(10):
if abs(x%10-i) <= 1:
dfs(x*10+i)
for i in range(1,11):
dfs(i)
a = sorted(a)
print(a[K-1]) | K = int(input())
a = []
def dfs(x):
if x > 3234566667:
return
a.append(x)
for i in range(10):
if abs(x%10-i) <= 1:
dfs(x*10+i)
for i in range(1,10):
dfs(i)
a = sorted(a)
print(a[K-1]) | [
"literal.number.integer.change",
"call.arguments.change",
"control_flow.loop.range.bounds.upper.change"
] | 493,410 | 493,411 | u704284486 | python |
p02720 | K = int(input())
if K <= 9:
print(K)
exit()
memo = [[1]*10] + [[1]*10 for _ in range(9)]
n = 9
digit = 1
i = -1
ans = []
while True:
i += 1
if i == 10:
i = 0
digit += 1
tmp = memo[digit-1][i]
if i >= 1:
tmp += memo[digit-1][i-1]
if i <= 8:
tmp += memo[digit... | K = int(input())
if K <= 9:
print(K)
exit()
memo = [[1]*10] + [[1]*10 for _ in range(9)]
n = 9
digit = 1
i = -1
ans = []
while True:
i += 1
if i == 10:
i = 0
digit += 1
tmp = memo[digit-1][i]
if i >= 1:
tmp += memo[digit-1][i-1]
if i <= 8:
tmp += memo[digit... | [
"call.add",
"call.arguments.change"
] | 493,412 | 493,413 | u792078574 | python |
p02720 | # coding: utf-8
from collections import deque
K = int(input())
queue = [str(i) for i in range(1, 10)]
# print(queue)
queue = deque(queue)
L = []
cnt = 0
while cnt <= K:
v = queue.popleft()
# L.push(int(v))
L.append(int(v))
if v[-1] == "0":
# print("v =", v)
queue.append(v + v[-1])
... | # coding: utf-8
from collections import deque
K = int(input())
queue = [str(i) for i in range(1, 10)]
# print(queue)
queue = deque(queue)
L = []
cnt = 0
while cnt < K:
v = queue.popleft()
# L.push(int(v))
L.append(int(v))
if v[-1] == "0":
# print("v =", v)
queue.append(v + v[-1])
... | [
"expression.operator.compare.change",
"control_flow.loop.condition.change"
] | 493,419 | 493,420 | u580697892 | python |
p02720 | data = 'B|B|B|B|B|B|B|B|B|B|B|B|J|B|B|J|B|B|J|B|B|J|B|B|J|B|B|J|B|B|J|B|B|J|B|B|B|J|B|B|J|B|B|9|B|B|J|B|B|J|B|B|9|B|B|J|B|B|J|B|B|9|B|B|J|B|B|J|B|B|9|B|B|J|B|B|J|B|B|9|B|B|J|B|B|J|B|B|9|B|B|J|B|B|J|B|B|9|B|B|J|B|B|J|B|AB|B|B|J|B|B|B|J|B|B|AB|B|J|B|B|J|B|B|9|B|B|J|B|B|J|B|B| J|B|J|B|B|J|B|B|9|B|B|J|B|B|J|B|B|9|B|B|J|B|B... | data = 'B|B|B|B|B|B|B|B|B|B|B|B|J|B|B|J|B|B|J|B|B|J|B|B|J|B|B|J|B|B|J|B|B|J|B|B|B|J|B|B|J|B|B|9|B|B|J|B|B|J|B|B|9|B|B|J|B|B|J|B|B|9|B|B|J|B|B|J|B|B|9|B|B|J|B|B|J|B|B|9|B|B|J|B|B|J|B|B|9|B|B|J|B|B|J|B|B|9|B|B|J|B|B|J|B|AB|B|B|J|B|B|B|J|B|B|AB|B|J|B|B|J|B|B|9|B|B|J|B|B|J|B|B| J|B|J|B|B|J|B|B|9|B|B|J|B|B|J|B|B|9|B|B|J|B|B... | [
"identifier.replace.add",
"literal.replace.remove",
"call.arguments.add"
] | 493,443 | 493,444 | u762325798 | python |
p02720 | #!/usr/bin/env python3
ans = [0] * 10
ans[1] = '1'
for i in range(2, 10):
ans[i] = str(i)
alpha = "0123456789"
def dfs(s):
if len(s) == N:
ans.append(s)
if len(ans) >= 100001:
return
else:
for c in range(int(s[-1])-1,int(s[-1])+2):
if c >= 0:
d... | #!/usr/bin/env python3
ans = [0] * 10
ans[1] = '1'
for i in range(2, 10):
ans[i] = str(i)
alpha = "0123456789"
def dfs(s):
if len(s) == N:
ans.append(s)
if len(ans) >= 100001:
return
else:
for c in range(int(s[-1])-1,int(s[-1])+2):
if c >= 0:
d... | [
"control_flow.branch.if.condition.change"
] | 493,445 | 493,446 | u552357043 | python |
p02720 | #!/usr/bin/env python3
ans = [0] * 10
ans[1] = '1'
for i in range(2, 10):
ans[i] = str(i)
alpha = "0123456789"
def dfs(s):
if len(s) == N:
ans.append(s)
if len(ans) >= 100001:
return
else:
for c in (int(s[-1])-1,int(s[-1])+2):
if c >= 0:
dfs(s+... | #!/usr/bin/env python3
ans = [0] * 10
ans[1] = '1'
for i in range(2, 10):
ans[i] = str(i)
alpha = "0123456789"
def dfs(s):
if len(s) == N:
ans.append(s)
if len(ans) >= 100001:
return
else:
for c in range(int(s[-1])-1,int(s[-1])+2):
if c >= 0:
d... | [
"call.add",
"control_flow.loop.range.bounds.upper.change",
"control_flow.branch.if.condition.change"
] | 493,447 | 493,446 | u552357043 | python |
p02720 | k = int(input())
n = 1
cnt = 0
flg = 0
while True:
if flg == 1:
n += 1
flg = 0
strn = str(n)
if len(strn) == 1:
cnt += 1
n += 1
else:
for s in range(len(strn)):
if s == len(strn) - 1:
cnt += 1
flg = 1
else:
if abs(int(strn[s]) - int(strn[s+1])) > 1:
... | k = int(input())
n = 1
cnt = 0
flg = 0
while True:
if flg == 1:
n += 1
flg = 0
strn = str(n)
if len(strn) == 1:
cnt += 1
flg = 1
else:
for s in range(len(strn)):
if s == len(strn) - 1:
cnt += 1
flg = 1
else:
if abs(int(strn[s]) - int(strn[s+1])) > 1:
... | [] | 493,453 | 493,454 | u646244131 | python |
p02720 |
def resolve():
import sys
input = sys.stdin.readline
k = int(input().rstrip())
if k <= 9:
# print(k)
sys.exit()
def judge(number_list, index, total):
if index == len(number_list) - 2: # 最後から2番目の桁
num = number_list[index]
add_num = 2 if num in (0, 9... |
def resolve():
import sys
input = sys.stdin.readline
k = int(input().rstrip())
if k <= 9:
print(k)
sys.exit()
def judge(number_list, index, total):
if index == len(number_list) - 2: # 最後から2番目の桁
num = number_list[index]
add_num = 2 if num in (0, 9) ... | [
"call.add"
] | 493,455 | 493,456 | u138083942 | python |
p02721 | N,K,C = map(int,input().split())
S = list(input())
F = []
maru = 0
last = -10**9
span = C
for i in range(N):
if S[i]=="o" and span >= C:
maru += 1
last = i
F.append([maru,last])
span = 0
else:
span += 1
F.append([maru,last])
#print(F)
s = S[::-1]
maru = 0
last = 1... | N,K,C = map(int,input().split())
S = list(input())
F = []
maru = 0
last = -10**9
span = C
for i in range(N):
if S[i]=="o" and span >= C:
maru += 1
last = i
F.append([maru,last])
span = 0
else:
span += 1
F.append([maru,last])
#print(F)
s = S[::-1]
maru = 0
last = 1... | [
"identifier.change",
"control_flow.branch.if.condition.change"
] | 493,484 | 493,485 | u620480037 | python |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.