TnT/Multi_CodeNet4Repair huggingface dataset:
Problem: Decades have passed since the beginning of AtCoder Beginner Contest.  The contests are labeled as `ABC001`, `ABC002`, ... from the first round, but after the 999-th round `ABC999`, a problem occurred: how the future rounds should be labeled?  In the end, the labels for the rounds from the 1000-th to the 1998-th are decided: `ABD001`, `ABD002`, ..., `ABD999`.  You are given an integer N between 1 and 1998 (inclusive). Print the first three characters of the label of the N-th round of AtCoder Beginner Contest.

Submission attempts (in order):
n=int(input())
if n<=999:
  print("ABC{}".format(n))
else:
  print("ABD{}".format(n-999))

print("ABC{}".format(int(input())%999))

n=int(input())
if n<=999:
  print("ABC")
else:
  print("ABD")


Verdicts: Wrong Answer

Wrong Answer

Accepted
Problem: Decades have passed since the beginning of AtCoder Beginner Contest.  The contests are labeled as `ABC001`, `ABC002`, ... from the first round, but after the 999-th round `ABC999`, a problem occurred: how the future rounds should be labeled?  In the end, the labels for the rounds from the 1000-th to the 1998-th are decided: `ABD001`, `ABD002`, ..., `ABD999`.  You are given an integer N between 1 and 1998 (inclusive). Print the first three characters of the label of the N-th round of AtCoder Beginner Contest.

Submission attempts (in order):
n = input()
if n >= 1000:
    print("ABD")
else:
    print("ABC")

n = int(input())
if n >= 1000:
    print("ABD")
else:
    print("ABC")


Verdicts: Runtime Error

Accepted
Problem: Decades have passed since the beginning of AtCoder Beginner Contest.  The contests are labeled as `ABC001`, `ABC002`, ... from the first round, but after the 999-th round `ABC999`, a problem occurred: how the future rounds should be labeled?  In the end, the labels for the rounds from the 1000-th to the 1998-th are decided: `ABD001`, `ABD002`, ..., `ABD999`.  You are given an integer N between 1 and 1998 (inclusive). Print the first three characters of the label of the N-th round of AtCoder Beginner Contest.

Submission attempts (in order):
#def poll_height(n):
#    if n:
#        return n + poll_height(n - 1)
#    else:
#        return 1 

def poll_height(n):
    rtn = 0 
    for i in range(n + 1): 
        rtn += i
    return rtn 

a, b = map(int, input().split())

difference_a_b = b - a 
print(poll_height(difference_a_b) - b)

import sys
sys.setrecursionlimit(10000)

def poll_height(n):
    if n:
        return n + poll_height(n - 1)
    else:
        return 1

a, b = map(int, input().split())

difference_a_b = b - a
print(poll_height(difference_a_b) - b)

a, b = map(int, input().split())

difference = b - a
rtn = sum(range(1, difference + 1))
print(rtn - b)

a, b = map(int, input().split())

difference_a_b = b - a
rtn = 0
for i in range(difference_a_b):
    rtn += i+1
print(rtn - b)

def poll_height(n):
    rtn = 0 
    for i in range(n + 1): 
        rtn += i
    return rtn 

a, b = map(int, input().split())

difference_a_b = b - a 
print(poll_height(difference_a_b) - b)

# -*- coding: utf-8 -*-
def margin0(n):
    if n < 10:
        return "00{}".format(n)
    elif n < 100:
        return "0{}".format(n)
    elif n < 1000:
        return "".format(n%1000)
    else:
        return "{}".format(n%1000 - 1)
n = int(input())
# print(n)
name = ""
if n < 1000:
    name = "ABC{}".format(margin0(n))
else:
    name = "ABD{}".format(margin0(n))
print(name[:3])

Verdicts: Runtime Error

Runtime Error

Runtime Error

Runtime Error

Runtime Error

Accepted
Problem: Decades have passed since the beginning of AtCoder Beginner Contest.  The contests are labeled as `ABC001`, `ABC002`, ... from the first round, but after the 999-th round `ABC999`, a problem occurred: how the future rounds should be labeled?  In the end, the labels for the rounds from the 1000-th to the 1998-th are decided: `ABD001`, `ABD002`, ..., `ABD999`.  You are given an integer N between 1 and 1998 (inclusive). Print the first three characters of the label of the N-th round of AtCoder Beginner Contest.

Submission attempts (in order):
N=int(input())
if N<1000:
  print("ABC"+str(N).zfill(3))
else:
  print("ABD"+str(N+1).zfill(3))

N=int(input())
if N<1000:
  print("ABC"+str(N-1).zfill(3))
else:
  print("ABD"+str(N-1).zfill(3))
  

N=int(input())
if N<1000:
  print("ABC"+str(N).zfill(3))
else:
  print("ABD"+str(N-1000+1).zfill(3))

N=int(input())
if N<1000:
  print("ABC")
else:
  print("ABD")

Verdicts: Wrong Answer

Wrong Answer

Wrong Answer

Accepted
Problem: Decades have passed since the beginning of AtCoder Beginner Contest.  The contests are labeled as `ABC001`, `ABC002`, ... from the first round, but after the 999-th round `ABC999`, a problem occurred: how the future rounds should be labeled?  In the end, the labels for the rounds from the 1000-th to the 1998-th are decided: `ABD001`, `ABD002`, ..., `ABD999`.  You are given an integer N between 1 and 1998 (inclusive). Print the first three characters of the label of the N-th round of AtCoder Beginner Contest.

Submission attempts (in order):
n=int(input())
if n - 999 > 0:
  print('ABD')
elif:
  print('ABC')

n=int(input())
if n - 999 > 0:
  print('ABD')
else:
  print('ABC')

Verdicts: Runtime Error

Accepted
Problem: Decades have passed since the beginning of AtCoder Beginner Contest.  The contests are labeled as `ABC001`, `ABC002`, ... from the first round, but after the 999-th round `ABC999`, a problem occurred: how the future rounds should be labeled?  In the end, the labels for the rounds from the 1000-th to the 1998-th are decided: `ABD001`, `ABD002`, ..., `ABD999`.  You are given an integer N between 1 and 1998 (inclusive). Print the first three characters of the label of the N-th round of AtCoder Beginner Contest.

Submission attempts (in order):
a,b = [int(i) for i in input().split()]

step = 2
towers = [1]
i = 1
while True:
    towers.append(towers[i-1] + step)
    
    if towers[i] >= 499500:
        break
    i += 1
    step += 1


depth = towers[(b-a)-1] - b
print(depth)



N = int(input())

if N < 1000:
    print("ABC")
else:
    print("ABD")
 


Verdicts: Runtime Error

Accepted
Problem: Decades have passed since the beginning of AtCoder Beginner Contest.  The contests are labeled as `ABC001`, `ABC002`, ... from the first round, but after the 999-th round `ABC999`, a problem occurred: how the future rounds should be labeled?  In the end, the labels for the rounds from the 1000-th to the 1998-th are decided: `ABD001`, `ABD002`, ..., `ABD999`.  You are given an integer N between 1 and 1998 (inclusive). Print the first three characters of the label of the N-th round of AtCoder Beginner Contest.

Submission attempts (in order):
n = int(input())
if n >= 1000:
    print('ABD' + ('00' + str(n-999))[-3:])
else:
    print('ABC' + ('00' + str(n))[-3:])


n = int(input())
if n >= 1000:
    print('ABD')
else:
    print('ABC')

Verdicts: Wrong Answer

Accepted
Problem: Decades have passed since the beginning of AtCoder Beginner Contest.  The contests are labeled as `ABC001`, `ABC002`, ... from the first round, but after the 999-th round `ABC999`, a problem occurred: how the future rounds should be labeled?  In the end, the labels for the rounds from the 1000-th to the 1998-th are decided: `ABD001`, `ABD002`, ..., `ABD999`.  You are given an integer N between 1 and 1998 (inclusive). Print the first three characters of the label of the N-th round of AtCoder Beginner Contest.

Submission attempts (in order):
#!/usr/bin/env python3
# -*- coding: utf-8 -*-

n = int(input())
if n < 1000:
    print("ABC" + str(n))
else:
    print("ABD" + str(n - 999))

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

n = int(input())
if n < 1000:
    print("ABC")
else:
    print("ABD")


Verdicts: Wrong Answer

Accepted
Problem: Decades have passed since the beginning of AtCoder Beginner Contest.  The contests are labeled as `ABC001`, `ABC002`, ... from the first round, but after the 999-th round `ABC999`, a problem occurred: how the future rounds should be labeled?  In the end, the labels for the rounds from the 1000-th to the 1998-th are decided: `ABD001`, `ABD002`, ..., `ABD999`.  You are given an integer N between 1 and 1998 (inclusive). Print the first three characters of the label of the N-th round of AtCoder Beginner Contest.

Submission attempts (in order):
import math, sys
from bisect import bisect_left, bisect_right
from collections import Counter, defaultdict, deque
from copy import deepcopy
from functools import lru_cache
from heapq import heapify, heappop, heappush
from itertools import accumulate, combinations, permutations
input = sys.stdin.readline
mod = 10**9 + 7
ns = lambda: input().strip()
ni = lambda: int(input().strip())
nm = lambda: map(int, input().split())
nl = lambda: list(map(int, input().split()))

n = ni()

if n < 999:
    print('ABC')
else:
    print('ABD')

import math, sys
from bisect import bisect_left, bisect_right
from collections import Counter, defaultdict, deque
from copy import deepcopy
from functools import lru_cache
from heapq import heapify, heappop, heappush
from itertools import accumulate, combinations, permutations
input = sys.stdin.readline
mod = 10**9 + 7
ns = lambda: input().strip()
ni = lambda: int(input().strip())
nm = lambda: map(int, input().split())
nl = lambda: list(map(int, input().split()))

n = ni()

if n < 1000:
    print('ABC')
else:
    print('ABD')

Verdicts: Wrong Answer

Accepted
Problem: Decades have passed since the beginning of AtCoder Beginner Contest.  The contests are labeled as `ABC001`, `ABC002`, ... from the first round, but after the 999-th round `ABC999`, a problem occurred: how the future rounds should be labeled?  In the end, the labels for the rounds from the 1000-th to the 1998-th are decided: `ABD001`, `ABD002`, ..., `ABD999`.  You are given an integer N between 1 and 1998 (inclusive). Print the first three characters of the label of the N-th round of AtCoder Beginner Contest.

Submission attempts (in order):
N,C = list(map(int,input().split()))
D = [ list(map(int,input().split()))  for i in range(C)]
c = [ list(map(int,input().split()))  for i in range(N)]

sep = {0:[0 for i in range(C)],1:[0 for i in range(C)],2:[0 for i in range(C)]}
for i,cx in enumerate(c):
    for j,cy in enumerate(cx):
        if len(c) == 2 and (i + j) % 3 == 2:
            sep[(i + j) % 3 - 1][cy -1] += 1
        else:
            sep[(i + j) % 3][cy - 1] += 1
minimums = [[],[],[]]
for key,values in sep.items():
    for i in range(C):
        m0 = 0
        am0 = 0
        m1 = 0
        am1 = 1
        deposit = 0
        for j,value in enumerate(values):
            deposit += D[j][i] * valuea
        sep[key].append(deposit)
min0 = min(sep[0])
min1 = min(sep[1])
min2 = min(sep[2])

print(min1 + min2 + min0)


N = int(input())            
if N > 999:                 
    print("ABD")            
else:                       
    pritn("ABC")            


N = int(input())            
if N > 999:                 
    print("ABD")            
else:                       
    print("ABC") 

Verdicts: Runtime Error

Runtime Error

Accepted
Problem: Decades have passed since the beginning of AtCoder Beginner Contest.  The contests are labeled as `ABC001`, `ABC002`, ... from the first round, but after the 999-th round `ABC999`, a problem occurred: how the future rounds should be labeled?  In the end, the labels for the rounds from the 1000-th to the 1998-th are decided: `ABD001`, `ABD002`, ..., `ABD999`.  You are given an integer N between 1 and 1998 (inclusive). Print the first three characters of the label of the N-th round of AtCoder Beginner Contest.

Submission attempts (in order):
N=int(input())
N=1000
if N>=1000:
  print("ABD")
else:
  print("ABC")

N=int(input())
if N>=1000:
  print("ABD")
else:
  print("ABC")

Verdicts: Wrong Answer

Accepted
Problem: Decades have passed since the beginning of AtCoder Beginner Contest.  The contests are labeled as `ABC001`, `ABC002`, ... from the first round, but after the 999-th round `ABC999`, a problem occurred: how the future rounds should be labeled?  In the end, the labels for the rounds from the 1000-th to the 1998-th are decided: `ABD001`, `ABD002`, ..., `ABD999`.  You are given an integer N between 1 and 1998 (inclusive). Print the first three characters of the label of the N-th round of AtCoder Beginner Contest.

Submission attempts (in order):
x = list(map(int,input().split( )))
z = x[1]-x[0]
t = 0
for s in range(z+2):
    t += s
    
print(t-x[1])

x = int(input())

if x > 999:
    print('ABD')
    
else:
    print('ABC')

Verdicts: Runtime Error

Accepted
Problem: Decades have passed since the beginning of AtCoder Beginner Contest.  The contests are labeled as `ABC001`, `ABC002`, ... from the first round, but after the 999-th round `ABC999`, a problem occurred: how the future rounds should be labeled?  In the end, the labels for the rounds from the 1000-th to the 1998-th are decided: `ABD001`, `ABD002`, ..., `ABD999`.  You are given an integer N between 1 and 1998 (inclusive). Print the first three characters of the label of the N-th round of AtCoder Beginner Contest.

Submission attempts (in order):
N = int(input())
if N < 1000:
	print('ABC%03d' % N)
else:
	print('ABD%03d' %(N-999))

N = int(input())
if N < 1000:
	print('ABC')
else:
	print('ABD')

Verdicts: Wrong Answer

Accepted
Problem: Decades have passed since the beginning of AtCoder Beginner Contest.  The contests are labeled as `ABC001`, `ABC002`, ... from the first round, but after the 999-th round `ABC999`, a problem occurred: how the future rounds should be labeled?  In the end, the labels for the rounds from the 1000-th to the 1998-th are decided: `ABD001`, `ABD002`, ..., `ABD999`.  You are given an integer N between 1 and 1998 (inclusive). Print the first three characters of the label of the N-th round of AtCoder Beginner Contest.

Submission attempts (in order):
a, b = map(int, input().split())

print(((b-a)+1)*(b-a)//2-b)


n = int(input())

if n <= 999:
    print("ABC")
else:
    print("ABD")


Verdicts: Runtime Error

Accepted
Problem: Decades have passed since the beginning of AtCoder Beginner Contest.  The contests are labeled as `ABC001`, `ABC002`, ... from the first round, but after the 999-th round `ABC999`, a problem occurred: how the future rounds should be labeled?  In the end, the labels for the rounds from the 1000-th to the 1998-th are decided: `ABD001`, `ABD002`, ..., `ABD999`.  You are given an integer N between 1 and 1998 (inclusive). Print the first three characters of the label of the N-th round of AtCoder Beginner Contest.

Submission attempts (in order):
#encoding utf-8


n = int(input())

if n >= 999:
    print("ABD")

else:
    print("ABC")


#encoding utf-8


n = input()

if n > 999:
    print("ABD")

else:
    print("ABC")

#encoding utf-8


n = int(input())

if n > 999:
    print("ABD")

else:
    print("ABC")


Verdicts: Wrong Answer

Runtime Error

Accepted
Problem: Decades have passed since the beginning of AtCoder Beginner Contest.  The contests are labeled as `ABC001`, `ABC002`, ... from the first round, but after the 999-th round `ABC999`, a problem occurred: how the future rounds should be labeled?  In the end, the labels for the rounds from the 1000-th to the 1998-th are decided: `ABD001`, `ABD002`, ..., `ABD999`.  You are given an integer N between 1 and 1998 (inclusive). Print the first three characters of the label of the N-th round of AtCoder Beginner Contest.

Submission attempts (in order):
def con_n(N):
    if N <= 1000:
        return 'ABC'
    elif N > 1000:
        return 'ABD'

n = int(input())
def con_n(n):
    if n <= 1000:
        return 'ABC'
    elif n > 1000:
        return 'ABD'
    
con_n(n)

n = int(input())
def con_n(n):
    if n < 1000:
        return 'ABC'
    elif n => 1000:
        return 'ABD'
    
print(con_n(n))

k, l=[int(i) for i in input().split()]

import numpy as np
n = np.zeros(999)
for i in range(1000):
    if i != 0:
        n[i-1] = i


def snowh(k, l):
    for i in range(1000):
        if l-k == n[i-1]:
            return n[i-2]*(n[i-2]+1)*0.5 - k
        
print(snowh(k, l))

n = int(input())
def con_n(n):
    if n <= 1000:
        return 'ABC'
    elif n > 1000:
        return 'ABD'

n = int(input())
def con_n(n):
    if N <= 1000:
        return 'ABC'
    elif N > 1000:
        return 'ABD'

n = int(input())
def con_n(n):
    if n < 1000:
        return 'ABC'
    elif n => 1000:
        return 'ABD'
    
print(con_n(n))

n = int(input())
def con_n(n):
    if n < 1000:
        return 'ABC'
    elif n >= 1000:
        return 'ABD'
    
print(con_n(n))

Verdicts: Wrong Answer

Wrong Answer

Runtime Error

Runtime Error

Wrong Answer

Wrong Answer

Runtime Error

Accepted
Problem: Decades have passed since the beginning of AtCoder Beginner Contest.  The contests are labeled as `ABC001`, `ABC002`, ... from the first round, but after the 999-th round `ABC999`, a problem occurred: how the future rounds should be labeled?  In the end, the labels for the rounds from the 1000-th to the 1998-th are decided: `ABD001`, `ABD002`, ..., `ABD999`.  You are given an integer N between 1 and 1998 (inclusive). Print the first three characters of the label of the N-th round of AtCoder Beginner Contest.

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

print("ABD{:04}".format(N)) if N//1000!=1 else print("ABD{:04}".format(N%1000 + N//1000))

N = int(input())

num = N%1000 + N//1000

print("ABD"+str(num))

N = input()

print("ABD"+N)

N = int(input())

print("ABC{:03}".format(N)) if N//1000!=1 else print("ABD{:03}".format(N%1000 + N//1000))

N = int(input())

print("ABC") if N//1000!=1 else print("ABD")

Verdicts: Wrong Answer

Wrong Answer

Wrong Answer

Wrong Answer

Accepted
Problem: Decades have passed since the beginning of AtCoder Beginner Contest.  The contests are labeled as `ABC001`, `ABC002`, ... from the first round, but after the 999-th round `ABC999`, a problem occurred: how the future rounds should be labeled?  In the end, the labels for the rounds from the 1000-th to the 1998-th are decided: `ABD001`, `ABD002`, ..., `ABD999`.  You are given an integer N between 1 and 1998 (inclusive). Print the first three characters of the label of the N-th round of AtCoder Beginner Contest.

Submission attempts (in order):
from itertools import permutations

N, C = [int(elem) for elem in input().split(' ')]
D_matrix = [[int(elem) for elem in input().split(' ')] for _ in range(C)]
assert len(D_matrix) == C
assert len(D_matrix[0]) == C
c_matrix = [[int(elem) for elem in input().split(' ')] for _ in range(N)]
assert len(c_matrix) == N
assert len(c_matrix[0]) == N

# grouping
# O(N^2)
mod_list = [[] for _ in range(3)]
for i in range(N):
    for j in range(N):
        mod_list[(i + j) % 3].append((i, j))

# O(N^2)
mod_color_list = [[0] * C for _ in range(3)]
for k, mod in enumerate(mod_list):
    for i, j in mod:
        mod_color_list[k][c_matrix[i][j] - 1] += 1

# O(C^3 * N^2) -> O(C^4)
min_cost = float('inf')
for colors in permutations(range(C), 3):
    total_cost = 0
    for color, mod_color in zip(colors, mod_color_list):
        total_cost += sum([D_matrix[X][color] * mod_color[X] for X in range(C)])
    min_cost = min(min_cost, total_cost)

print(min_cost)


N = int(input())

if N < 1000:
    print("ABC")
else:
    print("ABD")


Verdicts: Runtime Error

Accepted
Problem: Decades have passed since the beginning of AtCoder Beginner Contest.  The contests are labeled as `ABC001`, `ABC002`, ... from the first round, but after the 999-th round `ABC999`, a problem occurred: how the future rounds should be labeled?  In the end, the labels for the rounds from the 1000-th to the 1998-th are decided: `ABD001`, `ABD002`, ..., `ABD999`.  You are given an integer N between 1 and 1998 (inclusive). Print the first three characters of the label of the N-th round of AtCoder Beginner Contest.

Submission attempts (in order):
n = int(input())
if n <= 999:
    ans = 'ABC' + str(n).zfill(3)
else:
    ans = 'ABD' + str(n-1000+1).zfill(3)

print(ans)

n = int(input())
print('ABC' if n <= 999 else 'ABD')

Verdicts: Wrong Answer

Accepted
Problem: Decades have passed since the beginning of AtCoder Beginner Contest.  The contests are labeled as `ABC001`, `ABC002`, ... from the first round, but after the 999-th round `ABC999`, a problem occurred: how the future rounds should be labeled?  In the end, the labels for the rounds from the 1000-th to the 1998-th are decided: `ABD001`, `ABD002`, ..., `ABD999`.  You are given an integer N between 1 and 1998 (inclusive). Print the first three characters of the label of the N-th round of AtCoder Beginner Contest.

Submission attempts (in order):
return "ABC" if int(input()) < 1000 else "ABD"

print('ABC') if int(input()) < 1000 else print('ABD')

Verdicts: Runtime Error

Accepted
Problem: Decades have passed since the beginning of AtCoder Beginner Contest.  The contests are labeled as `ABC001`, `ABC002`, ... from the first round, but after the 999-th round `ABC999`, a problem occurred: how the future rounds should be labeled?  In the end, the labels for the rounds from the 1000-th to the 1998-th are decided: `ABD001`, `ABD002`, ..., `ABD999`.  You are given an integer N between 1 and 1998 (inclusive). Print the first three characters of the label of the N-th round of AtCoder Beginner Contest.

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

if X < 1000:
  print('ABC' + f'{X:03}')
else:
  X = X % 999
  print('ABD' + f'{X:03}')

X = int(input())

if X < 1000:
  print('ABC' + str(X).zfill(3))
else:
  X = X % 999
  print('ABD' + str(X).zfill(3))

X = int(input())

if X < 1000:
  print('ABC')
else:
  print('ABD')

Verdicts: Wrong Answer

Wrong Answer

Accepted
Problem: Decades have passed since the beginning of AtCoder Beginner Contest.  The contests are labeled as `ABC001`, `ABC002`, ... from the first round, but after the 999-th round `ABC999`, a problem occurred: how the future rounds should be labeled?  In the end, the labels for the rounds from the 1000-th to the 1998-th are decided: `ABD001`, `ABD002`, ..., `ABD999`.  You are given an integer N between 1 and 1998 (inclusive). Print the first three characters of the label of the N-th round of AtCoder Beginner Contest.

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

if a < 1000 :
    print("ABC")
else :
    print("ABD")

a = int(input())

if a < 1000 :
    print("ABC")
else :
    print("ABD")

Verdicts: Runtime Error

Accepted
Problem: Decades have passed since the beginning of AtCoder Beginner Contest.  The contests are labeled as `ABC001`, `ABC002`, ... from the first round, but after the 999-th round `ABC999`, a problem occurred: how the future rounds should be labeled?  In the end, the labels for the rounds from the 1000-th to the 1998-th are decided: `ABD001`, `ABD002`, ..., `ABD999`.  You are given an integer N between 1 and 1998 (inclusive). Print the first three characters of the label of the N-th round of AtCoder Beginner Contest.

Submission attempts (in order):
N = int(input())
offset = 'ABC' if N < 1000 else 'ABC'
print(offset + str(N%1000))

N = int(input())
offset = 'ABC' if N < 999 else 'ABD'
print(offset)# + str(N%999))

N = int(input())
offset = 'ABC' if N < 999 else 'ABC'
print(offset + str(N%999))

N = int(input())
offset = 'ABC' if N <= 999 else 'ABD'
print(offset)# + str(N%999))


Verdicts: Wrong Answer

Wrong Answer

Wrong Answer

Accepted
Problem: Decades have passed since the beginning of AtCoder Beginner Contest.  The contests are labeled as `ABC001`, `ABC002`, ... from the first round, but after the 999-th round `ABC999`, a problem occurred: how the future rounds should be labeled?  In the end, the labels for the rounds from the 1000-th to the 1998-th are decided: `ABD001`, `ABD002`, ..., `ABD999`.  You are given an integer N between 1 and 1998 (inclusive). Print the first three characters of the label of the N-th round of AtCoder Beginner Contest.

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

if n <=9:
  print("ABC00"+str(n))
elif n <= 99:
  print("ABC0"+str(n))
else:
  print("ABC"+str(n))


n = int(input())

if n <=999:
  print("ABC")
else:
  print("ABD"))

n = int(input())
print("ABC"+str(n%1000))

n = int(input())

if n <=9:
  print("ABC00"+str(n))
elif n <= 99:
  print("ABC0"+str(n))
elif n <= 999:
  print("ABC"+str(n))
elif n <= 1008:
  print("ABD00"+str(n%999))
elif n <= 1098:
  print("ABD0"+str(n%999))
else:
  print("ABD"+str(n%999))

n = int(input())
if n <=999:
  print("ABC")
else:
  print("ABD")

Verdicts: Wrong Answer

Runtime Error

Wrong Answer

Wrong Answer

Accepted
Problem: Decades have passed since the beginning of AtCoder Beginner Contest.  The contests are labeled as `ABC001`, `ABC002`, ... from the first round, but after the 999-th round `ABC999`, a problem occurred: how the future rounds should be labeled?  In the end, the labels for the rounds from the 1000-th to the 1998-th are decided: `ABD001`, `ABD002`, ..., `ABD999`.  You are given an integer N between 1 and 1998 (inclusive). Print the first three characters of the label of the N-th round of AtCoder Beginner Contest.

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

if N < 100: print("ABC")
else: print("ABD")

N = int(input())

if N < 1000: print("ABC")
else: print("ABD")

Verdicts: Wrong Answer

Accepted
Problem: Decades have passed since the beginning of AtCoder Beginner Contest.  The contests are labeled as `ABC001`, `ABC002`, ... from the first round, but after the 999-th round `ABC999`, a problem occurred: how the future rounds should be labeled?  In the end, the labels for the rounds from the 1000-th to the 1998-th are decided: `ABD001`, `ABD002`, ..., `ABD999`.  You are given an integer N between 1 and 1998 (inclusive). Print the first three characters of the label of the N-th round of AtCoder Beginner Contest.

Submission attempts (in order):
n = int(input())
ans = 'AB'
if n <= 999:
  ans += 'C'
else:
  ans += 'D'
  n -= 999
print(ans+'{:03}'.format(n))



n = int(input())
ans = 'AB'
if n <= 999:
  ans += 'C'
else:
  ans += 'D'
  n -= 999
print(ans+'{03}'.format(n))

n = int(input())
ans = 'AB'
if n <= 999:
  ans += 'C'
else:
  ans += 'D'
print(ans)


Verdicts: Wrong Answer

Runtime Error

Accepted
Problem: Decades have passed since the beginning of AtCoder Beginner Contest.  The contests are labeled as `ABC001`, `ABC002`, ... from the first round, but after the 999-th round `ABC999`, a problem occurred: how the future rounds should be labeled?  In the end, the labels for the rounds from the 1000-th to the 1998-th are decided: `ABD001`, `ABD002`, ..., `ABD999`.  You are given an integer N between 1 and 1998 (inclusive). Print the first three characters of the label of the N-th round of AtCoder Beginner Contest.

Submission attempts (in order):
n = int(input())
print("ABC{0:03d}".format(n) if n<1000 else "ABD{0:03d}".format(n-999))

n = int(input())
print("ABC" if n<1000 else "ABD")

Verdicts: Wrong Answer

Accepted
Problem: Decades have passed since the beginning of AtCoder Beginner Contest.  The contests are labeled as `ABC001`, `ABC002`, ... from the first round, but after the 999-th round `ABC999`, a problem occurred: how the future rounds should be labeled?  In the end, the labels for the rounds from the 1000-th to the 1998-th are decided: `ABD001`, `ABD002`, ..., `ABD999`.  You are given an integer N between 1 and 1998 (inclusive). Print the first three characters of the label of the N-th round of AtCoder Beginner Contest.

Submission attempts (in order):
N = input()
if 1 <= N <= 999:
    print("ABC")
else:
    print("ABD")

print("ABC" if 1<=int(input())<=999 else "ABD")

Verdicts: Runtime Error

Accepted
Problem: Decades have passed since the beginning of AtCoder Beginner Contest.  The contests are labeled as `ABC001`, `ABC002`, ... from the first round, but after the 999-th round `ABC999`, a problem occurred: how the future rounds should be labeled?  In the end, the labels for the rounds from the 1000-th to the 1998-th are decided: `ABD001`, `ABD002`, ..., `ABD999`.  You are given an integer N between 1 and 1998 (inclusive). Print the first three characters of the label of the N-th round of AtCoder Beginner Contest.

Submission attempts (in order):
n=int(input())
import math
ansa=[0]
ansb=[0]
ans=[]
cnt=0
x=0
y=0
for i in range(1,n+1):
    while 9**(x+1)<=i:
        x+=1
    for j in range(x,-1,-1):
        z=(math.floor(i/(9**j))%9)
        i-=(9**j)*z
        cnt+=z
    ansa.append(cnt)
    cnt=0    
    
for i in range(1,n+1):
    while 6**(y+1)<=i:
        y+=1
    for j in range(y,-1,-1):
        z=(math.floor(i/(6**j))%6)
        i-=(6**j)*z
        cnt+=z
    ansb.append(cnt)
    cnt=0
    
for i in range(n+1):
    ans.append(ansa[i]+ansb[n-i])
    
print(min(ans))   



n=int(input())
if n<1000:
    print("ABC")
else:
    print("ABD")    
    

Verdicts: Wrong Answer

Accepted
Problem: Decades have passed since the beginning of AtCoder Beginner Contest.  The contests are labeled as `ABC001`, `ABC002`, ... from the first round, but after the 999-th round `ABC999`, a problem occurred: how the future rounds should be labeled?  In the end, the labels for the rounds from the 1000-th to the 1998-th are decided: `ABD001`, `ABD002`, ..., `ABD999`.  You are given an integer N between 1 and 1998 (inclusive). Print the first three characters of the label of the N-th round of AtCoder Beginner Contest.

Submission attempts (in order):
N=int(input())
print("ABC" if N-999<0 else "ABD")

N=int(input())
print("ABC" if N-1000<0 else "ABD")

Verdicts: Wrong Answer

Accepted
Problem: Decades have passed since the beginning of AtCoder Beginner Contest.  The contests are labeled as `ABC001`, `ABC002`, ... from the first round, but after the 999-th round `ABC999`, a problem occurred: how the future rounds should be labeled?  In the end, the labels for the rounds from the 1000-th to the 1998-th are decided: `ABD001`, `ABD002`, ..., `ABD999`.  You are given an integer N between 1 and 1998 (inclusive). Print the first three characters of the label of the N-th round of AtCoder Beginner Contest.

Submission attempts (in order):
print(["ABD","ABC][len(input())==3])

print(["ABC","ABD"][len(input())==4])

Verdicts: Runtime Error

Accepted
Problem: Decades have passed since the beginning of AtCoder Beginner Contest.  The contests are labeled as `ABC001`, `ABC002`, ... from the first round, but after the 999-th round `ABC999`, a problem occurred: how the future rounds should be labeled?  In the end, the labels for the rounds from the 1000-th to the 1998-th are decided: `ABD001`, `ABD002`, ..., `ABD999`.  You are given an integer N between 1 and 1998 (inclusive). Print the first three characters of the label of the N-th round of AtCoder Beginner Contest.

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

    if N > 999:
        print('ABC')
    else:
        print('ABD')

main()


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

    if N < 1000:
        print('ABC')
    else:
        print('ABD')

main()


Verdicts: Wrong Answer

Accepted
Problem: Decades have passed since the beginning of AtCoder Beginner Contest.  The contests are labeled as `ABC001`, `ABC002`, ... from the first round, but after the 999-th round `ABC999`, a problem occurred: how the future rounds should be labeled?  In the end, the labels for the rounds from the 1000-th to the 1998-th are decided: `ABD001`, `ABD002`, ..., `ABD999`.  You are given an integer N between 1 and 1998 (inclusive). Print the first three characters of the label of the N-th round of AtCoder Beginner Contest.

Submission attempts (in order):
a=int(input())
if a>999:
  print("ABC"+a)
else:
  print("ABD"+a%999)

a=int(input())
if 1<=a<=999:
  print("ABC")
else:
  print("ABD")

Verdicts: Runtime Error

Accepted
Problem: Decades have passed since the beginning of AtCoder Beginner Contest.  The contests are labeled as `ABC001`, `ABC002`, ... from the first round, but after the 999-th round `ABC999`, a problem occurred: how the future rounds should be labeled?  In the end, the labels for the rounds from the 1000-th to the 1998-th are decided: `ABD001`, `ABD002`, ..., `ABD999`.  You are given an integer N between 1 and 1998 (inclusive). Print the first three characters of the label of the N-th round of AtCoder Beginner Contest.

Submission attempts (in order):
n = int(input())
print('ABC' + n if n < 1000 else 'ABD' + n)

n = int(input())
print('ABC' if n < 1000 else 'ABD')

Verdicts: Runtime Error

Accepted
Problem: Decades have passed since the beginning of AtCoder Beginner Contest.  The contests are labeled as `ABC001`, `ABC002`, ... from the first round, but after the 999-th round `ABC999`, a problem occurred: how the future rounds should be labeled?  In the end, the labels for the rounds from the 1000-th to the 1998-th are decided: `ABD001`, `ABD002`, ..., `ABD999`.  You are given an integer N between 1 and 1998 (inclusive). Print the first three characters of the label of the N-th round of AtCoder Beginner Contest.

Submission attempts (in order):
N = int(input())
if N < 1000:
  print("ABC"+ str(N))
else:
  print("ABD" + str(N))

N = int(input())
if N < 1000:
  print("ABC")
else:
  print("ABD")

Verdicts: Wrong Answer

Accepted
Problem: Decades have passed since the beginning of AtCoder Beginner Contest.  The contests are labeled as `ABC001`, `ABC002`, ... from the first round, but after the 999-th round `ABC999`, a problem occurred: how the future rounds should be labeled?  In the end, the labels for the rounds from the 1000-th to the 1998-th are decided: `ABD001`, `ABD002`, ..., `ABD999`.  You are given an integer N between 1 and 1998 (inclusive). Print the first three characters of the label of the N-th round of AtCoder Beginner Contest.

Submission attempts (in order):
n = int(input())
if n <= 999:
    print("ABC{0:03d}".format(n))
else:
    print("ABD{0:03d}".format(abs(n-1000+1)))

n = int(input())
if n <= 999:
    print("ABC")
else:
    print("ABD")

Verdicts: Wrong Answer

Accepted
Problem: Decades have passed since the beginning of AtCoder Beginner Contest.  The contests are labeled as `ABC001`, `ABC002`, ... from the first round, but after the 999-th round `ABC999`, a problem occurred: how the future rounds should be labeled?  In the end, the labels for the rounds from the 1000-th to the 1998-th are decided: `ABD001`, `ABD002`, ..., `ABD999`.  You are given an integer N between 1 and 1998 (inclusive). Print the first three characters of the label of the N-th round of AtCoder Beginner Contest.

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

if contest_num >= 1999:
    result_str = 'The contest has not been held'

elif contest_num < 1000:
    result_str = 'ABC'

elif contest_num >= 1000:
    result_str = 'ABD'

print("result_str")



contest_num = int(input())

if contest_num >= 1999:
    result_str = 'The contest has not been held'

elif contest_num < 1000:
    result_str = 'ABC'

elif contest_num >= 1000:
    result_str = 'ABD'

print(result_str)



Verdicts: Wrong Answer

Accepted
Problem: Decades have passed since the beginning of AtCoder Beginner Contest.  The contests are labeled as `ABC001`, `ABC002`, ... from the first round, but after the 999-th round `ABC999`, a problem occurred: how the future rounds should be labeled?  In the end, the labels for the rounds from the 1000-th to the 1998-th are decided: `ABD001`, `ABD002`, ..., `ABD999`.  You are given an integer N between 1 and 1998 (inclusive). Print the first three characters of the label of the N-th round of AtCoder Beginner Contest.

Submission attempts (in order):
num = input()
if num < 1000:
  print('ABC')
else:
  print('ABD')

num = int(input())
if num < 1000:
   print('ABC')
else:
   print('ABD')

Verdicts: Runtime Error

Accepted
Problem: Decades have passed since the beginning of AtCoder Beginner Contest.  The contests are labeled as `ABC001`, `ABC002`, ... from the first round, but after the 999-th round `ABC999`, a problem occurred: how the future rounds should be labeled?  In the end, the labels for the rounds from the 1000-th to the 1998-th are decided: `ABD001`, `ABD002`, ..., `ABD999`.  You are given an integer N between 1 and 1998 (inclusive). Print the first three characters of the label of the N-th round of AtCoder Beginner Contest.

Submission attempts (in order):
N = int(input())
if N <= 999:
    print('ABC' + str(N+1000)[1:])
else:
    print('ABD' + str(N+1)[1:])

N = int(input())
if N <= 999:
    print('ABC')
else:
    print('ABD')

Verdicts: Wrong Answer

Accepted
Problem: Decades have passed since the beginning of AtCoder Beginner Contest.  The contests are labeled as `ABC001`, `ABC002`, ... from the first round, but after the 999-th round `ABC999`, a problem occurred: how the future rounds should be labeled?  In the end, the labels for the rounds from the 1000-th to the 1998-th are decided: `ABD001`, `ABD002`, ..., `ABD999`.  You are given an integer N between 1 and 1998 (inclusive). Print the first three characters of the label of the N-th round of AtCoder Beginner Contest.

Submission attempts (in order):
n=int(input())
if n<=99:
    print("ABC")
else:
    print("ABD")


n=int(input())
if n<=999:
    print("ABC")
else:
    print("ABD")


Verdicts: Wrong Answer

Accepted
Problem: Decades have passed since the beginning of AtCoder Beginner Contest.  The contests are labeled as `ABC001`, `ABC002`, ... from the first round, but after the 999-th round `ABC999`, a problem occurred: how the future rounds should be labeled?  In the end, the labels for the rounds from the 1000-th to the 1998-th are decided: `ABD001`, `ABD002`, ..., `ABD999`.  You are given an integer N between 1 and 1998 (inclusive). Print the first three characters of the label of the N-th round of AtCoder Beginner Contest.

Submission attempts (in order):
n= int(input())
if n > 999:
    print('ABD',str(n-999).zfill(3),sep='')
else:
    print('ABC',str(n).zfill(3),sep='')

n= int(input())
if n > 999:
    print('ABD')
else:
    print('ABC')

Verdicts: Wrong Answer

Accepted
Problem: Decades have passed since the beginning of AtCoder Beginner Contest.  The contests are labeled as `ABC001`, `ABC002`, ... from the first round, but after the 999-th round `ABC999`, a problem occurred: how the future rounds should be labeled?  In the end, the labels for the rounds from the 1000-th to the 1998-th are decided: `ABD001`, `ABD002`, ..., `ABD999`.  You are given an integer N between 1 and 1998 (inclusive). Print the first three characters of the label of the N-th round of AtCoder Beginner Contest.

Submission attempts (in order):
n = int(input())
if n <= 999:
  print('ABC'+str(n).zfill(3))
else:
  print('ABD'+str(n-999).zfill(3))


n = int(input())
if n <= 999:
  print('ABC'+str(n).zfill(4))
else:
  print('ABD'+str(n-999).zfill(4))


n = int(input())
if n <= 999:
  print('ABC'+str(n))
else:
  print('ABD'+str(n-999))

n = int(input())
if n <= 999:
  print('ABC')
else:
  print('ABD')


Verdicts: Wrong Answer

Wrong Answer

Wrong Answer

Accepted
Problem: Decades have passed since the beginning of AtCoder Beginner Contest.  The contests are labeled as `ABC001`, `ABC002`, ... from the first round, but after the 999-th round `ABC999`, a problem occurred: how the future rounds should be labeled?  In the end, the labels for the rounds from the 1000-th to the 1998-th are decided: `ABD001`, `ABD002`, ..., `ABD999`.  You are given an integer N between 1 and 1998 (inclusive). Print the first three characters of the label of the N-th round of AtCoder Beginner Contest.

Submission attempts (in order):
n = input()
n = str(int(n) - 999)
ans = "ABD" + n.zfill(3)
print(ans)

n = int(input())
print("ABD{}".format(n-999))

n = int(input())
if n > 999:
    print("ABD")
else:
    print("ABC")

Verdicts: Wrong Answer

Wrong Answer

Accepted
Problem: Decades have passed since the beginning of AtCoder Beginner Contest.  The contests are labeled as `ABC001`, `ABC002`, ... from the first round, but after the 999-th round `ABC999`, a problem occurred: how the future rounds should be labeled?  In the end, the labels for the rounds from the 1000-th to the 1998-th are decided: `ABD001`, `ABD002`, ..., `ABD999`.  You are given an integer N between 1 and 1998 (inclusive). Print the first three characters of the label of the N-th round of AtCoder Beginner Contest.

Submission attempts (in order):
n = int(input())
print("%03d" % (n%1000 + n//1000))

n = int(input())
if(n>999):
    print("ABD")
else:
    print("ABC")

Verdicts: Wrong Answer

Accepted
Problem: Decades have passed since the beginning of AtCoder Beginner Contest.  The contests are labeled as `ABC001`, `ABC002`, ... from the first round, but after the 999-th round `ABC999`, a problem occurred: how the future rounds should be labeled?  In the end, the labels for the rounds from the 1000-th to the 1998-th are decided: `ABD001`, `ABD002`, ..., `ABD999`.  You are given an integer N between 1 and 1998 (inclusive). Print the first three characters of the label of the N-th round of AtCoder Beginner Contest.

Submission attempts (in order):
N = int(input())
if N <= 999:
    print('ABC'+str(N).zfill(3))
else:
    print('ABD'+str(N-999).zfill(3))

N = int(input())
if N <= 999:
    print('ABC'+str(N))
else:
    print('ABD'+str(N-999))


N = int(input())
if N <= 999:
    print('ABC')
else:
    print('ABD')


Verdicts: Wrong Answer

Wrong Answer

Accepted
Problem: Decades have passed since the beginning of AtCoder Beginner Contest.  The contests are labeled as `ABC001`, `ABC002`, ... from the first round, but after the 999-th round `ABC999`, a problem occurred: how the future rounds should be labeled?  In the end, the labels for the rounds from the 1000-th to the 1998-th are decided: `ABD001`, `ABD002`, ..., `ABD999`.  You are given an integer N between 1 and 1998 (inclusive). Print the first three characters of the label of the N-th round of AtCoder Beginner Contest.

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

if n > 999:
    print('ABD{}'.format(n - 999))
else:
    print('ABC{}'.format(n))

n = int(input())

if n > 999:
    print('ABD{}'.format(str(n - 999).zfill(3)))
else:
    print('ABC{}'.format(n))

n = int(input())

if n > 999:
    print('ABD)
else:
    print('ABC')

n = int(input())
 
if n > 999:
    print('ABD')
else:
    print('ABC')

Verdicts: Wrong Answer

Wrong Answer

Runtime Error

Accepted
Problem: Decades have passed since the beginning of AtCoder Beginner Contest.  The contests are labeled as `ABC001`, `ABC002`, ... from the first round, but after the 999-th round `ABC999`, a problem occurred: how the future rounds should be labeled?  In the end, the labels for the rounds from the 1000-th to the 1998-th are decided: `ABD001`, `ABD002`, ..., `ABD999`.  You are given an integer N between 1 and 1998 (inclusive). Print the first three characters of the label of the N-th round of AtCoder Beginner Contest.

Submission attempts (in order):
from math import log
from functools import lru_cache
     
n=int(input())
     
a=int(log(n,6))
b=int(log(n,9))
l=list(set([1]+[6**i for i in range(a+1)]+[9**i for i in range(b+1)]))
     
@lru_cache(maxsize=100000)
def func(n):
    if n<=0: return 1000000
    if n in l:return 1
    return min([func(n-li) for li in l])+1
     
print(func)

print('AB'+'CD'[int(input())//1000])

Verdicts: Wrong Answer

Accepted
Problem: Decades have passed since the beginning of AtCoder Beginner Contest.  The contests are labeled as `ABC001`, `ABC002`, ... from the first round, but after the 999-th round `ABC999`, a problem occurred: how the future rounds should be labeled?  In the end, the labels for the rounds from the 1000-th to the 1998-th are decided: `ABD001`, `ABD002`, ..., `ABD999`.  You are given an integer N between 1 and 1998 (inclusive). Print the first three characters of the label of the N-th round of AtCoder Beginner Contest.

Submission attempts (in order):
n = int(input())
if n > 999:
    print('ABD'+'{:0>3}'.format(n-999))
else:
    print('ABC'+'{:0>3}'.format(n))

n = int(input())
if n > 999:
    print('ABD')
else:
    print('ABC')

Verdicts: Wrong Answer

Accepted
Problem: Decades have passed since the beginning of AtCoder Beginner Contest.  The contests are labeled as `ABC001`, `ABC002`, ... from the first round, but after the 999-th round `ABC999`, a problem occurred: how the future rounds should be labeled?  In the end, the labels for the rounds from the 1000-th to the 1998-th are decided: `ABD001`, `ABD002`, ..., `ABD999`.  You are given an integer N between 1 and 1998 (inclusive). Print the first three characters of the label of the N-th round of AtCoder Beginner Contest.

Submission attempts (in order):
import itertools
def main():
  n = int(input())
  print(("ABC"+'{:03}'.format(n))if n<=999 else "ABD"+'{:03}'.format(n-999))
if __name__ == '__main__':
  main()

import itertools
def main():
  n = int(input())
  print("ABC"if n<=999 else "ABD")
if __name__ == '__main__':
  main()

Verdicts: Wrong Answer

Accepted
Problem: Decades have passed since the beginning of AtCoder Beginner Contest.  The contests are labeled as `ABC001`, `ABC002`, ... from the first round, but after the 999-th round `ABC999`, a problem occurred: how the future rounds should be labeled?  In the end, the labels for the rounds from the 1000-th to the 1998-th are decided: `ABD001`, `ABD002`, ..., `ABD999`.  You are given an integer N between 1 and 1998 (inclusive). Print the first three characters of the label of the N-th round of AtCoder Beginner Contest.

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

if n >= 1000:
  print('ABC')
else:
  print('ABD')

n = int(input())
if n >= 1000:
  print('ABD')
else:
  print('ABC')

Verdicts: Wrong Answer

Accepted
Problem: Decades have passed since the beginning of AtCoder Beginner Contest.  The contests are labeled as `ABC001`, `ABC002`, ... from the first round, but after the 999-th round `ABC999`, a problem occurred: how the future rounds should be labeled?  In the end, the labels for the rounds from the 1000-th to the 1998-th are decided: `ABD001`, `ABD002`, ..., `ABD999`.  You are given an integer N between 1 and 1998 (inclusive). Print the first three characters of the label of the N-th round of AtCoder Beginner Contest.

Submission attempts (in order):
#coding : utf-8

if __name__ == '__main__':

    N = int(input())
    n = int(N/999)
    if n == 0:
        print('ABC')
    elif n == 1:
        print('ABD')
    elif n == 2:
        print('ABE')

#coding : utf-8

if __name__ == '__main__':

    N = int(input())
    if n < 1000:
        print('ABC')
    else:
        print('ABD')

#coding : utf-8

if __name__ == '__main__':

    N = int(input())
    if N < 1000:
        print('ABC')
    else:
        print('ABD')

Verdicts: Wrong Answer

Runtime Error

Accepted
Problem: Decades have passed since the beginning of AtCoder Beginner Contest.  The contests are labeled as `ABC001`, `ABC002`, ... from the first round, but after the 999-th round `ABC999`, a problem occurred: how the future rounds should be labeled?  In the end, the labels for the rounds from the 1000-th to the 1998-th are decided: `ABD001`, `ABD002`, ..., `ABD999`.  You are given an integer N between 1 and 1998 (inclusive). Print the first three characters of the label of the N-th round of AtCoder Beginner Contest.

Submission attempts (in order):
a, b = map(int, input().split())
n = b - a
print(int(n*(n+1)/2-b))

a,b=map(int,input().split())
n=b-a
print(int(n*(n+1)/2-b))

a, b = map(int, input().split())
print(((b-a)*(b-a+1)/2)-b)

a, b = map(int, input().split())
ans = int(((b-a)*(b-a+1)/2)-b)
print(ans)

a,b=map(int,input().split())
n=b-a
print(int(n*(n+1)/2-b))

a,b=map(int,input().split())
n=b-a
print(int(n*(n+1)/2-b))

a,b=map(int,input().split())
n=b-a
print(int(n*(n+1)/2-b))

a, b = map(int, input().split())
n = b - a
print(int(n*(n+1)/2-b))

a, b = map(int, input().split())
ans = int(((b-a)*(b-a+1)/2)-b)
print(ans)

n = int(input())
if n > 999:
    print("ABD")
    exit()
print("ABC")

Verdicts: Runtime Error

Runtime Error

Runtime Error

Runtime Error

Runtime Error

Runtime Error

Runtime Error

Runtime Error

Runtime Error

Accepted
Problem: Decades have passed since the beginning of AtCoder Beginner Contest.  The contests are labeled as `ABC001`, `ABC002`, ... from the first round, but after the 999-th round `ABC999`, a problem occurred: how the future rounds should be labeled?  In the end, the labels for the rounds from the 1000-th to the 1998-th are decided: `ABD001`, `ABD002`, ..., `ABD999`.  You are given an integer N between 1 and 1998 (inclusive). Print the first three characters of the label of the N-th round of AtCoder Beginner Contest.

Submission attempts (in order):
N = input()
if N >= 1000:
    print("ABD")
else:
    print("ABC")

N = int(input())
if N >= 1000:
    print("ABD")
else:
    print("ABC")

Verdicts: Runtime Error

Accepted