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())
repdigit = [111, 222, 333, 444, 555, 666, 777, 888, 999]

for rep in repdigit:
    if N < rep:
        print(rep)
        break

N = int(input())
repdigit = [111, 222, 333, 444, 555, 666, 777, 888, 999]

for rep in repdigit:
    if N < rep:
        print(rep)
        break

N = int(input())
repdigit = [111, 222, 333, 444, 555, 666, 777, 888, 999]

for rep in repdigit:
    if N <= rep:
        print(rep)
        break

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):
num=input()
num_list=list(num)
n=len(num)
ans_num=0
element=num_list[0]
while True:
    tf=True
    for i in range(n):
        if element<num_list[i]:
            tf=False
            element+=1
            break
    if tf:
        ans_num=element
        break
print(ans_num*element)

num=input()
num_list=list(num)
n=len(num)
ans_num=0
element=int(num_list[0])
for i in range(n):
    if element<int(num_list[i]):
        tf=False
        element+=1
        break
print(str(element)*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())
for m in range(0,11):
 if -1+111*m<=n<=110+111*m:
  print(111*m+111)

n=int(input())
for m in range(0,11):
 if 1+111*m<=n<=111+111*m:
  print(111*m+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()/111)*111)

print(-(-int(input())//111)*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())
if(100<N<=111):
  ptit(111)
elif(111<N<=222):
  print(222)
elif(222<N<=333):
  print(333)
elif(333<N<=444):
  print(444)
elif(444<N<=555):
  print(555)
elif(555<N<=666):
  print(666)
elif(666<N<=777):
  print(777)
elif(777<N<=888):
  print(888)
elif(888<N<=999):
  print(999)

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


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%111
if a==0:
   print(a)
else:
   print(((a//111)+1)*111)

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

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

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

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

Verdicts: Wrong Answer

Runtime Error

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())
for i in range(1,8):
    tmp = 111*i
    if N < tmp:
        print(tmp)
        exit()

N = int(input())
for i in range(1,10):
    tmp = 111*i
    if N <= tmp:
        print(tmp)
        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())
ans == 0
for i in range(1,10):
    count = 100*i + 10*i + i
    if n <= count:
        ans = count
    else: break

n = int(input())
ans = 0
for i in range(1,10):
    count = 100*i + 10*i + i
    if n <= count:
        ans = count
        break
print(ans)

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())
ns=N//100*100+N//100*10+N//100
print("N = ",N,"".join([str(N//100+int(N>ns))]*3))



N=int(input())
ns=N//100*100+N//100*10+N//100
print("".join([str(N//100+int(N>ns))]*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=input()
if int(n[0])<int(n[1]) | (int(n[0])==int(n[1]) & int(n[0])<int(n[2])):
  print((int(n[0])+1)*3)
else:
  print(int(n[0])*3)

n=int(input())
if n//100<(n%100)//10 or (n//100==(n%100)//10 and n//100<(n%10)):
  print(((n//100)+1)*111)
else:
  print((n//100)*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=input()
ans=""
an=""

for i in n:
    ans+=n[0]
    
if int(ans)>int(n):
    print(ans)
else:
    for i in n:
        an+=str(int(n[0])+1)
    print(an)


n=input()
ans=""
an=""

for i in n:
    ans+=n[0]
    
if int(ans)>=int(n):
    print(ans)
else:
    for i in n:
        an+=str(int(n[0])+1)
    print(an)

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())
l = list(range(111,1000,111))

print(l[n // 111])

n = int(input())
for i in range(n,1000):
    x = list(str(i))
    if len(set(x)) == 1:
        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 = input()

lst = [111,222,333,444,555,666,777,888,999]

for i in lst:
    if n <= i:
        print(i)
        break


kaisai_lst = [111,222,333,444,555,666,777,888,999]
N = int(input())
for target_list in kaisai_lst:
    if N <= target_list:
        print(target_list)
        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())

k = int(n/111)

u = 111*(k+1)

print(u)

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

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(str(i)[1] == str(i)[2] and str(i)[1] == str(i)[3]):
    num = i
    break
print(num)

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

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())
length=len(str(n))

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


n=int(input())
length=len(str(n))

if int(str(n)[0])> int(str(n)[-1]) and int(str(n)[0])>= int(str(n)[1]):
  print((str(n)[0])*length)
else:
  print(str((int(str(n)[0]))+1)*length)


n=int(input())
length=len(str(n))

if int(str(n)[0])>= int(str(n)[-1]) and int(str(n)[0])>= int(str(n)[1]):
  print((str(n)[0])*length)
else:
  print(str((int(str(n)[0]))+1)*length)


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())

n = N
for i in range(1000):
    n += 1
    if str(n)[0] == str(n)[1] == str(n)[2]:
        ans = n
        break
print(n)

n = int(input())
answer = 0
while answer < n:
    answer += 111
print(answer)

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 = str(input())
if n == "999":
    print(1111)
    exit(0)
minim = 1000
x = int(n)
for i in range(1, 10):
    nr = i*100 + i*10 + i
    if x < int(nr) < minim:
        minim = int(nr)
print(minim)


n = str(input())
minim = 1000
x = int(n)
for i in n:
    nr = i*3
    if x < int(nr) < minim:
        minim = int(nr)
print(minim)


n = str(input())
if n == "999":
    print(1111)
    exit(0)
minim = 1000
x = int(n)
for i in n:
    nr = i*3
    if x < int(nr) < minim:
        minim = int(nr)
print(minim)


n = str(input())
minim = 1000
x = int(n)
for i in range(1, 10):
    nr = i*100 + i*10 + i
    if x <= int(nr) < minim:
        minim = int(nr)
print(minim)


Verdicts: Wrong Answer

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())

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)

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)
else:
  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: Runtime Error

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 = input()
a = ['111','222','333','444','555','666','777','888','999']

for i in a:
	if i >= n:
    	print(i)
        break

n = input()
a = ['111','222','333','444','555','666','777','888','999']
 
for i in a:
    if i >= n:
        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):
y = int(input())
for i in range(1, 10):
  x = i + i * 10 + i * 100
  if x >= y:
    print(x)
  	break
    

y = int(input())
for i in range(1, 10):
  x = i + i * 10 + i * 100
  if x >= y:
    print(x)
    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())
for i in range(n, 1000):
  if i % 111 = 0:
    print(i)
    exit()


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

n = int(input())
for i in range(n, 1000):
  if i % 111 == 0:
    print(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):
print((int(input())//111+1)*111)

print((int(input())+110)//111*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):
input_line = input()
n = int(input_line / 111)
print(111 + n * 111)

input_line = input()
n = int(input_line) / 111
print(111 + int(n) *111)

input_line = input()
n = int(input_line)
print(111 + n*111)

input_line = input()
n = int(input_line / 111)
print(n*111)

input_line = input()
n = int(input_line) / 111
print(111 + int(111 * n))

str = input()
n = str / 111

print(n*111)

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

Verdicts: Runtime Error

Wrong Answer

Wrong Answer

Runtime Error

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):
n = int(input())
if n%111 = 0:
  print(n)
else:
  print((n//111+1)*111)

n = int(input())
print(n) if n%111 == 0 else print((n//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(input())
a = n//100
if n< a*111:
  print(a*111)
else:
  print((a+1)*111)

n = int(input())
a = n//100
b = a*100 + a*10 +a

if n<=b:
  print(b)
else:
  print((a+1)*100 + (a+1)*10 + (a+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]*3)>int(N):
  print(int(N[0]*3))
else:
  print(int(str(int(N[0])+1)*3))

N=input()
if int(N[0]*3)>=int(N):
  print(int(N[0]*3))
else:
  print(int(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):
from sys import stdin
N=int(stdin.readline().rstrip())
ans=0
tmp=1000
for i in range(1,10):
    for j in range(3,5):
        num=int(str(i)*j)
        if N-num >= 0 and tmp < N-num:
            tmp = N-num
            ans=num
print(ans)

from sys import stdin
N=int(stdin.readline().rstrip())
ans=0
tmp=1000
for i in range(1,10):
    for j in range(3,5):
        num=int(str(i)*j)
        if num-N > 0 and tmp > num-N:
            tmp = num-N
            ans=num
print(ans)

from sys import stdin
N=int(stdin.readline().rstrip())
ans=0
tmp=1000
for i in range(1,10):
    for j in range(3,5):
        num=int(str(i)*j)
        if num-N >= 0 and tmp > num-N:
            tmp = num-N
            ans=num
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):
n=int(input())

a=n//100
b=(n-a*100)//10
c=n-a-b

if a==b:
    if a<c:
        print((a+1)*100+(a+1)*10+a+1)
    elif c<a:
        print(a*100+a*10+a)
    else:
        print(n)
elif a<b:
    print((a+1)*100+(a+1)*10+a+1)
elif a>b:
    print(a*100+a*10+a)


n=int(input())

a=n//100
b=(n-a*100)//10
c=n-a*100-b*10

if a==b:
    if a<c:
        print((a+1)*100+(a+1)*10+a+1)
    elif c<a:
        print(a*100+a*10+a)
    elif a==c:
        print(n)
elif a<b:
    print((a+1)*100+(a+1)*10+a+1)
elif a>b:
    print(a*100+a*10+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):
nx = input('n?\n')
n=int(nx)
x=111
for i in range (111,n,111):
    x+=111
print(x)


nx = input()
n=int(nx)
x=111
for i in range (111,n,111):
    x+=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):
X = int(input)

if 100 <= X <= 111:
  n = 111
elif X <= 222:
  n = 222
elif X <= 333:
  n = 333
elif X <= 444:
  n = 444
elif X <= 555:
  n = 555
elif X <= 666:
  n = 666
elif X <= 777:
  n = 777
elif X <= 888:
  n = 888
elif X <= 999:
  n = 999
else:
  print("error")

print(n)

X = int(input())

if 100 <= X <= 111:
  n = 111
elif X <= 222:
  n = 222
elif X <= 333:
  n = 333
elif X <= 444:
  n = 444
elif X <= 555:
  n = 555
elif X <= 666:
  n = 666
elif X <= 777:
  n = 777
elif X <= 888:
  n = 888
elif X <= 999:
  n = 999
else:
  print("error")

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 = input()
print(N[2])
if N[0]>N[1]:
    print(int(N[0]*3))

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

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

N = input()
if N[0]>N[1]:
    print(int(N[0]*3))

elif N[0] == N[1]:
    if N[1] == N[2]:
        print(int(N[0] * 3))
    elif N[1]>N[2]:
        print(int(N[0] * 3))
    else:
        print(str(int(N[0]) + 1) * 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):
n=int(input())
if n[0]=<n[1] or (n[0]==n[1] and n[0]=<n[2]):
  print(str(n[0]+1)*3)
else:
  print(str(n[0])*3)

n=list(map(int,input()))
if n[0]<n[1] or (n[0]==n[1] and n[0]<n[2]):
  print(str(n[0]+1)*3)
else:
  print(str(n[0])*3)


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):
a = input()
b = list(a)
c = b[0] + b[0] + b[0]

if int(a) >= int(c):
  print(int(c)+111)
else:
  print(int(c))

a = input()
b = list(a)
c = b[0] + b[0] + b[0]

if int(a) > int(c):
  print(int(c)+111)
else:
  print(int(c))

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 math

n = int(input())
print(math.ceil(n / 111))


import math

n = int(input())
print(math.ceil(n / 111) * 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 = input()
print(n[0]*3) if int(n) < int(n[0]*3) else print(str(int(n[0])+1)*3)

n = input()
print(n[0]*3) if int(n) <= int(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):
num = str(input())
a = []
x=[]
for i in str(num):
    a.append(i)
if a[1] < a[0] and a[2] < a[0]:
    x.append(a[0])
    x.append(a[0])
    x.append(a[0])
    print(''.join(str(i) for i in x))
else:
    z = int (a[0]) +1
    x.append(z)
    x.append(z)
    x.append(z)
    print(''.join(str(i) for i in x))


num = str(input())
a = []
x=[]
for i in str(num):
    a.append(i)
if a[1] < a[0] and a[2] < a[0]:
    x.append(a[0])
    x.append(a[0])
    x.append(a[0])
    print(''.join(str(i) for i in x))
else:
    z = int (a[0]) +1
    x.append(z)
    x.append(z)
    x.append(z)
    print(''.join(str(i) for i in x))


num = str(input())
a = []
x=[]
for i in str(num):
    a.append(i)
if a[1] <= a[0] and a[2] < a[0]:
    x.append(a[0])
    x.append(a[0])
    x.append(a[0])
    print(''.join(str(i) for i in x))
elif a[1] < a[0]:
    x.append(a[0])
    x.append(a[0])
    x.append(a[0])
    print(''.join(str(i) for i in x))
elif a[0] == a[1] == a[2]:
    x.append(a[0])
    x.append(a[0])
    x.append(a[0])
    print(''.join(str(i) for i in x))
else:
    z = int (a[0]) +1
    x.append(z)
    x.append(z)
    x.append(z)
    print(''.join(str(i) for i in x))


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=input()
zoro=int(N[0])*100+int(N[0])*10+int(N[0])
zoro_up=(int(N[0])+1)*100+(int(N[0])+1)*10+(int(N[0])+1)
if int(N)<zoro:
    print(zoro)
else:
    print(zoro_up)

N=input()
zoro=int(N[0])*100+int(N[0])*10+int(N[0])
zoro_up=(int(N[0])+1)*100+(int(N[0])+1)*10+(int(N[0])+1)
if int(N)<=zoro:
    print(zoro)
else:
    print(zoro_up)

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 - (n % 111)
print(n+a)


n = int(input())


if (n % 111) == 0:
    print(n)

else:
    a = 111 - (n % 111)
    print(n+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())
while n%111==0:
    n = n+1
print(n)

n=int(input())
while n%111!=0:
    n = n+1
print(n)

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())//111+1)*111)

n=int(input())
print(n if n%111==0 else (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):
n = int(input())

a = n//111
if a%111 > 0:
  print(111*(a+1))
else:
  print(a*111)

n = int(input())

a = n//111
if n%111 == 0:
  print(111*a)
else:
  print(111*a +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 = int(input())

print(n//111 + 1)

n = int(input())

print((n//111 + 1)*111)

n = int(input())

print(((n-1)//111 + 1)*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((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 isCorrect(n):
    l = [int(x) for x in list(str(n))]
    prev = l.pop(0)

    for num in l:
        if num != prev:
            return False
        prev = num
    return True

if __name__ == '__main__':
    n = int(input())

    for m in range(n+1, 100000):
        if isCorrect(m):
            print(m)
            break



def isCorrect(n):
    l = [int(x) for x in list(str(n))]
    prev = l.pop(0)

    for num in l:
        if num != prev:
            return False
        prev = num
    return True

if __name__ == '__main__':
    n = int(input())

    for m in range(n, 100000):
        if isCorrect(m):
            print(m)
            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(int(n/111)*111)
else:
	print(int((n/111+1))*111)

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

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

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

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

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

Verdicts: Wrong Answer

Wrong Answer

Wrong Answer

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):
#coding:utf-8

n=int(input())
print(n+(111-((n%111))%111))

#coding:utf-8

n=int(input())
print(n+(111-(n%111))%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 = input()
l = [int(x) for x in list(str(n))]
ans = []
print(l)
if (l[0] < l[1]) or (l[0] < l[2]):
	num = l[0] + 1
else:
	num = l[0]
for i in range(3):
	ans.append(num)
ansn = ans[0] * 100 + ans[1] * 10 + ans[2]
print(ansn)

n = input()
l = [int(x) for x in list(str(n))]
ans = []
if (l[0] < l[1]) or (l[0] < l[2]):
	num = l[0] + 1
else:
	num = l[0]
for i in range(3):
	ans.append(num)
ansn = ans[0] * 100 + ans[1] * 10 + ans[2]
print(ansn)

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//111)+1) * 111)

N = int(input())



for i in range(N, 1000, 1):
    char = str(i)
    if char[0]==char[1]==char[2]:
        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=int(input())
N_str = []
for i in range(N,999):
    N+=1
    N_new = N
    while N>0:
        N_str.append(N%10)
        N//=10
    N_str.reverse()
    
    N = N_new
          
    if N_str[0]==N_str[1] and N_str[1]==N_str[2]:
        print(N)
        break



N=int(input())
N_str = []
for i in range(N,1000):
    N_new = N
    while N>0:
        N_str.append(N%10)
        N//=10
    N_str.reverse()
    
    N = N_new
          
    if N_str[0]==N_str[1] and N_str[1]==N_str[2]:
        print(N)
        break
    N+=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())
#n = input()
suitable = [111,222,333,444,555,666,777,888,999]
for s in suitable:
    if n < s:
        print(s)
        break

n = int(input())
#n = input()
suitable = [111,222,333,444,555,666,777,888,999]
for s in suitable:
    if n <= s:
        print(s)
        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())

ans_list = [100*x+10*x+x for x in range(10)]

for v in ans_list:
    if v > n:
        ans = v
        break
        
print(ans)

n = int(input())

ans_list = [100*x+10*x+x for x in range(10)]

for v in ans_list:
    if v >= n:
        ans = v
        break
        
print(ans)

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):
number = int(input())
i = int(number / 111)
if number % 111 != 0:
  i += 1
 print(i * 111)

  
  

n = int(input())
i = int(n / 111)
if n % 111 != 0:
    i += 1
print(i * 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(10):
    if (i*100+i*10+i) < n < ((i+1)*100+(i+1)*10+(i+1)):
        print((i+1)*100+(i+1)*10+(i+1))

n = int(input())
for i in range(10):
    if (i*100+i*10+i) < n <= ((i+1)*100+(i+1)*10+(i+1)):
        print((i+1)*100+(i+1)*10+(i+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):
k=int(input())
l=[]
p=[]
for i in range(1,10):
  l.append(111*i)
for i in l:
  if i-k>=0:
    p.aapend(i)
print(min(p))  
  
  

k=int(input())
l=[]
p=[]
for i in range(1,10):
  l.append(111*i)
for i in l:
  if i-k>=0:
    p.append(i)
print(min(p))  

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())

list = [int(c)+10*int(c)+100*int(c) for c in str(N)]
list.sort()

x = 0
for i in range(N):
    if list[i] < N:
        continue
    else:
        x = list[i]
print(x)

N = int(input())
 
for n in [111*c for c in range(1,10)]:
    if n < N:
        continue
    else:
        print(n)
        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())
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):
N = input()

if int(N) < int(N[0] * 3):
    print(int(N[0] * 3))
else:
    print(int((N[0] + 1) * 3))

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

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):
s = int(input())
for i in range(1,10):
    if s < int(str(i)*3):
        print(int(str(i)*3))
        exit()

s = int(input())
for i in range(1,10):
    if s <= int(str(i)*3):
        print(int(str(i)*3))
        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())

print((n // 111 + 1) * 111)

n = int(input())

print(((n-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):
N = list(input())
print(N)
if N[0] >= N[1] and N[1] >= N[2]:
    print(int(N[0]*3))
else:
    print(int(N[0]*3)+111)

N = int(input())
if N%111 ==0:
    print(N)
else:
    x = N//111
    print((x+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 = int(input())
for i in range(9,0,-1):
    if N//int(str(i)*3)>=1:
        print(str(i+1)*3)
        break


N = int(input())
count=0
for i in range(1,10):
    if (N-1)//int(str(i)*3)>=1:
        count=i
print(str(count+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):
i = int(input())

while True:
    if set(str(i)) == 1:
        print(i)
        break
    i += 1

i = int(input())

while True:
    if len(set(str(i))) == 1:
        print(i)
        break
    i += 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):
n = int(input())
ans = 0
for i in range(1,10):
    if 111*i>n:
        ans = 111*i
        break
print(ans)    

n = int(input())
ans = 0
for i in range(1,10):
    if 111*i>=n:
        ans = 111*i
        break
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())

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

n = int(input())

if n % 111 == 0:
  print(n)
else:
  print(int((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):
n = int(input())
for i in range(900):
    x = list(n)
    if x[0]==x[1]==x[2]:
        print(n)
        break 
    n+=1


n = input()
if n[0] == n[1] == n[2]:
    ans = n
elif n[1] > n[0] or (n[1] == n[0] and n[2] > n[0]):
    ans = str(int(n[0])+1)*3
elif n[1] <= n[0] or n[2] < n[0]:
    ans = n[0]*3
print(ans)

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 N < i + i*10 + i*100:
        print(i + i*10 + i*100)
        break

N = int(input())

for i in range(1, 10):
    if N <= i + i*10 + i*100:
        print(i + i*10 + i*100)
        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())
print(min([x for x in [int(str(i) * 3) - N for i in range(1, 10)] if x > 0]) + N)


N = int(input())
print(min([x for x in [int(x * 3) for x in list(str(N))] if x - N > 0], key=lambda x: x - N))


N = int(input())
print(min([x for x in [int(str(i) * 3) - N for i in range(1, 10)] if x >= 0]) + N)


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())
ret = n // 111 + 1
print(ret * 111)

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

n = int(input())
ret = (n-1) // 111 + 1
print(ret * 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):
N = input()
x = N[0]
xxx = int(3*x)
if N <= XXX:
  print(xxx)
else:
  x = int(x)+1
  print(100*x + 10*x + x)

N = input()
x = N[0]
xxx = int(3*x)
if int(N) <= xxx:
  print(xxx)
else:
  x = int(x)+1
  print(100*x + 10*x + 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):
p_100 = n // 100
tmp = n % 100
p_10 = tmp // 10
p_1 = tmp % 10
if p_100 == p_10:
    if p_10 == p_1:
        print(str(p_1) * 3)
    elif p_10 <= p_1:
        print(str(p_10+1) * 3)
    elif p_10 >= p_1:
        print(str(p_10) * 3)
elif p_100 <= p_10:
    print(str(p_100+1) * 3)
elif p_100 >= p_10:
    print(str(p_100) * 3)

n =int(input())
p_100 = n // 100
tmp = n % 100
p_10 = tmp // 10
p_1 = tmp % 10
if p_100 == p_10:
    if p_10 == p_1:
        print(str(p_1) * 3)
    elif p_10 <= p_1:
        print(str(p_10+1) * 3)
    elif p_10 >= p_1:
        print(str(p_10) * 3)
elif p_100 <= p_10:
    print(str(p_100+1) * 3)
elif p_100 >= p_10:
    print(str(p_100) * 3)

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(111, 1000, 111):
    if i > n:
        print(i)
        exit(0)


n = int(input())

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


Verdicts: Wrong Answer

Accepted