TnT/Multi_CodeNet4Repair huggingface dataset:
Problem: Kurohashi has never participated in AtCoder Beginner Contest (ABC).  The next ABC to be held is ABC N (the N-th ABC ever held). Kurohashi wants to make his debut in some ABC x such that all the digits of x in base ten are the same.  What is the earliest ABC where Kurohashi can make his debut?

Submission attempts (in order):
n=int(input())
a_list=[str(i)*3 for i in range(1,10)]

for i in range(1,9):
  if int(a_list[i])< n <=int(a_list[i+1]):
    print(a_list[i+1])
    break
  elif int(a_list[i])==n:
    print(a_list[i])
    break
    

n=int(input())
a_list=[str(i)*3 for i in range(1,10)]
flag=False

for i in range(1,10):
  if int(a_list[i])==n:
    print(a_list[i])
    flag=True
    break
if flag==False:
  for i in range(1,9):
    if int(a_list[i])< n < int(a_list[i+1]):
      print(a_list[i+1])
      break

n=int(input())
a_list=[str(i)*3 for i in range(1,10)]

for i in range(1,9):
  if a_list[i]< n <= a_list[i+1]:
    print(a_list[i+1])
    break
  elif a_list[i]= n:
    print(a_list[i])
    break
    
    

n=int(input())
a_list=[str(i)*3 for i in range(1,10)]

for i in range(1,9):
  if a_list[i]< n <= a_list[i+1]:
    print(a_list[i+1])
    break
  elif a_list[i]==n:
    print(a_list[i])
    break
    

n=int(input())
a_list=[str(i)*3 for i in range(1,10)]

for i in range(1,9):
  if a_list[i]< n <= a_list[i+1]:
    print(a_list[i+1])
    break
  elif a_list[i]= n:
    print(a_list[i])
    
    

n=int(input())
a_list=[str(i)*3 for i in range(1,10)]
flag=False

for i in range(0,9):
  if int(a_list[i])==n:
    print(a_list[i])
    flag=True
    break
  elif n < 111:
    print("111")
    break
if flag==False:
  for i in range(0,8):
    if int(a_list[i])< n < int(a_list[i+1]):
      print(a_list[i+1])
      break

Verdicts: Wrong Answer

Runtime Error

Runtime Error

Runtime Error

Runtime Error

Accepted
Problem: Kurohashi has never participated in AtCoder Beginner Contest (ABC).  The next ABC to be held is ABC N (the N-th ABC ever held). Kurohashi wants to make his debut in some ABC x such that all the digits of x in base ten are the same.  What is the earliest ABC where Kurohashi can make his debut?

Submission attempts (in order):
n = int(input())
while True:
    if n%10 == n//10%10 == n // 100:
        print(n)
    else:
        n += 1

n = int(input())
while True:
    if n%10 == n//10%10 == n // 100:
        print(n)
        break
    else:
        n += 1

Verdicts: Time Limit Exceeded

Accepted
Problem: Kurohashi has never participated in AtCoder Beginner Contest (ABC).  The next ABC to be held is ABC N (the N-th ABC ever held). Kurohashi wants to make his debut in some ABC x such that all the digits of x in base ten are the same.  What is the earliest ABC where Kurohashi can make his debut?

Submission attempts (in order):
s = input()
ans = 0
if int(s[0]) >= int(s[1]) and int(s[0]) >= int(s[2]):
    print(int(s[0]),int(s[1]),int(s[2]))


    ans = int(s[0]) * 100 + int(s[0]) * 10 + int(s[0]) * 1
else:
    ans = int(s[0]) * 100 + int(s[0]) * 10 + int(s[0]) * 1 + 111
print(ans)


s = input()
ans = 0
if int(s[0]) >= int(s[1]) and int(s[0]) >= int(s[2]):
    ans = int(s[0]) * 100 + int(s[0]) * 10 + int(s[0]) * 1
else:
    ans = int(s[0]) * 100 + int(s[0]) * 10 + int(s[0]) * 1 + 111
print(ans)

Verdicts: Wrong Answer

Accepted
Problem: Kurohashi has never participated in AtCoder Beginner Contest (ABC).  The next ABC to be held is ABC N (the N-th ABC ever held). Kurohashi wants to make his debut in some ABC x such that all the digits of x in base ten are the same.  What is the earliest ABC where Kurohashi can make his debut?

Submission attempts (in order):
N = int(input())

list_aaa = [111,222,333,444,555,666,777,888,999]
cnt =0

for i in range(len(list_aaa)):
    if N >= list_aaa[i]:
        cnt +=1

if cnt ==0:
    print(111)
else:
    print(list_aaa[cnt])


N = int(input())

list_aaa = [111,222,333,444,555,666,777,888,999]
cnt =0

for i in range(len(list_aaa)):
    if N >= list_aaa[i]:
        cnt +=1

if cnt ==0:
    print(111)
    exit()
else:
    print(list_aaa[cnt])


N = int(input())

list_aaa = [111,222,333,444,555,666,777,888,999]
cnt =0

for i in range(len(list_aaa)):
    if N >= list_aaa[i]:
        cnt +=1

if cnt ==0:
    print(111)
    exit()
else:
    print(list_aaa[cnt])


N = int(input())

list_aaa = [111,222,333,444,555,666,777,888,999]
cnt =0

for i in range(len(list_aaa)):
    if N > list_aaa[i]:
        cnt +=1

if cnt ==0:
    print(111)
else:
    print(list_aaa[cnt])


Verdicts: Runtime Error

Runtime Error

Runtime Error

Accepted
Problem: Kurohashi has never participated in AtCoder Beginner Contest (ABC).  The next ABC to be held is ABC N (the N-th ABC ever held). Kurohashi wants to make his debut in some ABC x such that all the digits of x in base ten are the same.  What is the earliest ABC where Kurohashi can make his debut?

Submission attempts (in order):
def main():
    n = int(input())

    a = 111

    while (a <= n):
        a += 111

    print(a)

if __name__=='__main__':
    main()

def main():
    n = int(input())

    a = 111

    while (a < n):
        a += 111

    print(a)

if __name__=='__main__':
    main()

Verdicts: Wrong Answer

Accepted
Problem: Kurohashi has never participated in AtCoder Beginner Contest (ABC).  The next ABC to be held is ABC N (the N-th ABC ever held). Kurohashi wants to make his debut in some ABC x such that all the digits of x in base ten are the same.  What is the earliest ABC where Kurohashi can make his debut?

Submission attempts (in order):
n = int(input())
for i in range(1, 1000):
  if n < 111 * i:
    print(111*i)
    break
else:
  print(999)

n = int(input())
for i in range(1, 1000):
  if n <= 111 * i:
    print(111*i)
    break

Verdicts: Wrong Answer

Accepted
Problem: Kurohashi has never participated in AtCoder Beginner Contest (ABC).  The next ABC to be held is ABC N (the N-th ABC ever held). Kurohashi wants to make his debut in some ABC x such that all the digits of x in base ten are the same.  What is the earliest ABC where Kurohashi can make his debut?

Submission attempts (in order):
n=input()
if int(n[0])>int(n[1]):
  out=int(n[0])
elif int(n[0])==int(n[1]):
  if int(n[1])>int(n[2]):
    out=int(n[0])
  else:
    out=int(n[0])+1
else:
    out=int(n[0])+1
print(str(out)*3)

n=input()
if int(n[0])>int(n[1]):
  out=int(n[0])
else:
  out=int(n[0])+1

print(str(out)*3)

n=input()
if int(n[0])>int(n[1]):
  out=int(n[0])
elif int(n[0])==int(n[1]):
  if int(n[1])>=int(n[2]):
    out=int(n[0])
  else:
    out=int(n[0])+1
else:
    out=int(n[0])+1
print(str(out)*3)

Verdicts: Wrong Answer

Wrong Answer

Accepted
Problem: Kurohashi has never participated in AtCoder Beginner Contest (ABC).  The next ABC to be held is ABC N (the N-th ABC ever held). Kurohashi wants to make his debut in some ABC x such that all the digits of x in base ten are the same.  What is the earliest ABC where Kurohashi can make his debut?

Submission attempts (in order):
n=int(input())
m=n%100
a=(m*100)+(m*10)+m
if a<n:
    print(a)
else:
    m+=1
    a=(m*100)+(m*10)+m
    print(a)

n=int(input())
m=n//100
#print(m)
a=(m*100)+(m*10)+m
if a>=n:
    print(a)
else:
    m+=1
    a=(m*100)+(m*10)+m
    print(a)

Verdicts: Wrong Answer

Accepted
Problem: Kurohashi has never participated in AtCoder Beginner Contest (ABC).  The next ABC to be held is ABC N (the N-th ABC ever held). Kurohashi wants to make his debut in some ABC x such that all the digits of x in base ten are the same.  What is the earliest ABC where Kurohashi can make his debut?

Submission attempts (in order):
n=int(input())
for i in range(n,1000):
  if i%100 == i//10:
    print(i)

n=int(input())
for i in range(n,1000):
  if n%100 == n//10:
    print(n)

n=int(input())
for i in range(111,1000, 111):
  if i>= n:
    print(i)
    exit()

Verdicts: Wrong Answer

Wrong Answer

Accepted
Problem: Kurohashi has never participated in AtCoder Beginner Contest (ABC).  The next ABC to be held is ABC N (the N-th ABC ever held). Kurohashi wants to make his debut in some ABC x such that all the digits of x in base ten are the same.  What is the earliest ABC where Kurohashi can make his debut?

Submission attempts (in order):
import sys, os

f = lambda:list(map(int,input().split()))
if 'local' in os.environ :
    sys.stdin = open('./input.txt', 'r')

def ok(n):
    s = str(n)
    if len(set(s)) == 1:
        return True
    return False

def solve():
    n = f()
    for i in range(n, 1000):
        if ok(i):
            print(i)
            return

solve()


import sys, os

f = lambda:list(map(int,input().split()))
if 'local' in os.environ :
    sys.stdin = open('./input.txt', 'r')

def ok(n):
    s = str(n)
    if len(set(s)) == 1:
        return True
    return False

def solve():
    n = f()[0]
    for i in range(n, 1000):
        if ok(i):
            print(i)
            return

solve()


Verdicts: Runtime Error

Accepted
Problem: Kurohashi has never participated in AtCoder Beginner Contest (ABC).  The next ABC to be held is ABC N (the N-th ABC ever held). Kurohashi wants to make his debut in some ABC x such that all the digits of x in base ten are the same.  What is the earliest ABC where Kurohashi can make his debut?

Submission attempts (in order):
import sys
input = sys.stdin.readline

N = int(input())
out = []
for i in range(1,10):
    out.append(i*100 + i*10 + i)
print(out)
for i in range(len(out)):
    if out[i] >= N:
        print(out[i])
        exit()

import sys
input = sys.stdin.readline

N = int(input())
out = []
for i in range(1,10):
    out.append(i*100 + i*10 + i)
for i in range(len(out)):
    if out[i] >= N:
        print(out[i])
        exit()

Verdicts: Wrong Answer

Accepted
Problem: Kurohashi has never participated in AtCoder Beginner Contest (ABC).  The next ABC to be held is ABC N (the N-th ABC ever held). Kurohashi wants to make his debut in some ABC x such that all the digits of x in base ten are the same.  What is the earliest ABC where Kurohashi can make his debut?

Submission attempts (in order):
a,b,c = int(input().split())
if a > b:
  print(a*111)
elif a == b:
  if b >= c:
    print(a*111)
  else:
    print((a+1)*111)
else:
  print((a+1)*111)
  

n = input()
a,b,c = [int(n[i]) for i in range(len(n))]
print(a)
if a > b:
  print(a*111)
elif a == b:
  if b >= c:
    print(a*111)
  else:
    print((a+1)*111)
else:
  print((a+1)*111)
  

n = input()
a,b,c = [int(n[i]) for i in range(len(n))]

if a > b:
  print(a*111)
elif a == b:
  if b >= c:
    print(a*111)
  else:
    print((a+1)*111)
else:
  print((a+1)*111)
  

Verdicts: Runtime Error

Wrong Answer

Accepted
Problem: Kurohashi has never participated in AtCoder Beginner Contest (ABC).  The next ABC to be held is ABC N (the N-th ABC ever held). Kurohashi wants to make his debut in some ABC x such that all the digits of x in base ten are the same.  What is the earliest ABC where Kurohashi can make his debut?

Submission attempts (in order):
a = int(input())

for i in range(10):
	if a<i*111:
		print(i*111)
		break





a = int(input())

for i in range(10):
	if a<=i*111:
		print(i*111)
		break





Verdicts: Wrong Answer

Accepted
Problem: Kurohashi has never participated in AtCoder Beginner Contest (ABC).  The next ABC to be held is ABC N (the N-th ABC ever held). Kurohashi wants to make his debut in some ABC x such that all the digits of x in base ten are the same.  What is the earliest ABC where Kurohashi can make his debut?

Submission attempts (in order):
n = input()
if int(n) < int(n[0]) * 111:
  print(int(n[0]) * 111)
else:
  print((int(n[0]) + 1) * 111)


n = input()
if int(n) <= int(n[0]) * 111:
  print(int(n[0]) * 111)
else:
  print((int(n[0]) + 1) * 111)

Verdicts: Wrong Answer

Accepted
Problem: Kurohashi has never participated in AtCoder Beginner Contest (ABC).  The next ABC to be held is ABC N (the N-th ABC ever held). Kurohashi wants to make his debut in some ABC x such that all the digits of x in base ten are the same.  What is the earliest ABC where Kurohashi can make his debut?

Submission attempts (in order):
print(((int(input()) + 110) / 111 + 1) * 111)

print((int(input()) + 110) / 111 * 111)

print(((int(input()) + 110) // 111) * 111)

Verdicts: Wrong Answer

Wrong Answer

Accepted
Problem: Kurohashi has never participated in AtCoder Beginner Contest (ABC).  The next ABC to be held is ABC N (the N-th ABC ever held). Kurohashi wants to make his debut in some ABC x such that all the digits of x in base ten are the same.  What is the earliest ABC where Kurohashi can make his debut?

Submission attempts (in order):
print("aa")

print("aa")

n = input()
l=len(n)
s1=str(n[0]*l)
s2=""
if n[0]=='9':
    s2="1"*(l+1)
else:
    s2=str(int(n[0])+1)*l

if n<=s1:
    print(s1)
else:
    print(s2)

Verdicts: Wrong Answer

Wrong Answer

Accepted
Problem: Kurohashi has never participated in AtCoder Beginner Contest (ABC).  The next ABC to be held is ABC N (the N-th ABC ever held). Kurohashi wants to make his debut in some ABC x such that all the digits of x in base ten are the same.  What is the earliest ABC where Kurohashi can make his debut?

Submission attempts (in order):
# ABC111B

num = float(input())
i = num / 111
print(round(i + 0.5) * 111)


def main():
    N = int(input())
    ans = (N + 110) // 111 * 111
    print(ans)


if __name__ == "__main__":
    main()

Verdicts: Wrong Answer

Accepted
Problem: Kurohashi has never participated in AtCoder Beginner Contest (ABC).  The next ABC to be held is ABC N (the N-th ABC ever held). Kurohashi wants to make his debut in some ABC x such that all the digits of x in base ten are the same.  What is the earliest ABC where Kurohashi can make his debut?

Submission attempts (in order):
n=int(input()
print(((n-1)//111)*111+111)

n=int(input()
print((((n-1)//111)+1)*111)

n=int(input()
print(((n-1)//111)*111+111)

n=int(input()
print((n-1)//111+111))

n=int(input())
print((((n-1)//111)+1)*111)

Verdicts: Runtime Error

Runtime Error

Runtime Error

Runtime Error

Accepted
Problem: Kurohashi has never participated in AtCoder Beginner Contest (ABC).  The next ABC to be held is ABC N (the N-th ABC ever held). Kurohashi wants to make his debut in some ABC x such that all the digits of x in base ten are the same.  What is the earliest ABC where Kurohashi can make his debut?

Submission attempts (in order):
N=int(input())

for i in range(N,1000):
  a=N//100
  c=N%10
  b=N-(100*a + c)
  if a==b==c:
    print(i)
    break

N=int(input())

for i in range(N,1000):
  a=str(i)[0]
  b=str(i)[1]
  c=str(i)[2]
  if a==b and b==c:
    print(i)
    break

Verdicts: Wrong Answer

Accepted
Problem: Kurohashi has never participated in AtCoder Beginner Contest (ABC).  The next ABC to be held is ABC N (the N-th ABC ever held). Kurohashi wants to make his debut in some ABC x such that all the digits of x in base ten are the same.  What is the earliest ABC where Kurohashi can make his debut?

Submission attempts (in order):
n = input()
x = (n - 1) // 111 + 1
print(x * 111)


n = int(input())
x = (n - 1) // 111 + 1
print(x * 111)


Verdicts: Runtime Error

Accepted
Problem: Kurohashi has never participated in AtCoder Beginner Contest (ABC).  The next ABC to be held is ABC N (the N-th ABC ever held). Kurohashi wants to make his debut in some ABC x such that all the digits of x in base ten are the same.  What is the earliest ABC where Kurohashi can make his debut?

Submission attempts (in order):
import bisect
N = int(input())
candidate = [int(i*111) for i in range(1,10)]
print(candidate[bisect.bisect_right(candidate, N)])

import bisect
N = int(input())
candidate = [int(i*111) for i in range(1,10)]
print(candidate[bisect.bisect_left(candidate, N)])

Verdicts: Runtime Error

Accepted
Problem: Kurohashi has never participated in AtCoder Beginner Contest (ABC).  The next ABC to be held is ABC N (the N-th ABC ever held). Kurohashi wants to make his debut in some ABC x such that all the digits of x in base ten are the same.  What is the earliest ABC where Kurohashi can make his debut?

Submission attempts (in order):
print(111*(1+int(input())//111))

N=int(input())
a=N//111
b=N%111
if b>0:
  a+=1
print(111*a)

Verdicts: Wrong Answer

Accepted
Problem: Kurohashi has never participated in AtCoder Beginner Contest (ABC).  The next ABC to be held is ABC N (the N-th ABC ever held). Kurohashi wants to make his debut in some ABC x such that all the digits of x in base ten are the same.  What is the earliest ABC where Kurohashi can make his debut?

Submission attempts (in order):
N = int(input())

if N < 111:
  print('111')
elif N < 222:
  print('222')
elif N < 333:
  print('333')
elif N < 444:
  print('444')
elif N < 555:
  print('555')
elif N < 666:
  print('666')
elif N < 777:
  print('777')
elif N < 888:
  print('888')
elif N < 999:
  print('999')

N = int(input())

if N <= 111:
  print('111')
elif N <= 222:
  print('222')
elif N <= 333:
  print('333')
elif N <= 444:
  print('444')
elif N <= 555:
  print('555')
elif N <= 666:
  print('666')
elif N <= 777:
  print('777')
elif N <= 888:
  print('888')
elif N <= 999:
  print('999')


Verdicts: Wrong Answer

Accepted
Problem: Kurohashi has never participated in AtCoder Beginner Contest (ABC).  The next ABC to be held is ABC N (the N-th ABC ever held). Kurohashi wants to make his debut in some ABC x such that all the digits of x in base ten are the same.  What is the earliest ABC where Kurohashi can make his debut?

Submission attempts (in order):
n = int(input())
a = [111,222,333,444,555,666,777,888,999]
for i in a:
  if i >= n:
    print(i)


n = int(input())
a = [111,222,333,444,555,666,777,888,999]
b = 0
for i in a:
  if i >= n:
    b = i
    break
print(b)


Verdicts: Wrong Answer

Accepted
Problem: Kurohashi has never participated in AtCoder Beginner Contest (ABC).  The next ABC to be held is ABC N (the N-th ABC ever held). Kurohashi wants to make his debut in some ABC x such that all the digits of x in base ten are the same.  What is the earliest ABC where Kurohashi can make his debut?

Submission attempts (in order):
n = int(input())

while 1:
  lst = set(list(str(n)))
  if len(lst)==1:
    print(n)
  else:
    n+= 1
    

n = int(input())
for i in range(1,10):
  if i*111 >= n:
    print(i*111)
    break
    

Verdicts: Time Limit Exceeded

Accepted
Problem: Kurohashi has never participated in AtCoder Beginner Contest (ABC).  The next ABC to be held is ABC N (the N-th ABC ever held). Kurohashi wants to make his debut in some ABC x such that all the digits of x in base ten are the same.  What is the earliest ABC where Kurohashi can make his debut?

Submission attempts (in order):
n=input()
length = len(n)
x = n[0]


if n[1] < x:
    x = x*length

elif n[1] > x:
    x = str(int(x) + 1)*length

else:
    
    if n[2] < x:
        x = x *length
    
    elif n[2] > x:
        x = str(int(x)+1)*length


if int(n) == 999:
    x = '1111'

print(x)
        
        


n=input()
length = len(n)
x = n[0]


if n[1] < x:
    x = x*length

elif n[1] > x:
    x = str(int(x) + 1)*length

else:
    
    if n[2] < x:
        x = x *length
    
    elif n[2] > x:
        x = str(int(x)+1)*length

    else:
        x = x * length

if int(n) == 999:
    x = '999'

print(x)
        
        


Verdicts: Wrong Answer

Accepted
Problem: Kurohashi has never participated in AtCoder Beginner Contest (ABC).  The next ABC to be held is ABC N (the N-th ABC ever held). Kurohashi wants to make his debut in some ABC x such that all the digits of x in base ten are the same.  What is the earliest ABC where Kurohashi can make his debut?

Submission attempts (in order):
n = int(input())
t = int(str(n)[0])
if n < (100*t+10*t+t):
    print(100*t+10*t+t)
else:
    print(100*(t+1)+10*(t+1)+t+1)
    

n = int(input())
t = int(str(n)[0])
if n-1 < (100*t+10*t+t):
    print(100*t+10*t+t)
else:
    print(100*(t+1)+10*(t+1)+t+1)
    

Verdicts: Wrong Answer

Accepted
Problem: Kurohashi has never participated in AtCoder Beginner Contest (ABC).  The next ABC to be held is ABC N (the N-th ABC ever held). Kurohashi wants to make his debut in some ABC x such that all the digits of x in base ten are the same.  What is the earliest ABC where Kurohashi can make his debut?

Submission attempts (in order):
n = list(input())
a = int(str(n[0])+str(n[1]))
b = int(str(n[1])+str(n[2]))

if a > b:
    print(n[0]*3)
else:
    c =str( int(n[0]) + 1)
    print(c*3)

n = list(input())
a = int(str(n[0])+str(n[1]))
b = int(str(n[1])+str(n[2]))

if a >= b:
    print(n[0]*3)
else:
    c =str( int(n[0]) + 1)
    print(c*3)

Verdicts: Wrong Answer

Accepted
Problem: Kurohashi has never participated in AtCoder Beginner Contest (ABC).  The next ABC to be held is ABC N (the N-th ABC ever held). Kurohashi wants to make his debut in some ABC x such that all the digits of x in base ten are the same.  What is the earliest ABC where Kurohashi can make his debut?

Submission attempts (in order):
N = int(input())
print(lst)
for i in range(1000):
    if N in lst:
        print(N)
        break
    else:
        N += 1

N = int(input())
lst = [i*100+i*10+i for i in range(1,10)]
for i in range(1000):
    if N in lst:
        print(N)
        break
    else:
        N += 1

Verdicts: Runtime Error

Accepted
Problem: Kurohashi has never participated in AtCoder Beginner Contest (ABC).  The next ABC to be held is ABC N (the N-th ABC ever held). Kurohashi wants to make his debut in some ABC x such that all the digits of x in base ten are the same.  What is the earliest ABC where Kurohashi can make his debut?

Submission attempts (in order):
print(111 if (int(input())//111)==0 else 111*(int(input())//111+1) )

n=int(input())
print(111 if (n//111)==0 else 111*(n//111+1) )

n=int(input())
print(n if n%111==0 else 111*(n//111+1) )

Verdicts: Runtime Error

Wrong Answer

Accepted
Problem: Kurohashi has never participated in AtCoder Beginner Contest (ABC).  The next ABC to be held is ABC N (the N-th ABC ever held). Kurohashi wants to make his debut in some ABC x such that all the digits of x in base ten are the same.  What is the earliest ABC where Kurohashi can make his debut?

Submission attempts (in order):
# import math
# import statistics
a=int(input())
#b,c=int(input()),int(input())
# c=[]

#     c.append(i)
#e1,e2 = map(int,input().split())
#f = list(map(int,input().split()))
#g = [input() for _ in range(a)]

z = a//9
af= a%9
if af==0:
    print(str(9)*(z))

else :
    print(str(af)*(z+1))


import math
# import statistics
# a=input()
#b,c=int(input()),int(input())
# c=[]

#    c.append(i)
e1,e2 = map(int,input().split())
#f = list(map(int,input().split()))
#g = [input() for _ in range(a)]
z = a//9
af= a%9
if af==0:
    print(str(9)*(z))
 
else :
    print(str(af)*(z+1))

# import math
# import statistics
a=input()
#b,c=int(input()),int(input())
# c=[]

#     c.append(i)
#e1,e2 = map(int,input().split())
#f = list(map(int,input().split()))
#g = [input() for _ in range(a)]

zyun= len(a)*9+int(a[0])
zoro=0
z = zyun//9
af= zyun%9
if af==0:
    if int(a)<=int(str(9)*(z-1)):
        print(int(str(9)*(z-1)))
    else:
            print(str(1)*(z))
else :
    if int(a)<=int(str(af)*(z)):
        print(int(str(af)*(z)))
    else:
        print(int(str(af+1)*(z)))




Verdicts: Wrong Answer

Runtime Error

Accepted
Problem: Kurohashi has never participated in AtCoder Beginner Contest (ABC).  The next ABC to be held is ABC N (the N-th ABC ever held). Kurohashi wants to make his debut in some ABC x such that all the digits of x in base ten are the same.  What is the earliest ABC where Kurohashi can make his debut?

Submission attempts (in order):
#include<bits/stdc++.h>

#include<algorithm>
#include<numeric>
#include<string>

using namespace std;
int main(){
    int N;
    cin>>N;
    for(int i=111;i<=999;i+=111){
        if(N<=i){
            cout<<i<<endl;
            return 0;
        }
    }
}

#include<bits/stdc++.h>

#include<algorithm>
#include<numeric>
#include<string>

using namespace std;
int main(){
    int N;
    cin>>N;
    for(int i=100;i<=999;i+111){
        if(N<=i){
            cout<<i<<endl;
            return 0;
        }
    }
    return 0;
}


n=int(input())
for i in range(111,1000,111):
        if n<=i:
                print(i)
                break

Verdicts: Runtime Error

Runtime Error

Accepted
Problem: Kurohashi has never participated in AtCoder Beginner Contest (ABC).  The next ABC to be held is ABC N (the N-th ABC ever held). Kurohashi wants to make his debut in some ABC x such that all the digits of x in base ten are the same.  What is the earliest ABC where Kurohashi can make his debut?

Submission attempts (in order):
#N = list(map(int, input()))
N = int(input())

list = [111,222,333,444,555,666,777,888,999]
ans = 0
for l in list:
  if N < l:
    ans = l
  else:
    break

print(ans)

#N = list(map(int, input()))
N = int(input())

list = [111,222,333,444,555,666,777,888,999]
ans = 0
for l in list:
  if N <= l:
    ans = l
  else:
    break

print(ans)

#N = list(map(int, input()))
N = int(input())

list = [111,222,333,444,555,666,777,888,999, 1000000]
ans = 0
for l in list:
  if N > l:
    continue
  else:
    ans =l
    break

print(ans)

Verdicts: Wrong Answer

Wrong Answer

Accepted
Problem: Kurohashi has never participated in AtCoder Beginner Contest (ABC).  The next ABC to be held is ABC N (the N-th ABC ever held). Kurohashi wants to make his debut in some ABC x such that all the digits of x in base ten are the same.  What is the earliest ABC where Kurohashi can make his debut?

Submission attempts (in order):
a = input()
print((((a-1)//111)+1)*111)

a = int(input())
print((((a-1)//111)+1)*111)

Verdicts: Runtime Error

Accepted
Problem: Kurohashi has never participated in AtCoder Beginner Contest (ABC).  The next ABC to be held is ABC N (the N-th ABC ever held). Kurohashi wants to make his debut in some ABC x such that all the digits of x in base ten are the same.  What is the earliest ABC where Kurohashi can make his debut?

Submission attempts (in order):
n=int(inp())
a=n%100
m=a*100+a*10+a
if n<=m:
  print(m)
else:
  print(m+111)

n=int(input())
a=n%100
m=a*100+a*10+a
if n<=m:
  print(m)
else:
  print(m+111)

n=int(input())
a=n//100
m=a*100+a*10+a
if n<=m:
  print(m)
else:
  print(m+111)

Verdicts: Runtime Error

Wrong Answer

Accepted
Problem: Kurohashi has never participated in AtCoder Beginner Contest (ABC).  The next ABC to be held is ABC N (the N-th ABC ever held). Kurohashi wants to make his debut in some ABC x such that all the digits of x in base ten are the same.  What is the earliest ABC where Kurohashi can make his debut?

Submission attempts (in order):
a = input()
if (a[-1] == '0' and (int(a[0]) >= int(a[2])) or  (int(a[0]) >= int(a[2]) and int(a[0]) >= int(a[1]))::
    ans = int(a[0] * 3)
else:
    ans = str(int(a[0])+1)*3
print(ans)


a = input()
if (a[-1] == '0' and (int(a[0]) >= int(a[2])) or  (int(a[0]) >= int(a[2]) and int(a[0]) >= int(a[1])):
    ans = int(a[0] * 3)
else:
    ans = str(int(a[0])+1)*3
print(ans)


a = input()
if (a[-1] == '0' and (int(a[0]) >= int(a[1]))):
    ans = int(a[0] * 3)
elif(int(a[0]) >= int(a[2]) and int(a[0]) >= int(a[1]) and a[-1] != '0'):
    ans = int(a[0] * 3)
else:
    ans = str(int(a[0])+1)*3
print(ans)


Verdicts: Runtime Error

Runtime Error

Accepted
Problem: Kurohashi has never participated in AtCoder Beginner Contest (ABC).  The next ABC to be held is ABC N (the N-th ABC ever held). Kurohashi wants to make his debut in some ABC x such that all the digits of x in base ten are the same.  What is the earliest ABC where Kurohashi can make his debut?

Submission attempts (in order):
# -*- coding: utf-8 -*-
import numpy as np
N = int(input())
l = np.array([111, 222, 333, 444, 555, 666, 777, 888, 999])
print(l<N)
ind = sum(l < N)
print(l[ind])


# -*- coding: utf-8 -*-
import numpy as np
N = int(input())
l = np.array([111, 222, 333, 444, 555, 666, 777, 888, 999])
ind = sum(l < N)
print(l[ind])


Verdicts: Wrong Answer

Accepted
Problem: Kurohashi has never participated in AtCoder Beginner Contest (ABC).  The next ABC to be held is ABC N (the N-th ABC ever held). Kurohashi wants to make his debut in some ABC x such that all the digits of x in base ten are the same.  What is the earliest ABC where Kurohashi can make his debut?

Submission attempts (in order):
n = int(input())
for i in range(1,10):
    t = 10-i
    if n > t*100 + t*10 + t:
        res = (t+1)*100 + (t+1)*10 + t+1
        break

print(res)


n = int(input())
for t in range(1,10):
    if n <= t*100 + t*10 + t:
        res = t*100 + t*10 + t
        break 

print(res)


Verdicts: Runtime Error

Accepted
Problem: Kurohashi has never participated in AtCoder Beginner Contest (ABC).  The next ABC to be held is ABC N (the N-th ABC ever held). Kurohashi wants to make his debut in some ABC x such that all the digits of x in base ten are the same.  What is the earliest ABC where Kurohashi can make his debut?

Submission attempts (in order):
x = ((N - (N % 111)) / 111) * 111

N = int(input())
if N % 111 == 0:
        x = ((N - (N % 111)) / 111) * 111
else:
        x = (((N - (N % 111)) / 111) + 1) * 111
print(int(x))

Verdicts: Runtime Error

Accepted
Problem: Kurohashi has never participated in AtCoder Beginner Contest (ABC).  The next ABC to be held is ABC N (the N-th ABC ever held). Kurohashi wants to make his debut in some ABC x such that all the digits of x in base ten are the same.  What is the earliest ABC where Kurohashi can make his debut?

Submission attempts (in order):
N=int(input())
X=set(str(N))
Y=len(X)
if Y==1
  print(N)
if Y!=1:
  Z=0
  for i in range(111,1000,111):
    if N-i<0:
      Z+=i
      break
  print(Z)

N=int(input())
X=set(str(N))
Y=len(X)
if Y==1:
  print(Y)
if Y!=1:
  Z=0
  for i in range(111,1000,111):
    if N-i<0:
      Z+=i
      break
  print(Z)

N=int(input())
X=set(str(N))
Y=len(X)
if Y==1:
  print(N)
if Y!=1:
  Z=0
  for i in range(111,1000,111):
    if N-i<0:
      Z+=i
      break
  print(Z)


Verdicts: Runtime Error

Wrong Answer

Accepted
Problem: Kurohashi has never participated in AtCoder Beginner Contest (ABC).  The next ABC to be held is ABC N (the N-th ABC ever held). Kurohashi wants to make his debut in some ABC x such that all the digits of x in base ten are the same.  What is the earliest ABC where Kurohashi can make his debut?

Submission attempts (in order):
line = int(input())
lina = list(map(int, [line/100, (line/10)%10, line%10]))
contest = [111*lina[0], 111*(lina[0]+1)]
if(contest[0] - line > 0):
    print(contest[0])
else:
    print(contest[1])

line = int(input())
lina = list(map(int, [line/100, (line/10)%10, line%10]))
contest = [111*lina[0], 111*(lina[0]+1)]
if(contest[0] - line >= 0):
    print(contest[0])
else:
    print(contest[1])

Verdicts: Wrong Answer

Accepted
Problem: Kurohashi has never participated in AtCoder Beginner Contest (ABC).  The next ABC to be held is ABC N (the N-th ABC ever held). Kurohashi wants to make his debut in some ABC x such that all the digits of x in base ten are the same.  What is the earliest ABC where Kurohashi can make his debut?

Submission attempts (in order):
N = int(input())
for i in range(1, 10):
  if N < i * 111:
    print(i * 111)
    break

N = int(input())
for i in range(1, 10):
  if N <= i * 111:
    print(i * 111)
    break

Verdicts: Wrong Answer

Accepted
Problem: Kurohashi has never participated in AtCoder Beginner Contest (ABC).  The next ABC to be held is ABC N (the N-th ABC ever held). Kurohashi wants to make his debut in some ABC x such that all the digits of x in base ten are the same.  What is the earliest ABC where Kurohashi can make his debut?

Submission attempts (in order):
import re
N = int(input())
_max = max([int(i) for i in str(N)])
print(_max * (len(str(N))))

N = int(input())
len_N = len(N)
num = int(str(N)[0]) + 1
if int(str(num) * len_N) < N:
  print(str(num) * len_N)
else:
  print(str(num + 1) * (len(str(N))))

N = int(input())
num = int(str(N)[0]) + 1
if str(N) == str(num) * (len(str(N))):
  print(N)
else:
  print(str(num) * (len(str(N))))

N = int(input())
len_N = len(str(N))
num = int(str(N)[0])
if int(str(num) * len_N) < N:
  print(str(num + 1) * len_N)
else:
  print(str(num) * (len(str(N))))

Verdicts: Wrong Answer

Runtime Error

Wrong Answer

Accepted
Problem: Kurohashi has never participated in AtCoder Beginner Contest (ABC).  The next ABC to be held is ABC N (the N-th ABC ever held). Kurohashi wants to make his debut in some ABC x such that all the digits of x in base ten are the same.  What is the earliest ABC where Kurohashi can make his debut?

Submission attempts (in order):
N = int(input())
for i in range(1, 10):
    num = int("i"*3)
    if N <= num:
        print(num)
        break


N = int(input())
for i in range(1, 10):
    num = i*111
    if N <= num:
        print(num)
        break


Verdicts: Runtime Error

Accepted
Problem: Kurohashi has never participated in AtCoder Beginner Contest (ABC).  The next ABC to be held is ABC N (the N-th ABC ever held). Kurohashi wants to make his debut in some ABC x such that all the digits of x in base ten are the same.  What is the earliest ABC where Kurohashi can make his debut?

Submission attempts (in order):
n=input()
if n[0]>n[1] or (n[0]=n[1] and n[1]>=n[2]):
    print(int(n[0])*111
else:
    print(int(n[0])*111+111)

n=input()
if n[0]>n[1] or (n[0]=n[1] and n[1]>=n[2]):
    print(int(n[0])*111)
else:
    print(int(n[0])*111+111)

n=input()
if n[0]>n[1] or (n[0]==n[1] and n[1]>=n[2]):
    print(int(n[0])*111)
else:
    print(int(n[0])*111+111)

Verdicts: Runtime Error

Runtime Error

Accepted
Problem: Kurohashi has never participated in AtCoder Beginner Contest (ABC).  The next ABC to be held is ABC N (the N-th ABC ever held). Kurohashi wants to make his debut in some ABC x such that all the digits of x in base ten are the same.  What is the earliest ABC where Kurohashi can make his debut?

Submission attempts (in order):
a = input()
b = list(a)
k = int(''.join([b[0] for _ in range(len(b))]))
if k > int(a):
    print(k)
else:
    if b[0] != '9':
        print(int(''.join([str(int(b[0]) + 1) for _ in range(len(b))])))
    else:
        print(int(''.join(['1' for _ in range(len(b)+1)])))

a = input()
b = list(a)
k = int(''.join([b[0] for _ in range(len(b))]))
if k >= int(a):
    print(k)
else:
    if b[0] != '9':
        print(int(''.join([str(int(b[0]) + 1) for _ in range(len(b))])))
    else:
        print(int(''.join(['1' for _ in range(len(b)+1)])))

Verdicts: Wrong Answer

Accepted
Problem: Kurohashi has never participated in AtCoder Beginner Contest (ABC).  The next ABC to be held is ABC N (the N-th ABC ever held). Kurohashi wants to make his debut in some ABC x such that all the digits of x in base ten are the same.  What is the earliest ABC where Kurohashi can make his debut?

Submission attempts (in order):
n = input()

if int(n[0]) <= int(n[1]):
    if int(n[0]) == int(n[1]) and int(n[0]) > int(n[2]):
        temp=int(n[0])
        print(temp*100+temp*10+temp)
    else:
        temp=int(n[0])+1
        print(temp*100+temp*10+temp)
else:
    temp=int(n[0])
    print(temp*100+temp*10+temp)

n = input()

if int(n[0]) <= int(n[1]):
    if int(n[0]) == int(n[1]) and int(n[0]) >= int(n[2]):
        temp=int(n[0])
        print(temp*100+temp*10+temp)
    else:
        temp=int(n[0])+1
        print(temp*100+temp*10+temp)
else:
    temp=int(n[0])
    print(temp*100+temp*10+temp)

Verdicts: Wrong Answer

Accepted
Problem: Kurohashi has never participated in AtCoder Beginner Contest (ABC).  The next ABC to be held is ABC N (the N-th ABC ever held). Kurohashi wants to make his debut in some ABC x such that all the digits of x in base ten are the same.  What is the earliest ABC where Kurohashi can make his debut?

Submission attempts (in order):
n=int(input())
a=n%100
if a==9:
    print(999)
else:
    ans=100*a+10*a+a
    if ans>=n:
        print(ans)
    else:
        print(ans+111)

n=int(input())
a=(n-n%100)//100
if a==9:
    print(999)
else:
    ans=100*a+10*a+a
    if ans>=n:
        print(ans)
    else:
        print(ans+111)


Verdicts: Wrong Answer

Accepted
Problem: Kurohashi has never participated in AtCoder Beginner Contest (ABC).  The next ABC to be held is ABC N (the N-th ABC ever held). Kurohashi wants to make his debut in some ABC x such that all the digits of x in base ten are the same.  What is the earliest ABC where Kurohashi can make his debut?

Submission attempts (in order):
print(111*(int(input())//111+1))

for i in range(int(input()),1000):
  if i%111==0:print(i);exit()

Verdicts: Wrong Answer

Accepted
Problem: Kurohashi has never participated in AtCoder Beginner Contest (ABC).  The next ABC to be held is ABC N (the N-th ABC ever held). Kurohashi wants to make his debut in some ABC x such that all the digits of x in base ten are the same.  What is the earliest ABC where Kurohashi can make his debut?

Submission attempts (in order):
n = int(input())
for i in range(10):
    if i * 111 > n:
        print(i * 111)
        break

n = int(input())
for i in range(10):
    if i * 111 >= n:
        print(i * 111)
        break

Verdicts: Wrong Answer

Accepted
Problem: Kurohashi has never participated in AtCoder Beginner Contest (ABC).  The next ABC to be held is ABC N (the N-th ABC ever held). Kurohashi wants to make his debut in some ABC x such that all the digits of x in base ten are the same.  What is the earliest ABC where Kurohashi can make his debut?

Submission attempts (in order):
N = int(input())

if N//111 == 0:
  print(N)
else:
  print((N//111 + 1) * 111)

N = int(input())

if N%111 == 0:
  print(N)
else:
  print((N//111 + 1) * 111)

Verdicts: Wrong Answer

Accepted
Problem: Kurohashi has never participated in AtCoder Beginner Contest (ABC).  The next ABC to be held is ABC N (the N-th ABC ever held). Kurohashi wants to make his debut in some ABC x such that all the digits of x in base ten are the same.  What is the earliest ABC where Kurohashi can make his debut?

Submission attempts (in order):
import sys
import time
import math
def inpl():
    return list(map(int, input().split()))
st = time.perf_counter()
# ------------------------------

N = int(input())
for i in range(N, 1000):
	if N//100==N//10 ans N//10==N%10:
		print(N)
		sys.exit()

# ------------------------------
ed = time.perf_counter()
print('time:', ed-st, file=sys.stderr)


import sys
import time
import math
def inpl():
    return list(map(int, input().split()))
st = time.perf_counter()
# ------------------------------

N = int(input())
for i in range(N, 1000):
	if i//100==(i//10)%10:
		if i//100==i%10:
			print(i)
			sys.exit()

# ------------------------------
ed = time.perf_counter()
print('time:', ed-st, file=sys.stderr)


Verdicts: Runtime Error

Accepted
Problem: Kurohashi has never participated in AtCoder Beginner Contest (ABC).  The next ABC to be held is ABC N (the N-th ABC ever held). Kurohashi wants to make his debut in some ABC x such that all the digits of x in base ten are the same.  What is the earliest ABC where Kurohashi can make his debut?

Submission attempts (in order):
n = int(input())
if n//111 = n/111:
  print(n)
else:
  print(((n//111)+1) * 111)

print(((int(input()) // 111) + 1) * 111)

n = int(input())
if n//111 == n/111:
  print(n)
else:
  print(((n//111)+1) * 111)

Verdicts: Runtime Error

Wrong Answer

Accepted
Problem: Kurohashi has never participated in AtCoder Beginner Contest (ABC).  The next ABC to be held is ABC N (the N-th ABC ever held). Kurohashi wants to make his debut in some ABC x such that all the digits of x in base ten are the same.  What is the earliest ABC where Kurohashi can make his debut?

Submission attempts (in order):
a=int(input())
b=a%100
c=a//100
if b<=c*11:
  print(c*111)
else:
  print()c+1)*111)

a=int(input())
b=a%100
c=a//100
if b<=c*11:
  print(c*111)
else:
  print((c+1)*111)

Verdicts: Runtime Error

Accepted
Problem: Kurohashi has never participated in AtCoder Beginner Contest (ABC).  The next ABC to be held is ABC N (the N-th ABC ever held). Kurohashi wants to make his debut in some ABC x such that all the digits of x in base ten are the same.  What is the earliest ABC where Kurohashi can make his debut?

Submission attempts (in order):
print((int(input())//111+1)*111)

print(((int(input())-1)//111+1)*111)

Verdicts: Wrong Answer

Accepted
Problem: Kurohashi has never participated in AtCoder Beginner Contest (ABC).  The next ABC to be held is ABC N (the N-th ABC ever held). Kurohashi wants to make his debut in some ABC x such that all the digits of x in base ten are the same.  What is the earliest ABC where Kurohashi can make his debut?

Submission attempts (in order):
def piyo():
    n = int(input())
    hoge = n//100
    if int(str(hoge)+str(hoge))>n%100:
        a = int(str(hoge)+str(hoge)+str(hoge))
    else:
        hoge+=1
        a = int(str(hoge)+str(hoge)+str(hoge))
    print(a)

if __name__ == '__main__':
    piyo()

def piyo():
    n = int(input())
    hoge = n//100
    if int(str(hoge)+str(hoge))>=n%100:
        a = int(str(hoge)+str(hoge)+str(hoge))
    else:
        hoge+=1
        a = int(str(hoge)+str(hoge)+str(hoge))
    print(a)

if __name__ == '__main__':
    piyo()

Verdicts: Wrong Answer

Accepted
Problem: Kurohashi has never participated in AtCoder Beginner Contest (ABC).  The next ABC to be held is ABC N (the N-th ABC ever held). Kurohashi wants to make his debut in some ABC x such that all the digits of x in base ten are the same.  What is the earliest ABC where Kurohashi can make his debut?

Submission attempts (in order):
N=input()



if N[2]>=N[0]:
    B=int(N[0])+1
    C=str(B)
    A=str(C+C+C)

else:
    A=str(N[0]+N[0]+N[0])


    
print(A)

N=input()

if N[2]==N[1]==N[0]:
    A=N

elif N[2]>N[0] or N[1]>N[0]:
    B=int(N[0])+1
    C=str(B)
    A=str(C+C+C)


else:
    A=str(N[0]+N[0]+N[0])


    
print(A)

Verdicts: Wrong Answer

Accepted
Problem: Kurohashi has never participated in AtCoder Beginner Contest (ABC).  The next ABC to be held is ABC N (the N-th ABC ever held). Kurohashi wants to make his debut in some ABC x such that all the digits of x in base ten are the same.  What is the earliest ABC where Kurohashi can make his debut?

Submission attempts (in order):
n = int(input())
for i in range(n,1000):
  if i[0]==i[1]==i[2]:
    return i
print(i)
  

n = int(input())
for i in range(n,1000):
  I = str(i)
  if I[0]==I[1]==I[2]:
    print(i)
    break

Verdicts: Runtime Error

Accepted
Problem: Kurohashi has never participated in AtCoder Beginner Contest (ABC).  The next ABC to be held is ABC N (the N-th ABC ever held). Kurohashi wants to make his debut in some ABC x such that all the digits of x in base ten are the same.  What is the earliest ABC where Kurohashi can make his debut?

Submission attempts (in order):
N=int(input())
a=N//100
b=(N-a*100)//10
c=N-a*100-b*10
if a<b:
    N=(a+1)*111
elif a>b:
    N=a*111
elif a=b and a>=c:
    N=a*111
elif :
    N=(a+1)*111
print(N)
    

N=int(input())
a=N//100
b=(N-a*100)//10
c=N-a*100-b*10
if a<b:
    N=(a+1)*111
elif a>b:
    N=a*111
elif a==b and a>=c :
    N=a*111
elif a==b and a<c :
    N=(a+1)*111
print(N)

Verdicts: Runtime Error

Accepted
Problem: Kurohashi has never participated in AtCoder Beginner Contest (ABC).  The next ABC to be held is ABC N (the N-th ABC ever held). Kurohashi wants to make his debut in some ABC x such that all the digits of x in base ten are the same.  What is the earliest ABC where Kurohashi can make his debut?

Submission attempts (in order):
n = int(input)

if n>888:
  print(999)
elif n>777:
  print(888)
elif n>666:
  print(777)
elif n>555:
  print(666)
elif n>444:
  print(555)
elif n>333:
  print(444)
elif n>222:
  print(333)
elif n>111:
  print(222)
else:
  print(111)

  


n = int(input())
 
if n>888:
  print(999)
elif n>777:
  print(888)
elif n>666:
  print(777)
elif n>555:
  print(666)
elif n>444:
  print(555)
elif n>333:
  print(444)
elif n>222:
  print(333)
elif n>111:
  print(222)
else:
  print(111)

Verdicts: Runtime Error

Accepted
Problem: Kurohashi has never participated in AtCoder Beginner Contest (ABC).  The next ABC to be held is ABC N (the N-th ABC ever held). Kurohashi wants to make his debut in some ABC x such that all the digits of x in base ten are the same.  What is the earliest ABC where Kurohashi can make his debut?

Submission attempts (in order):
N =int(input())
for i in range(1,10):
  if 111*i > N:
    print(111*i)
    break

N = input()
a =len(N)
for i in range(1,10):
    s =int("1"*a)
    if s*i >= int(N):
        print(s*i)
        break

Verdicts: Wrong Answer

Accepted
Problem: Kurohashi has never participated in AtCoder Beginner Contest (ABC).  The next ABC to be held is ABC N (the N-th ABC ever held). Kurohashi wants to make his debut in some ABC x such that all the digits of x in base ten are the same.  What is the earliest ABC where Kurohashi can make his debut?

Submission attempts (in order):
n = int(input())
for i in range(10):
    if 100*i + 10*i + i => n:
        print(100*i + 10*i + i)

n = int(input())
for i in range(1, 10):
    if 100*i + 10*i + i => n:
        print(100*i + 10*i + i)

n = int(input())
for i in range(1, 10):
    if (100*i + 10*i + i ) >= n:
        print(100*i + 10*i + i)
        exit()

Verdicts: Runtime Error

Runtime Error

Accepted
Problem: Kurohashi has never participated in AtCoder Beginner Contest (ABC).  The next ABC to be held is ABC N (the N-th ABC ever held). Kurohashi wants to make his debut in some ABC x such that all the digits of x in base ten are the same.  What is the earliest ABC where Kurohashi can make his debut?

Submission attempts (in order):
N = int(input())
a = N//111
print((a+1)*111)

N = int(input())
a = N//111
if(N%111==0):
    print(N)
else:
    print((a+1)*111)

Verdicts: Wrong Answer

Accepted
Problem: Kurohashi has never participated in AtCoder Beginner Contest (ABC).  The next ABC to be held is ABC N (the N-th ABC ever held). Kurohashi wants to make his debut in some ABC x such that all the digits of x in base ten are the same.  What is the earliest ABC where Kurohashi can make his debut?

Submission attempts (in order):
N = list(input())
s = N[0]
n = int(''.join(N))

if int(N[0]*3) > n:
    print(N[0]*3)
else:
    print(str(int(N[0])+1)*3)

N = list(input())
s = N[0]
n = int(''.join(N))

if int(N[0]*3) >= n:
    print(N[0]*3)
else:
    print(str(int(N[0])+1)*3)

Verdicts: Wrong Answer

Accepted
Problem: Kurohashi has never participated in AtCoder Beginner Contest (ABC).  The next ABC to be held is ABC N (the N-th ABC ever held). Kurohashi wants to make his debut in some ABC x such that all the digits of x in base ten are the same.  What is the earliest ABC where Kurohashi can make his debut?

Submission attempts (in order):
import sys


stdin = sys.stdin
def ns(): return stdin.readline().rstrip()
def ni(): return int(stdin.readline().rstrip())
def nm(): return map(int, stdin.readline().split())
def nl(): return list(map(int, stdin.readline().split()))


def main():
    n = ni()
    dif = 999
    ans = ''
    for i in range(1, 10):
        tmp = str(i) * 3
        if dif > int(tmp) - n > 0:
            dif = abs(n - int(tmp))
            ans = tmp
    print(ans)


if __name__ == '__main__':
    main()


import sys


stdin = sys.stdin
def ns(): return stdin.readline().rstrip()
def ni(): return int(stdin.readline().rstrip())
def nm(): return map(int, stdin.readline().split())
def nl(): return list(map(int, stdin.readline().split()))


def main():
    n = ni()
    dif = 999
    ans = ''
    for i in range(1, 10):
        tmp = str(i) * 3
        if dif > int(tmp) - n >= 0:
            dif = abs(n - int(tmp))
            ans = tmp
    print(ans)


if __name__ == '__main__':
    main()


Verdicts: Wrong Answer

Accepted
Problem: Kurohashi has never participated in AtCoder Beginner Contest (ABC).  The next ABC to be held is ABC N (the N-th ABC ever held). Kurohashi wants to make his debut in some ABC x such that all the digits of x in base ten are the same.  What is the earliest ABC where Kurohashi can make his debut?

Submission attempts (in order):
N = int(input())
x = N - N % 111 + 111
print(x)

N = int(input())
if N%111 == 0:
    print(N)
else:
    x = N - N % 111 + 111
    print(x)

Verdicts: Wrong Answer

Accepted
Problem: Kurohashi has never participated in AtCoder Beginner Contest (ABC).  The next ABC to be held is ABC N (the N-th ABC ever held). Kurohashi wants to make his debut in some ABC x such that all the digits of x in base ten are the same.  What is the earliest ABC where Kurohashi can make his debut?

Submission attempts (in order):
r = input()
n = list(r)
x = int(n[0])*100 + int(n[0])*10 + int(n[0])

if x <= int(r):
  print( ((int(n[0])+1)*100 + (int(n[0])+1)*10 + int(n[0])+1))
else:
  print(x)

r = input()
n = list(r)
x = int(n[0])*100 + int(n[0])*10 + int(n[0])

if x < int(r):
  print( ((int(n[0])+1)*100 + (int(n[0])+1)*10 + int(n[0])+1))
else:
  print(x)


Verdicts: Wrong Answer

Accepted