Problem:


Score : 500 points

Problem Statement

Let S(n) denote the sum of the digits in the decimal notation of n.
For example, S(123) = 1 + 2 + 3 = 6.

We will call an integer n a Snuke number when, for all positive integers m such that m > n, \frac{n}{S(n)} \leq \frac{m}{S(m)} holds.

Given an integer K, list the K smallest Snuke numbers.

Constraints

1 \leq K

The K-th smallest Snuke number is not greater than 10^{15}.

Input

Input is given from Standard Input in the following format:

K

Output

Print K lines. The i-th line should contain the i-th smallest Snuke number.

Sample Input 1

10

Sample Output 1

1
2
3
4
5
6
7
8
9
19



Sample input:
10


Sample output:
1
2
3
4
5
6
7
8
9
19

Submission status: Wrong Answer

Solution code:
k=int(input())
 
cnt=0
while True:
    for i in range(1,16):
        for j in range(max(1,i-2),max(10,10*(i-1))):
            print('{0}{1}'.format(j, '9'*(i-1)))
            cnt+=1
            if cnt==k:
                exit()

Submission status: Wrong Answer

Solution code:
k=int(input())
 
cnt=0
while True:
    for i in range(16):
        if i<3:
            for j in range(1,10):
                print('{0}{1}'.format(j, '9'*i))
                cnt+=1
                if cnt==k:
                    exit()
        else:
            for j in range(i-2,10*(i-1)):
                print('{0}{1}'.format(j, '9'*(i-1)))
                cnt+=1
                if cnt==k:
                    exit()

Submission status: Wrong Answer

Solution code:
k = int(input())
suf = ''
cur = 1
for i in range(k):
    print(str(cur) + suf)
    cur += 1
    if cur == 10:
        cur = 1
        suf += '9'

Submission status: Wrong Answer

Solution code:
def i1():
 return int(input())
def i2():
 return [int(i) for i in input().split()]
k=i1()


x=list(range(1,10))

y=[]
z=[]
for i in range(1,16):
 for j in range(1,10):
  y.append((10**i*(j+1)-1)/(j+i*9))
  z.append(10**i*(j+1)-1)
for i in range(len(z)-1):
  s=z[i]+1
  x.append(z[i])
  while s/sum(list(map(int, list(str(s)))))<=y[i+1]:
        x.append(s)
        s+=1

for i in range(k):
  if x[i]>10**15:
     break
  print(x[i])

Submission status: Wrong Answer

Solution code:
k = int(input())
for i in range(min(k, 9)):
    print(i + 1)

coef = 10
count = 1
for i in range(k - 9):
    if count == 10:
        count = 1
        coef *= 10
    print(count * coef + coef - 1)
    count += 1

Submission status: Wrong Answer

Solution code:
#!/usr/bin/env python3
# -*- coding: utf-8 -*-

import array
from bisect import *
from collections import *
import fractions
import heapq 
from itertools import *
import math
import random
import re
import string
import sys

def T(k):
    orig_k = k
    sk = 0
    while k > 0:
        sk += k % 10
        k //= 10
    return orig_k / sk

d = {}
MAX = int(1e15) + 1e9
for i in range(1, 99999):
    t = i
    while t < MAX:
        d[t] = T(t)
        t = t * 10 + 9

keys = sorted(list(d.keys()))

# for k in keys:
#     print(k, d[k])

mn = None
ans = []
for k in reversed(keys):
    if mn == None:
        mn = d[k]
    else:
        if mn >= d[k]:
            ans.append(k)
            mn = min(mn, d[k])

ans.reverse()

K = int(input())
ans = ans[:K]
for a in ans:
    print(a)

Submission status: Wrong Answer

Solution code:
#!/usr/bin/env python3
# -*- coding: utf-8 -*-

import array
from bisect import *
from collections import *
import fractions
import heapq 
from itertools import *
import math
import random
import re
import string
import sys

def T(k):
    orig_k = k
    ret = 0
    while k > 0:
        ret += k % 10
        k //= 10
    return ret / orig_k

d = {}
MAX = int(1e15) + 1e9
for i in range(1, 99999):
    t = i
    while t < MAX:
        d[t] = T(t)
        t = t * 10 + 9

keys = sorted(list(d.keys()))

# for k in keys:
#     print(k, d[k])

mn = None
ans = []
for k in reversed(keys):
    if mn == None:
        mn = d[k]
    else:
        if mn >= d[k]:
            ans.append(k)
            mn = min(mn, d[k])

ans.reverse()
K = int(input())
ans = ans[:K]
for a in ans:
    print(a)

Submission status: Wrong Answer

Solution code:
#!/usr/bin/env python3
# -*- coding: utf-8 -*-

import array
from bisect import *
from collections import *
import fractions
import heapq 
from itertools import *
import math
import random
import re
import string
import sys

def S(k):
    return sum(int(x) for x in str(k))
def T(k):
    return k / S(k)

d = {}
MAX = int(1e15) + 1e9
for i in range(1, 9999):
    t = i
    while t < MAX:
        d[t] = T(t)
        t = t * 10 + 9

keys = sorted(list(d.keys()))

# for k in keys:
#     print(k, d[k])

mn = None
ans = []
for k in reversed(keys):
    if mn == None:
        mn = d[k]
    else:
        if mn >= d[k]:
            ans.append(k)
            mn = min(mn, d[k])

ans.reverse()
K = int(input())
ans = ans[:K]
for a in ans:
    print(a)

Submission status: Wrong Answer

Solution code:
k=int(input())
cnt=0
keta=""
for i in range(k):
  cnt+=1
  if cnt<10:
    print(int(str(cnt)+keta))
  else:
    cnt=1
    keta=keta+"9"
    print(int(str(cnt)+keta))

Submission status: Wrong Answer

Solution code:
k = int(input())
kosuu = [9,9,19]
for i in range(2,11):
	kosuu.append((10-i)+10*i)
kosuu.append(100)
kosuu.append(111)
kosuu.append(121)
ans = []
counter = 0
i = 0
while counter < k:
	if i == 0:
		for e in range(1,kosuu[i]):
			ans.append(e)
		counter += 8
		i += 1
	elif i <= 10:
		first = (i-1)*(10**i)+(10**i)-1
		for e in range(kosuu[i]):
			ans.append(first+e*10**i)
		counter += kosuu[i]
		i += 1
	elif i == 11:
		first = 199999999999
		for e in range(kosuu[i]):
			ans.append(first+e*10**i)
		counter += kosuu[i]
		i += 1
	elif i == 12:
		first = 10999999999999
		for e in range(kosuu[i]):
			ans.append(first+e*10**i)
		counter += kosuu[i]
		i += 1
	else:
		first = 119999999999999
		for e in range(kosuu[i]):
			ans.append(first+e*10**i)
		counter += kosuu[i]
		i += 1
for s in range(k):
	print(ans[s])

Submission status: Wrong Answer

Solution code:
def su(n):
    ans = 0
    while n != 0:
        ans += n % 10
        n = n // 10
    return ans

def sunuke(n):
    s = su(n)
    if s == 0:
        return 0
    return n/s

def hantei(n1,n2):
    if sunuke(n1) <= sunuke(n2):
        return 1
    else:
        return 0

def insert(k):
    ans = [1,2,3,4,5,6,7,8,9,19,29,39,49,59,69,79,89,99]
    while len(ans) < k:
        p = 3
        q = 0
        while (p-q-3) >= 0 and len(ans) < k:
            n1 = int('1' + '0'*(p-2-q) + '9'*(q+1))
            n2 = int('1' + '0'*(p-3-q) +'1'+ '9'*(q+1))
            count = 0
            while hantei(n1,n2) == 1:
                ans_temp = [num for num in range(n1, n1+1+int(9*pow(10,q+1)),int(pow(10,q+1)))]
                for a in ans_temp:
                    ans.append(a)
                n1 += int(pow(10,p-1))
                n2 += int(pow(10,p-1))
                count += 1
            if (p-3-q) == 0:
                n0 = int('1'+'9'*(p-1))
                n0 += count * int(pow(10,p-1))
                ans_temp = [num for num in range(n0, int(pow(10, p)), int(pow(10, p-1)))]
                for a in ans_temp:
                    ans.append(a)
                p += 1
                q = 0
            else:
                q += 1
        p += 1
    return ans
k = int(input())
ans = insert(k)
i = 0
while i < k:
    print(ans[i])
    i += 1

Submission status: Wrong Answer

Solution code:
def dig(n):
    n = str(n)
    d = 0
    for i in range(len(n)):
        d += int(n[i])
    return d

def snk(n):
    return n/dig(n)
d = {}

for i in range(1,10):
    d[i] = i
    d[i+9] = 10*i+9
    d[i+18] = 100*i+99

l = []
for i in range(len(d)):
    l.append(d[i+1])

for j in range(3,16):
    q = 10**(j-1)-1
    for i in range(10,100):
        f = True
        for k in range(i,100):
            if snk(i*10**(j-1)+q) > snk(k*10**(j-1)+q):
                f = False
        if f:
            l.append(i*10**(j-1)+q)

K = int(input())
for i in range(K):
    print(l[i])

Submission status: Wrong Answer

Solution code:
k = int(input())
kosuu = [9,9,10]
for i in range(2,11):
	kosuu.append((10-i)+10*i)
kosuu.append(100)
kosuu.append(111)
kosuu.append(121)
ans = []
counter = 0
i = 0
while counter < k:
	if i == 0:
		for e in range(1,kosuu[i]):
			ans.append(e)
		counter += 8
		i += 1
	elif i <= 10:
		first = (i-1)*(10**i)+(10**i)-1
		for e in range(kosuu[i]):
			ans.append(first+e*10**i)
		counter += kosuu[i]
		i += 1
	elif i == 11:
		first = 199999999999
		for e in range(kosuu[i]):
			ans.append(first+e*10**i)
		counter += kosuu[i]
		i += 1
	elif i == 12:
		first = 10999999999999
		for e in range(kosuu[i]):
			ans.append(first+e*10**i)
		counter += kosuu[i]
		i += 1
	else:
		first = 119999999999999
		for e in range(kosuu[i]):
			ans.append(first+e*10**i)
		counter += kosuu[i]
		i += 1
for s in range(k):
	print(ans[s])

Submission status: Wrong Answer

Solution code:
import numpy as np
import math

# K = int(input())
K = 1000

i = 1
s = [1]

class Hoge:
    def __init__(self, k):
        self.how = self.howmany()
        self.k = k
        now = 0

    def howmany(self):
        yield 9
        i = 10
        gena = self.a_gen()
        while 1:
            yield i - next(gena)
            i += 10

    def a_gen(self):
        yield 1
        a = 1
        while 1:
            yield a
            a += 1
        
    def get(self):
        now = 0
        step = 0
        i = 1
        while 1:
            for _ in range(next(self.how)):
                now += i
                print(now)
                step += 1
                if step > self.k:
                    exit()
            i *= 10


hoge = Hoge(K)

hoge.get()

Submission status: Wrong Answer

Solution code:
k = int(input())
kosuu = [9,9,10]
for i in range(2,11):
	kosuu.append((10-i)+10*i)
kosuu.append(100)
kosuu.append(111)
kosuu.append(121)
print(sum(kosuu))
ans = []
counter = 0
i = 0
while counter < k:
	if i == 0:
		for e in range(1,kosuu[i]):
			ans.append(e)
		counter += 8
		i += 1
	elif i <= 10:
		first = (i-1)*(10**i)+(10**i)-1
		for e in range(kosuu[i]):
			ans.append(first+e*10**i)
		counter += kosuu[i]
		i += 1
	elif i == 11:
		first = 199999999999
		for e in range(kosuu[i]):
			ans.append(first+e*10**i)
		counter += kosuu[i]
		i += 1
	elif i == 12:
		first = 10999999999999
		for e in range(kosuu[i]):
			ans.append(first+e*10**i)
		counter += kosuu[i]
		i += 1
	else:
		first = 119999999999999
		for e in range(kosuu[i]):
			ans.append(first+e*10**i)
		counter += kosuu[i]
		i += 1
for s in range(k):
	print(ans[s])

Submission status: Wrong Answer

Solution code:
k = int(input())

n = 1
d = 1
nine = 0
i = 0
while i < k:
    if n == 0:
        n += 1
        continue
    print(n*10**(d-1)+nine)
    n += 1
    if n >= (d-1)*10 and n >= 10:
        n = d-1
        d += 1
        nine = nine*10+9
    i += 1

Submission status: Wrong Answer

Solution code:
import math
K = int(input())
if K < 10:
  for i in range(1, K + 1):
    print(i)
else:
  count = 0
  for i in range(1, 10):
    print(i)
  count += 9
  now = 9
  while(True):
    keta = int(math.log10(now)) + 1
    if now == 10**keta - 1:
      now = (10**keta) * 2 - 1
    else:
      now += 10**(keta - 1)
    count += 1
    print(now)
    if count >= K:
      break

Submission status: Wrong Answer

Solution code:
K = int(input())
A = [1, 2, 3, 4, 5, 6, 7, 8, 9]
for i in range(1, 10**5):
    A.append(str(i)+"9")
    A.append(str(i)+"99")
    A.append(str(i)+"999")
    A.append(str(i) + "9999")
    A.append(str(i) + "99999")
    A.append(str(i) + "999999")
    A.append(str(i) + "9999999")

A = set(A)
A = list(A)
A = list(map(int, A))
A = list(filter(lambda x: x%10 != 0, A))
A.sort()
for k in range(K):
    print(A[k])

Submission status: Wrong Answer

Solution code:
K = int(input())
A = [1, 2, 3, 4, 5, 6, 7, 8, 9]
for i in range(1, 10**5):
    A.append(str(i)+"9")
    A.append(str(i)+"99")
    A.append(str(i)+"999")
    A.append(str(i) + "9999")
    A.append(str(i) + "99999")
    A.append(str(i) + "999999")
    A.append(str(i) + "9999999")

A = list(map(int, A))
A = list(filter(lambda x: x%10 != 0, A))
A.sort()
for k in range(K):
    print(A[k])

Submission status: Wrong Answer

Solution code:
k = int(input())

count = 0
for i in range(1, 10, 1):
    count += 1
    print(i)
    if(count == k): exit()

flag = True
for i in range(1, 20, 1):
    for j in range(1, 10, 1):
        if(i == 1 and j == 1): continue
        if((10**i) * j - 1 > 1000000000000000 and flag == True):
            print(1000000000000000)
            count += 1
            flag = False
        else:
            count += 1
            print((10**i) * j - 1)
        if(count == k): exit()

Submission status: Wrong Answer

Solution code:
k=int(input())
 
cnt=0
while True:
    for i in range(16):
        if i<2:
            for j in range(1,10):
                print('{0}{1}'.format(j, '9'*i))
                cnt+=1
                if cnt==k:
                    exit()
        else:
            for j in range(i-2,10*(i-1)):
                print('{0}{1}'.format(j, '9'*(i-1)))
                cnt+=1
                if cnt==k:
                    exit()

Submission status: Wrong Answer

Solution code:
a = [1, 2, 3, 4, 5, 6, 7, 8, 9, 19, 29, 39, 49, 59, 69, 79, 89, 99, 199, 299, 399, 499, 599, 699, 799, 899, 999, 1999, 2999, 3999, 4999, 5999, 6999, 7999, 8999, 9999, 19999, 29999, 39999, 49999, 59999, 69999, 79999, 89999, 99999, 199999, 299999, 399999, 499999, 599999, 699999, 799999, 899999, 999999, 1999999, 2999999, 3999999, 4999999, 5999999, 6999999, 7999999, 8999999, 9999999, 19999999, 29999999, 39999999, 49999999, 59999999, 69999999, 79999999, 89999999, 99999999, 199999999, 299999999, 399999999, 499999999, 599999999, 699999999, 799999999, 899999999, 999999999, 1999999999, 2999999999, 3999999999, 4999999999, 5999999999, 6999999999, 7999999999, 8999999999, 9999999999, 19999999999, 29999999999, 39999999999, 49999999999, 59999999999, 69999999999, 79999999999, 89999999999, 99999999999, 199999999999, 299999999999, 399999999999, 499999999999, 599999999999, 699999999999, 799999999999, 899999999999, 999999999999, 1999999999999, 2999999999999, 3999999999999, 4999999999999, 5999999999999, 6999999999999, 7999999999999, 8999999999999, 9999999999999, 19999999999999, 29999999999999, 39999999999999, 49999999999999, 59999999999999, 69999999999999, 79999999999999, 89999999999999, 99999999999999, 99999999999999, 199999999999999, 299999999999999, 399999999999999, 499999999999999, 599999999999999, 699999999999999, 799999999999999, 899999999999999, 999999999999999, 199999999999999999999999999999999999, 299999999999999999999999999999999999, 399999999999999999999999999999999999, 499999999999999999999999999999999999, 599999999999999999999999999999999999, 699999999999999999999999999999999999, 799999999999999999999999999999999999, 899999999999999999999999999999999999, 999999999999999999999999999999999999]
k = int(input())
try:
  for i in a[:k]:
    print(i)
except:
  for i in a:
    print(i)

Submission status: Wrong Answer

Solution code:
k = int(input())

count = 0
for i in range(1, 10, 1):
    count += 1
    print(i)
    if(count == k): exit()

flag = True
for i in range(1, 20, 1):
    for j in range(1, 10, 1):
        if(i == 1 and j == 1): continue
        if((10**i) * j - 1 < 1000000000000000 and flag == True):
            print(1000000000000000)
            count += 1
            flag = False
        else:
            count += 1
            print((10**i) * j - 1)
        if(count == k): exit()

Submission status: Wrong Answer

Solution code:

K = int(input())
aaa = 1
ans_array = []

def sunuke(n):
    re = 0
    tmp = n
    while n:
        re += n % 10
        n = n//10
    re = tmp/re
    print(re)

def print_sunuke():
    global aaa
    num = aaa % 10
    if num == 0:
        aaa += 1
        print_sunuke()
        return
    nine = aaa // 10
    ans = str(num) + "9" * nine
    aaa += 1
    ans_array.append(int(ans))




for i in range(10000):

    print_sunuke()

ans_array.append(1899)
ans_array.append(2899)
ans_array.append(3899)
ans_array.append(4899)
ans_array.append(5899)
ans_array.append(6899)
ans_array.append(7899)
ans_array.append(8899)
ans_array.append(9899)

ans_array.append(1799)
ans_array.append(2799)
ans_array.append(3799)
ans_array.append(4799)
ans_array.append(5799)
ans_array.append(6799)
ans_array.append(7799)
ans_array.append(8799)
ans_array.append(9799)

ans_array.append(1699)
ans_array.append(2699)
ans_array.append(3699)
ans_array.append(4699)
ans_array.append(5699)
ans_array.append(6699)
ans_array.append(7699)
ans_array.append(8699)
ans_array.append(9699)

ans_array.append(1599)
ans_array.append(2599)
ans_array.append(3599)
ans_array.append(4599)
ans_array.append(5599)
ans_array.append(6599)
ans_array.append(7599)
ans_array.append(8599)
ans_array.append(9599)

ans_array.append(1499)
ans_array.append(2499)
ans_array.append(3499)
ans_array.append(4499)
ans_array.append(5499)
ans_array.append(6499)
ans_array.append(7499)
ans_array.append(8499)
ans_array.append(9499)

ans_array.append(1399)
ans_array.append(2399)
ans_array.append(3399)
ans_array.append(4399)
ans_array.append(5399)
ans_array.append(6399)
ans_array.append(7399)
ans_array.append(8399)
ans_array.append(9399)

ans_array.append(1299)
ans_array.append(2299)
ans_array.append(3299)
ans_array.append(4299)
ans_array.append(5299)
ans_array.append(6299)
ans_array.append(7299)
ans_array.append(8299)
ans_array.append(9299)

ans_array.append(1199)
ans_array.append(2199)
ans_array.append(3199)
ans_array.append(4199)
ans_array.append(5199)
ans_array.append(6199)
ans_array.append(7199)
ans_array.append(8199)
ans_array.append(9199)

ans_array.append(18999)
ans_array.append(28999)
ans_array.append(38999)
ans_array.append(48999)
ans_array.append(58999)
ans_array.append(68999)
ans_array.append(78999)
ans_array.append(88999)
ans_array.append(98999)

ans_array.append(17999)
ans_array.append(27999)
ans_array.append(37999)
ans_array.append(47999)
ans_array.append(57999)
ans_array.append(67999)
ans_array.append(77999)
ans_array.append(87999)
ans_array.append(97999)

ans_array.append(16999)
ans_array.append(26999)
ans_array.append(36999)
ans_array.append(46999)
ans_array.append(56999)
ans_array.append(66999)
ans_array.append(76999)
ans_array.append(86999)
ans_array.append(96999)

ans_array.append(15999)
ans_array.append(25999)
ans_array.append(35999)
ans_array.append(45999)
ans_array.append(55999)
ans_array.append(65999)
ans_array.append(75999)
ans_array.append(85999)
ans_array.append(95999)

ans_array.append(14999)
ans_array.append(24999)
ans_array.append(34999)
ans_array.append(44999)
ans_array.append(54999)
ans_array.append(64999)
ans_array.append(74999)
ans_array.append(84999)
ans_array.append(94999)

ans_array.append(13999)
ans_array.append(23999)
ans_array.append(33999)
ans_array.append(43999)
ans_array.append(53999)
ans_array.append(63999)
ans_array.append(73999)
ans_array.append(83999)
ans_array.append(93999)

ans_array.append(12999)
ans_array.append(22999)
ans_array.append(32999)
ans_array.append(42999)
ans_array.append(52999)
ans_array.append(62999)
ans_array.append(72999)
ans_array.append(82999)
ans_array.append(92999)

ans_array.append(11999)
ans_array.append(21999)
ans_array.append(31999)
ans_array.append(41999)
ans_array.append(51999)
ans_array.append(61999)
ans_array.append(71999)
ans_array.append(81999)
ans_array.append(91999)

ans_array.append(18999)
ans_array.append(28999)
ans_array.append(38999)
ans_array.append(48999)
ans_array.append(58999)
ans_array.append(68999)
ans_array.append(78999)
ans_array.append(88999)
ans_array.append(98999)
ans_array.append(189999)
ans_array.append(289999)
ans_array.append(389999)
ans_array.append(489999)
ans_array.append(589999)
ans_array.append(689999)
ans_array.append(789999)
ans_array.append(889999)
ans_array.append(989999)
ans_array.append(1899999)
ans_array.append(2899999)
ans_array.append(3899999)
ans_array.append(4899999)
ans_array.append(5899999)
ans_array.append(6899999)
ans_array.append(7899999)
ans_array.append(8899999)
ans_array.append(9899999)

ans_array.append(18999999)
ans_array.append(28999999)
ans_array.append(38999999)
ans_array.append(48999999)
ans_array.append(58999999)
ans_array.append(68999999)
ans_array.append(78999999)
ans_array.append(88999999)
ans_array.append(98999999)

ans_array.append(189999999)
ans_array.append(289999999)
ans_array.append(389999999)
ans_array.append(489999999)
ans_array.append(589999999)
ans_array.append(689999999)
ans_array.append(789999999)
ans_array.append(889999999)
ans_array.append(989999999)
ans_array.append(1899999999)
ans_array.append(2899999999)
ans_array.append(3899999999)
ans_array.append(4899999999)
ans_array.append(5899999999)
ans_array.append(6899999999)
ans_array.append(7899999999)
ans_array.append(8899999999)
ans_array.append(9899999999)



ans_array.sort()

for i in range(K):
    print(ans_array[i])

Submission status: Wrong Answer

Solution code:
k = int(input())
for i in range(min(k, 9)):
    print(i + 1)

coef = 10
count = 1
for i in range(k - 9):
    if count == 10:
        count = 1
        coef *= 10
    print(count * coef + 9)
    count += 1

Submission status: Wrong Answer

Solution code:
import sys
import random
import math

def rd():
        return sys.stdin.readline().rstrip()

def rdi():
        return [ int(x) for x in rd().split() ]

K, = rdi()

def sm(x):
        r = 0
        while x > 0:
                r += x % 10
                x /= 10
        return r

assert sm(9) == 9
assert sm(123) == 6

def jth(x, j):
        r = x % (10 ** (j+1))
        r /= (10 ** j)
        return r

ans = []
if False:
        a = []
        for i in range(1, 100000):
                a.append( (i/float(sm(i)), i) )
        a.sort()
        mx = 0
        for x in a:
                x, y = x
                if y > mx:
                        #print y, x
                        ans.append(y)
                mx = max(mx, y)

k = 1
while k <= 9 and k < K:
        print k
        k += 1


k = 10

while k < K:
        while True:
                s = sm(k)
                j = math.log10(k/s)
                #print k, s, j
                if j < 0:
                        break
                p = int(math.floor(j))
                j = 0
                while j <= p:
                        a = jth(k, j)
                        if a < 9:
                                k += 10 ** j
                                s += 1
                                break
                        j += 1
                else:
                        break
        print k
        assert not ans or k in ans
        #for i in range(1000000):
        #       assert k/float(sm(k)) <= (k+i)/float(sm(k+i))
        k += 1

Submission status: Wrong Answer

Solution code:
N = int(input())
a =[1,2,3,4,5,6,7,8,9]
for i in range(1,100):
  b = 10**i - 1
  for j in range(1,10):
    a.append(b + j * 10 ** i)
  
for i in range(N):
  print(a[i])

Submission status: Wrong Answer

Solution code:
import numpy as np
import math

# K = int(input())
K = 1000

i = 1
s = [1]

class Hoge:
    def __init__(self, k):
        self.how = self.howmany()
        self.k = k
        now = 0

    def howmany(self):
        yield 9
        i = 10
        while 1:
            yield i - 1
            i += 10
        
    def get(self):
        now = 0
        step = 0
        i = 1
        while 1:
            for _ in range(next(self.how)):
                now += i
                print(now)
                step += 1
                if step > self.k:
                    exit()
            i *= 10


hoge = Hoge(K)

hoge.get()

Submission status: Wrong Answer

Solution code:
K = int(input())
c = [9, 9, 19, 28, 37, 46, 55, 64, 73, 82, 91, 90, 190, 280, 370, 460]
inc = 1
idx = 0
res = 0
for i in range(1, K+1):
	res += inc
	c[idx] -= 1
	if c[idx] == 0:
		idx += 1
		inc *= 10		
	print(res)

Submission status: Wrong Answer

Solution code:
import sys
K=int(input())
L=[1,2,3,4,5,6,7,8,9,19,29,39,49,59,69,79,89,99,199,299,399,499,599,699,799,899,999]
L=set(L)
for i in range(10):
    for j in range(i*10):
        L.add(pow(10,i) * j + pow(10,i)-1)
for i in range(10,17):
    t=i-10
    for j in range(t*100):
        L.add(pow(10,i) * j + pow(10,i)-1)
L=list(L)
L.sort()
ans=L[:K]
print('\n'.join(map(str,ans)))

Submission status: Wrong Answer

Solution code:
#!/usr/bin/env python3
# -*- coding: utf-8 -*-

import array
from bisect import *
from collections import *
import fractions
import heapq 
from itertools import *
import math
import random
import re
import string
import sys

def S(k):
    return sum(int(x) for x in str(k))
def T(k):
    return k / S(k)

def exp1():
    
    for k in range(1, 1300):
        # print("{}/S({}) = {}".format(k, k, k / S(k)))
        print("{}\t{}".format(k, k / S(k)))
    
    
    MAX = 10300000
    ans = [None] * MAX
    for k in range(1, MAX):
        # print("{}/S({}) = {}".format(k, k, k / S(k)))
        # print("{}\t{}".format(k, k / S(k)))
        ans[k] = k / S(k)
    
    mins = [None] * MAX
    k = MAX - 1
    mins[k] = ans[k]
    k -= 1
    while k >= 1:
        if (ans[k] <= mins[k+1]):
            print("{} is answer".format(k))
        mins[k] = min(mins[k+1], ans[k])
        k -= 1


def exp2():
    start = 10
    end = 99
    idx = -1
    while True:
        mn = 1e20
        for i in range(start, end + 1):
            res = T(i)
            if res < mn:
                mn = res
                idx = i
        print("start, end, mn, idx = {}, {}, {}, {}".format(start, end, mn, idx))
        start *= 10
        end = end * 10 + 9

def exp3():
    MAX = 1000000
    ans = [None] * MAX

    for i in range(MAX // 10, MAX):
        num_str = str(i) + '9999999'
        num = int(num_str)
        ans[i] = T(i)
    
    mins = [None] * MAX
    k = MAX - 1
    mins[k] = ans[k]
    k -= 1
    while k >= MAX // 10:
        if (ans[k] <= mins[k+1]):
            print("{} is answer".format(k))
        mins[k] = min(mins[k+1], ans[k])
        k -= 1

        # mytest(num)


# exp1()
# exp2()
# exp3()
# sys.exit(0)

ans = list(range(1, 10))
for i in range(19, 100, 10):
    ans.append(i)
for i in range(199, 1000, 100):
    ans.append(i)

nine = '99'
to = 19
while ans[-1] < 10000000000000000:
    for i in range(10, to):
        tmp = int(str(i) + nine)
        ans.append(tmp)
    for j in range(to, 100, 10):
        tmp = int(str(j) + nine)
        ans.append(tmp)

    nine += '9'
    
    to += 10
    if to > 99:
        break

# print(ans)

# 適当
tmp = 1099999999999
while ans[-1] < 10000000000000000:
    ans.append(tmp)
    tmp = tmp * 10 + 9

# for a in ans:
#     print(a)
    
# def mytest(k):
#     print("{}/S({}) = {}".format(k, k, k / S(k)))

# # mytest(1000000000000)
# mytest(1009999999999) # x
# mytest(1099999999999)
# mytest(1199999999999)
# mytest(1299999999999)
# mytest(1999999999999)
# mytest(2099999999999)
# mytest(2199999999999)
# mytest(2299999999999)

# mytest(1019999999999)
# mytest(1029999999999)
# mytest(9999999999999)

    
K = int(input())
ans = ans[:K]
for a in ans:
    print(a)

Submission status: Wrong Answer

Solution code:
def sun(n):
    sum = 0
    for i in str(n):
        sum += int(i)
    return n / sum

ip = input()
K = int(ip)

bd = sun(K)
count = 1

oplist = []


while len(oplist) < K:
    buf = sun(count)
    if buf < bd:
        oplist.append(count)
    count += 1

for oping in oplist:
    print(oping)

Submission status: Wrong Answer

Solution code:
import sys
K=int(input())
L=[1,2,3,4,5,6,7,8,9,19,29,39,49,59,69,79,89,99,199,299,399,499,599,699,799,899,999]
L=set(L)
for i in range(10):
    for j in range(i*10):
        L.add(pow(10,i) * j + pow(10,i)-1)
for i in range(10,17):
    t=i-10
    for j in range(t*10):
        L.add(pow(10,i) * j + pow(10,i)-1)
L=list(L)
L.sort()
ans=L[:K]
print('\n'.join(map(str,ans)))

Submission status: Wrong Answer

Solution code:
def pp(one, two, qu):
    ans = ""
    if one == 0:
        ans += str(two)
    else:
        ans += str(one)
        ans += str(two)
    for i in range(qu):
            ans += "9"
    print(ans)
    

K = int(input())
su = [1, 2, 3, 4, 5, 6, 7, 8, 9, 19, 29, 39, 49, 59, 69, 79, 89, 99]
i = 0
while K > i:
    if i == 18:
        break
    print(su[i])
    i += 1
qu = 2
one = 0
two = 1
K -= 18
while(K > 0):
    pp(one, two, qu)
    K -= 1
    if two == 9:
        if one + 1 < qu:
            one += 1
            two = 0
        else:
            two = qu
            one = 0
            qu += 1
    else:
        two += 1