TnT/Multi_CodeNet4Repair huggingface dataset:
Problem: The door of Snuke's laboratory is locked with a security code.  The security code is a 4-digit number. We say the security code is _hard to enter_ when it contains two consecutive digits that are the same.  You are given the current security code S. If S is hard to enter, print `Bad`; otherwise, print `Good`.

Submission attempts (in order):
s = list(input())
if s[0] == s[1] or s[1] == s[2] or s[2] = s[3]:
  print("Good")
else:
  print("Bad")

s = list(input())
if s[0] == s[1] or s[1] == s[2] or s[2] == s[3]:
  print("Good")
else:
  print("Bad")


s = list(input())
if s[0] == s[1] or s[1] == s[2] or s[2] == s[3]:
  print("Bad")
else:
  print("Good")

Verdicts: Runtime Error

Wrong Answer

Accepted
Problem: The door of Snuke's laboratory is locked with a security code.  The security code is a 4-digit number. We say the security code is _hard to enter_ when it contains two consecutive digits that are the same.  You are given the current security code S. If S is hard to enter, print `Bad`; otherwise, print `Good`.

Submission attempts (in order):
s = set(int(input()))
print("Good" if len(s) == 4 else "Bad")

def resolve():
    s = list(input())
    prev = '-1'
    for i in s:
        if i == prev:
            print("Bad")
            return
        prev = i
    print("Good")

resolve()

Verdicts: Runtime Error

Accepted
Problem: The door of Snuke's laboratory is locked with a security code.  The security code is a 4-digit number. We say the security code is _hard to enter_ when it contains two consecutive digits that are the same.  You are given the current security code S. If S is hard to enter, print `Bad`; otherwise, print `Good`.

Submission attempts (in order):
from collections import Counter
code = input()
cnt = 0
for i in range(len(code) - 1):
  if c[i] == c[i + 1]:
    cnt += 1
    break
if cnt:
  print("Bad")
else:
  print("Good")
  

from collections import Counter
code = input()
max_c = Counter(list(code)).most_common()[0]
if max_c > 1:
  print("Bad")
else:
  print("Good")

from collections import Counter
code = input()
cnt = 0
for i in range(len(code) - 1):
  if code[i] == code[i + 1]:
    cnt += 1
    break
if cnt:
  print("Bad")
else:
  print("Good")
  

Verdicts: Runtime Error

Runtime Error

Accepted
Problem: The door of Snuke's laboratory is locked with a security code.  The security code is a 4-digit number. We say the security code is _hard to enter_ when it contains two consecutive digits that are the same.  You are given the current security code S. If S is hard to enter, print `Bad`; otherwise, print `Good`.

Submission attempts (in order):
S=list(input())
N=len(S)
flg=0
for i in range(S-1):
  if S[i]==S[i+1]:
    print("Bad")
    break
if flg:
  print("Good")

S=list(input())
N=len(S)
flg=1
for i in range(N-1):
  if S[i]==S[i+1]:
    print("Bad")
    flg=0
    break
if flg:
  print("Good")

Verdicts: Runtime Error

Accepted
Problem: The door of Snuke's laboratory is locked with a security code.  The security code is a 4-digit number. We say the security code is _hard to enter_ when it contains two consecutive digits that are the same.  You are given the current security code S. If S is hard to enter, print `Bad`; otherwise, print `Good`.

Submission attempts (in order):
S = list(input().split())
for i in range(1, len(S)):
  if S[i-1]==S[i]:
    print("Bad")
    exit()
print("Good")


S = list(input().split())
for i in range(4):
  if S[i]==S[i+1]:
    print("Bad")
    exit()
print("Good")


S = list(map(int, input().rstrip()))
for i in range(3):
  if S[i]==S[i+1]:
    print("Bad")
    exit()
print("Good")

Verdicts: Wrong Answer

Runtime Error

Accepted
Problem: The door of Snuke's laboratory is locked with a security code.  The security code is a 4-digit number. We say the security code is _hard to enter_ when it contains two consecutive digits that are the same.  You are given the current security code S. If S is hard to enter, print `Bad`; otherwise, print `Good`.

Submission attempts (in order):
# -*- coding: utf-8 -*-
import math
def main():
    A,B,C,D = map(int,input().split())
    E = (C*D)//math.gcd(C,D)
    Cc = B / C
    Dd = B / D
    Ee = B / E
    flo = A-1
    Cf = flo / C
    Df = flo / D
    Ef = flo / E
    All = B-(math.floor(Cc)+math.floor(Dd)-math.floor(Ee))
    Sub = flo-(math.floor(Cf)+math.floor(Df)-math.floor(Ef))
    print(All - Sub)
if __name__ == '__main__':
    main()

# -*- coding: utf-8 -*-
import fractions
def lcm(x, y):
    return (x*y) // fractions.gcd(x, y)
def main():
    A,B,C,D = map(int,input().split())
    E = lcm(C,D)
    Cc = B // C
    Dd = B // D
    Ee = B // E
    flo = A-1
    Cf = flo // C
    Df = flo // D
    Ef = flo // E
    All = B-(Cc+Dd-Ee)
    Sub = flo-(Cf+Df-Ef)
    print(int(All - Sub))
if __name__ == '__main__':
    main()

# -*- coding: utf-8 -*-
def main():
    S = list(str(input()))
    #print(S)
    for i in range(len(S)):
        if i == 0:
            t = S[0]
            continue
        else:
            t = S[i-1]
            print(t)
            if t == S[i]:
                print('Bad')
                return
    print('Good')


if __name__ == '__main__':
    main()

# -*- coding: utf-8 -*-
def main():
    S = list(str(input()))
    #print(S)
    for i in range(len(S)):
        if i == 0:
            t = int(S[0])
            continue
        else:
            t = int(S[i-1])
            #print(t)
            if t == int(S[i]):
                print('Bad')
                return
    print('Good')


if __name__ == '__main__':
    main()

Verdicts: Runtime Error

Runtime Error

Wrong Answer

Accepted
Problem: The door of Snuke's laboratory is locked with a security code.  The security code is a 4-digit number. We say the security code is _hard to enter_ when it contains two consecutive digits that are the same.  You are given the current security code S. If S is hard to enter, print `Bad`; otherwise, print `Good`.

Submission attempts (in order):
s = list(int,input())
if s.count(s[0])>=2:
  print("Bad")
elif s.count(s[1])>=2:
  print("Bad")
elif s.count(s[2])>=2:
  print("Bad")
else:
  print("Yes")

s = input()
if s[0]==s[1] or s[1]==s[2] or s[2]==s[3]:
  print("Bad")
else:
  print("Good")

Verdicts: Runtime Error

Accepted
Problem: The door of Snuke's laboratory is locked with a security code.  The security code is a 4-digit number. We say the security code is _hard to enter_ when it contains two consecutive digits that are the same.  You are given the current security code S. If S is hard to enter, print `Bad`; otherwise, print `Good`.

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

result = 'Good'

for i in range(len(password)-1):
  ):
    if password[i] == password[i+1]:
      result = 'Bad'
      break
      
print(result)
  

password = input()

result = 'Good'

for i in range(len(password)-1):
    if password[i] == password[i+1]:
      result = 'Bad'
      break
      
print(result)
  


Verdicts: Runtime Error

Accepted
Problem: The door of Snuke's laboratory is locked with a security code.  The security code is a 4-digit number. We say the security code is _hard to enter_ when it contains two consecutive digits that are the same.  You are given the current security code S. If S is hard to enter, print `Bad`; otherwise, print `Good`.

Submission attempts (in order):
import math
import fractions


def lcm(x, y):
    return (x * y) // fractions.gcd(x, y)


if __name__ == '__main__':
    a, b, c, d = map(int, input().split())
    warikireru_c = b // c - (- (-a // c)) + 1
    warikireru_d = b // d - (-(-a // d)) + 1
    lcm_1 = lcm(c, d)
    warikireru_lcm = b // lcm_1 - (- (-a // lcm_1)) + 1
    num = b - a + 1
    print(num - (warikireru_c + warikireru_d - warikireru_lcm))


import math
import fractions


def lcm(x, y):
    return math.floor((x * y) / fractions.gcd(x, y))


if __name__ == '__main__':
    a, b, c, d = map(int, input().split())
    warikireru_c = math.floor(b / c) - math.ceil(a / c) + 1
    warikireru_d = math.floor(b / d) - math.ceil(a / d) + 1
    lcm_1 = lcm(c, d)
    warikireru_lcm = math.floor(b / lcm_1) - math.ceil(a / lcm_1) + 1
    num = b - a + 1
    print(num - (warikireru_c + warikireru_d - warikireru_lcm))

import math
import fractions


def lcm(x, y):
    return math.floor((x * y) / fractions.gcd(x, y))


if __name__ == '__main__':
    a, b, c, d = map(int, input().split())
    warikireru_c = math.floor(b / c) - math.ceil(a / c) + 1
    warikireru_d = math.floor(b / d) - math.ceil(a / d) + 1
    lcm_1 = lcm(c, d)
    warikireru_lcm = math.floor(b / lcm_1) - math.ceil(a / lcm_1) + 1
    num = b - a + 1
    print(num - (warikireru_c + warikireru_d - warikireru_lcm))


import re

s = input()

if re.findall(r"(.)\1+",s):
    print("Bad")
else:
    print("Good")

Verdicts: Runtime Error

Runtime Error

Runtime Error

Accepted
Problem: The door of Snuke's laboratory is locked with a security code.  The security code is a 4-digit number. We say the security code is _hard to enter_ when it contains two consecutive digits that are the same.  You are given the current security code S. If S is hard to enter, print `Bad`; otherwise, print `Good`.

Submission attempts (in order):
code = input()
ans = "Bad"
if code[0] == code[1] or code[1] == code[2] or code[2] == code[3] or code[3] == code[4]:
    ans = "Good"
print(ans)

code = input()
ans = "Good"
if code[0] == code[1] or code[1] == code[2] or code[2] == code[3]:
    ans = "Bad"
print(ans)

Verdicts: Runtime Error

Accepted
Problem: The door of Snuke's laboratory is locked with a security code.  The security code is a 4-digit number. We say the security code is _hard to enter_ when it contains two consecutive digits that are the same.  You are given the current security code S. If S is hard to enter, print `Bad`; otherwise, print `Good`.

Submission attempts (in order):
S = "3247"
text = "Good"
for i in range(3):
    if S[i] == S[i+1]:
        text = "Bad"
print(text)

def gcd(m,n):
    x = max(m,n)
    y = min(m,n)
    if x%y == 0:
        return y
    else:
        while x%y!=0:
            z = x%y
            x = y
            y = z
        else:
            return z

# import math
a, b, c, d = map(int, input().split())
b_c = int(b/c)
b_d = int(b/d)
cd = int(c * d / gcd(c,d))
b_cd = int(b / cd)
bn = b_c + b_d - b_cd
# print("bn:",bn)
a -= 1
a_c = int(a/c)
a_d = int(a/d)
a_cd = int(a / cd)
an = a_c + a_d - a_cd
# print("an:",an)

num = b - a - (bn - an)
print(num)

S = input()
text = "Good"
for i in range(3):
    if S[i] == S[i+1]:
        text = "Bad"
print(text)

Verdicts: Wrong Answer

Runtime Error

Accepted
Problem: The door of Snuke's laboratory is locked with a security code.  The security code is a 4-digit number. We say the security code is _hard to enter_ when it contains two consecutive digits that are the same.  You are given the current security code S. If S is hard to enter, print `Bad`; otherwise, print `Good`.

Submission attempts (in order):
N = int(input())
L = int(input())
 
aji = [(i+1)+L-1 for i in range(N)]
min = min(list(map(abs, aji)))
print(sum(aji)-min)

input_number = int(input())

a = input_number//1000
b = (input_number-1000*a)//100
c = (input_number-1000*a-100*b)//10
d = input_number-1000*a-100*b-c*10
if a==b;
	print('Bad')
elif b==c;
	print('Bad')
elif c==d;
	print('Bad')
else:
    print('Good')

input_number = int(input())
 
a = input_number//1000
b = (input_number-1000*a)//100
c = (input_number-1000*a-100*b)//10
d = input_number-1000*a-100*b-c*10
if a==b:
	print('Bad')
elif b==c:
	print('Bad')
elif c==d:
	print('Bad')
else:
    print('Good')

Verdicts: Runtime Error

Runtime Error

Accepted
Problem: The door of Snuke's laboratory is locked with a security code.  The security code is a 4-digit number. We say the security code is _hard to enter_ when it contains two consecutive digits that are the same.  You are given the current security code S. If S is hard to enter, print `Bad`; otherwise, print `Good`.

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

counter = 0
ans = ""

for i in a:
    if counter == 0:
        ans = i
    else:
        if ans == i:
            print("Bad")
            exit(0)
    ans = i

print("Good")

a= input()

ans = ""

for i in a:
    if i == "a" or i == "i" or i == "u" or i == "e" or i == "o":
        continue
    ans += i

print(ans)

a = input()

if a[0] != a[1] and a[1] != a[2] and a[2] != a[3]:
    print("Good")
else:
    print("Bad")


Verdicts: Wrong Answer

Wrong Answer

Accepted
Problem: You have N apples, called Apple 1, Apple 2, Apple 3, ..., Apple N. The _flavor_ of Apple i is L+i-1, which can be negative.  You can make an apple pie using one or more of the apples. The flavor of the apple pie will be the sum of the flavors of the apples used.  You planned to make an apple pie using all of the apples, but being hungry tempts you to eat one of them, which can no longer be used to make the apple pie.  You want to make an apple pie that is as similar as possible to the one that you planned to make. Thus, you will choose the apple to eat so that the flavor of the apple pie made of the remaining N-1 apples will have the smallest possible absolute difference from the flavor of the apple pie made of all the N apples.  Find the flavor of the apple pie made of the remaining N-1 apples when you choose the apple to eat as above.  We can prove that this value is uniquely determined.

Submission attempts (in order):
n,l=map(int,input().split())

if l <= 0:
  if -1 * l >= n:
    n -= 1
else:
  l += 1
  n -= 1

print(int(n *(2+l+n-1)/2))

n,l=map(int,input().split())

if l <= 0:
  if -1 * l >= n:
    n -= 1
else:
  l += 1
  n -= 1

print(int(n*(2*l+n-1)/2))

Verdicts: Wrong Answer

Accepted
Problem: You have N apples, called Apple 1, Apple 2, Apple 3, ..., Apple N. The _flavor_ of Apple i is L+i-1, which can be negative.  You can make an apple pie using one or more of the apples. The flavor of the apple pie will be the sum of the flavors of the apples used.  You planned to make an apple pie using all of the apples, but being hungry tempts you to eat one of them, which can no longer be used to make the apple pie.  You want to make an apple pie that is as similar as possible to the one that you planned to make. Thus, you will choose the apple to eat so that the flavor of the apple pie made of the remaining N-1 apples will have the smallest possible absolute difference from the flavor of the apple pie made of all the N apples.  Find the flavor of the apple pie made of the remaining N-1 apples when you choose the apple to eat as above.  We can prove that this value is uniquely determined.

Submission attempts (in order):
N, L = map(int, input().split())
 
if L > -1:
  N_eat = 1
elif N+L-1 < 1:
  N_eat = N
else:
  N_eat = 1-L
 
pie = N*(N+1)/2 +N*(L-1) - (L + N_eat-1) 
print(pie)

N, L = map(int, input().split())
 
if L > -1:
  N_eat = 1
elif N+L-1 < 1:
  N_eat = N
else:
  N_eat = 1-L
pie = N*N/2 +N*(L-1) - (L + N_eat-1) 
print(pie)

N, L = map(int, input().split() )

if L > -1:
  N_eat = 1
elif N+L-1 < 1:
  N_eat = N
else:
  N_eat = 1-L
 
pie = N*(N+1)/2 +N*(L-1) - (L + N_eat-1) 
print("{}".format(pie) )

N, L = map(int, input().split())

if L >= 0:
  N_eat = 1
elif N+L-1 <= 0:
  N_eat = N
else:
  N_eat = 1-L
pie = double(N*N/2 +N*(L-1) - (L + N_eat-1) ) 
print(pie)


N, L = map(int, input().split())
 
if L > -1:
  N_eat = 1
elif N+L-1 < 1:
  N_eat = N
else:
  N_eat = 1-L
 
pie = N*(N+1)/2 +N*(L-1) - (L + N_eat-1) 
print("{}".format(pie) )

N, L = map(int, input().split())
 
if L > -1:
  N_eat = 1
elif N+L-1 < 1:
  N_eat = N
else:
  N_eat = 1-L
 
pie = N*(N+1)/2 +N*(L-1) - (L + N_eat-1) 
print(int(pie) )

Verdicts: Wrong Answer

Wrong Answer

Wrong Answer

Runtime Error

Wrong Answer

Accepted
Problem: You have N apples, called Apple 1, Apple 2, Apple 3, ..., Apple N. The _flavor_ of Apple i is L+i-1, which can be negative.  You can make an apple pie using one or more of the apples. The flavor of the apple pie will be the sum of the flavors of the apples used.  You planned to make an apple pie using all of the apples, but being hungry tempts you to eat one of them, which can no longer be used to make the apple pie.  You want to make an apple pie that is as similar as possible to the one that you planned to make. Thus, you will choose the apple to eat so that the flavor of the apple pie made of the remaining N-1 apples will have the smallest possible absolute difference from the flavor of the apple pie made of all the N apples.  Find the flavor of the apple pie made of the remaining N-1 apples when you choose the apple to eat as above.  We can prove that this value is uniquely determined.

Submission attempts (in order):
n ,l =map(int,input().split())
aji = []

apple = min(range(l,l+n),key=abs)
print(sum(aji)-apple)


n ,l =map(int,input().split())
aji = []

apple = min(range(l,l+n),key=abs)
print(sum(range(l,l+n))-apple)

Verdicts: Wrong Answer

Accepted
Problem: You have N apples, called Apple 1, Apple 2, Apple 3, ..., Apple N. The _flavor_ of Apple i is L+i-1, which can be negative.  You can make an apple pie using one or more of the apples. The flavor of the apple pie will be the sum of the flavors of the apples used.  You planned to make an apple pie using all of the apples, but being hungry tempts you to eat one of them, which can no longer be used to make the apple pie.  You want to make an apple pie that is as similar as possible to the one that you planned to make. Thus, you will choose the apple to eat so that the flavor of the apple pie made of the remaining N-1 apples will have the smallest possible absolute difference from the flavor of the apple pie made of all the N apples.  Find the flavor of the apple pie made of the remaining N-1 apples when you choose the apple to eat as above.  We can prove that this value is uniquely determined.

Submission attempts (in order):
N,L = map(int,input().split())
if L > 0:
    k = N*(L-1) + (N * (N+1))//2 - L
    print(k)
if L == 0:
    print( (N-1) * N //2)
else: 
    if L+N-1 >=0:
        k = N*(L-1) + (N * (N+1))//2
        print(k)
    else:
        k = N*(L-1) + (N * (N+1))//2 - (L+N-1)
        print(k)

if L > 0:
    k = N*(L-1) + (N * (N+1))//2 - L
    print(k)
elif L == 0:
    print( (N-1) * N //2)
else: 
    if L+N-1 >=0:
        k = N*(L-1) + (N * (N+1))//2
        print(k)
    else:
        k = N*(L-1) + (N * (N+1))//2 - (L+N-1)
        print(k)

N,L = map(int,input().split())
if L > 0:
    k = N*(L-1) + (N * (N+1))//2 - L
    print(k)
elif L == 0:
    print( (N-1) * N //2)
else: 
    if L+N-1 >=0:
        k = N*(L-1) + (N * (N+1))//2
        print(k)
    else:
        k = N*(L-1) + (N * (N+1))//2 - (L+N-1)
        print(k)

Verdicts: Wrong Answer

Runtime Error

Accepted
Problem: You have N apples, called Apple 1, Apple 2, Apple 3, ..., Apple N. The _flavor_ of Apple i is L+i-1, which can be negative.  You can make an apple pie using one or more of the apples. The flavor of the apple pie will be the sum of the flavors of the apples used.  You planned to make an apple pie using all of the apples, but being hungry tempts you to eat one of them, which can no longer be used to make the apple pie.  You want to make an apple pie that is as similar as possible to the one that you planned to make. Thus, you will choose the apple to eat so that the flavor of the apple pie made of the remaining N-1 apples will have the smallest possible absolute difference from the flavor of the apple pie made of all the N apples.  Find the flavor of the apple pie made of the remaining N-1 apples when you choose the apple to eat as above.  We can prove that this value is uniquely determined.

Submission attempts (in order):
N, L = list(map(int, input().split()))
resultList = []
tasteList = []
for i in range(N):
    x = int(L + i)
    resultList.append(x)
    tasteList.append(abs(x))

listMin = min(tasteList)
listNum = tasteList.index(listMin)
if tasteList[listNum] > 0:
    listSum = sum(resultList) + listMin
else:
    listSum = sum(resultList) - listMin

print(listSum)

N, L = list(map(int, input().split()))
resultList = []
tasteList = []
for i in range(N):
    x = int(L + i)
    resultList.append(x)
    tasteList.append(abs(x))

listMin = min(tasteList)
listNum = tasteList.index(listMin)
if tasteList[listNum] > 0:
    listSum = sum(resultList) + listMin
else:
    listSum = sum(resultList) - listMin

print(listSum)

N, L = list(map(int, input().split()))
resultList = []
tasteList = []
for i in range(N):
    x = int(L + i)
    resultList.append(x)
    tasteList.append(abs(x))

listMin = min(tasteList)
listNum = tasteList.index(listMin)

if resultList[listNum] > 0:
    listSum = sum(resultList) - listMin
else:
    listSum = sum(resultList) + listMin

print(listSum)

Verdicts: Wrong Answer

Wrong Answer

Accepted
Problem: You have N apples, called Apple 1, Apple 2, Apple 3, ..., Apple N. The _flavor_ of Apple i is L+i-1, which can be negative.  You can make an apple pie using one or more of the apples. The flavor of the apple pie will be the sum of the flavors of the apples used.  You planned to make an apple pie using all of the apples, but being hungry tempts you to eat one of them, which can no longer be used to make the apple pie.  You want to make an apple pie that is as similar as possible to the one that you planned to make. Thus, you will choose the apple to eat so that the flavor of the apple pie made of the remaining N-1 apples will have the smallest possible absolute difference from the flavor of the apple pie made of all the N apples.  Find the flavor of the apple pie made of the remaining N-1 apples when you choose the apple to eat as above.  We can prove that this value is uniquely determined.

Submission attempts (in order):
N , X =map(int,input().split())
sums = []
i = X
result =[]
a = []
for i in range(N):
    sums.append(i+X)
for j in range(N):
    a.append(abs(sums[j]))

print(sum(sums) - min(a) * 2)


N , X =map(int,input().split())
sums = []
i = X
result =[]
for i in range(N):
    sums.append(i+X)
for j in range(N):
    result.append(sum(sums)-sums[j]*2 )
for k in range(N):
    if sum(sums) == result[k]:
        print(result[k])
    else:
        print(abs(min(result[k])))


N , X =map(int,input().split())
sums = []
i = X
result =[]
a = []
for i in range(N):
    sums.append(i+X)
for j in range(N):
    a.append(abs(sums[j]))

if sum(sums) ==abs(sum(sums)):
    print(sum(sums) - min(a))
else :
    print(sum(sums) + min(a))


Verdicts: Wrong Answer

Runtime Error

Accepted
Problem: You have N apples, called Apple 1, Apple 2, Apple 3, ..., Apple N. The _flavor_ of Apple i is L+i-1, which can be negative.  You can make an apple pie using one or more of the apples. The flavor of the apple pie will be the sum of the flavors of the apples used.  You planned to make an apple pie using all of the apples, but being hungry tempts you to eat one of them, which can no longer be used to make the apple pie.  You want to make an apple pie that is as similar as possible to the one that you planned to make. Thus, you will choose the apple to eat so that the flavor of the apple pie made of the remaining N-1 apples will have the smallest possible absolute difference from the flavor of the apple pie made of all the N apples.  Find the flavor of the apple pie made of the remaining N-1 apples when you choose the apple to eat as above.  We can prove that this value is uniquely determined.

Submission attempts (in order):
n, l = [int(s) for s in input().split(" ")]

rng = list(range(l, l+n))

min_abs = 0
val = 0
for r in rng:
  if min_abs > abs(r):
    min_abs = abs(r)
    val = r

print(sum(rng) - val)

n, l= [int(s) for s in input().split(" ")]

rng = list(range(l, l+n))
min_abs = 400
val = 0
for r in rng:
  if min_abs > abs(r):
    min_abs = abs(r)
    val = r

print(sum(rng) - val)

Verdicts: Wrong Answer

Accepted
Problem: You have N apples, called Apple 1, Apple 2, Apple 3, ..., Apple N. The _flavor_ of Apple i is L+i-1, which can be negative.  You can make an apple pie using one or more of the apples. The flavor of the apple pie will be the sum of the flavors of the apples used.  You planned to make an apple pie using all of the apples, but being hungry tempts you to eat one of them, which can no longer be used to make the apple pie.  You want to make an apple pie that is as similar as possible to the one that you planned to make. Thus, you will choose the apple to eat so that the flavor of the apple pie made of the remaining N-1 apples will have the smallest possible absolute difference from the flavor of the apple pie made of all the N apples.  Find the flavor of the apple pie made of the remaining N-1 apples when you choose the apple to eat as above.  We can prove that this value is uniquely determined.

Submission attempts (in order):
import io
import sys


def IN_S():
  return input()


def IN_I():
  return int(input())


def IN_L_I():
  return list(map(int, input().split()))


def IN_L_S():
  return list(map(str, input().split()))


def STR_SPLIT(s, n):
  for l in range(0, len(s), n):
    yield s[0 + l:n + l]


def T_IN():
  global test_str
  sys.stdin = io.StringIO(test_str[1:-1])


test_str = '''
5 2
'''


def MAIN():
  # T_IN()
  A()


def A():
  n, l = IN_L_I()
  li = list([ i + l for i in range(0,  n)])
  # print(li)
  if li.count(0) == 0:
    if abs(li[0]) > abs(li[-1]):
      li.pop(-1)
    else:
      li = li[0:-1]
  # print(li)
  print(sum(li))

  return None
 

def B():
  return None


def C():
  return None


MAIN()


import io
import sys


def IN_S():
  return input()


def IN_I():
  return int(input())


def IN_L_I():
  return list(map(int, input().split()))


def IN_L_S():
  return list(map(str, input().split()))


def STR_SPLIT(s, n):
  for l in range(0, len(s), n):
    yield s[0 + l:n + l]


def T_IN():
  global test_str
  sys.stdin = io.StringIO(test_str[1:-1])


test_str = '''
5 2
'''


def MAIN():
  # T_IN()
  A()


def A():
  n, l = IN_L_I()
  li = list([ i + l for i in range(0,  n)])
  if li.count(0) == 0:
    j = li.pop(0)
    k = li.pop(-1)
    if abs(j) < abs(k):
      li.append(k)
    else:
      li.append(j)

  print(sum(li))

  return None
 

def B():
  return None


def C():
  return None


MAIN()


Verdicts: Wrong Answer

Accepted
Problem: You have N apples, called Apple 1, Apple 2, Apple 3, ..., Apple N. The _flavor_ of Apple i is L+i-1, which can be negative.  You can make an apple pie using one or more of the apples. The flavor of the apple pie will be the sum of the flavors of the apples used.  You planned to make an apple pie using all of the apples, but being hungry tempts you to eat one of them, which can no longer be used to make the apple pie.  You want to make an apple pie that is as similar as possible to the one that you planned to make. Thus, you will choose the apple to eat so that the flavor of the apple pie made of the remaining N-1 apples will have the smallest possible absolute difference from the flavor of the apple pie made of all the N apples.  Find the flavor of the apple pie made of the remaining N-1 apples when you choose the apple to eat as above.  We can prove that this value is uniquely determined.

Submission attempts (in order):
N,L = map(int, input().split())

apple = [L+i for i in range(N)]
print(apple)
min = 500
for k in range(len(apple)):
    if abs(apple[k])<min:
        min = abs(apple[k])

apple.remove(min)
print(sum(apple))

N,L = map(int, input().split())

apple = [L+i for i in range(N)]
print(apple)
min = 500
for k in range(len(apple)):
    if abs(apple[k])<abs(min):
        min = apple[k]

apple.remove(min)
print(sum(apple))

N,L = map(int, input().split())

apple = [L+i for i in range(N)]
min = 500
for k in range(len(apple)):
    if abs(apple[k])<abs(min):
        min = apple[k]

apple.remove(min)
print(sum(apple))

Verdicts: Runtime Error

Wrong Answer

Accepted
Problem: You have N apples, called Apple 1, Apple 2, Apple 3, ..., Apple N. The _flavor_ of Apple i is L+i-1, which can be negative.  You can make an apple pie using one or more of the apples. The flavor of the apple pie will be the sum of the flavors of the apples used.  You planned to make an apple pie using all of the apples, but being hungry tempts you to eat one of them, which can no longer be used to make the apple pie.  You want to make an apple pie that is as similar as possible to the one that you planned to make. Thus, you will choose the apple to eat so that the flavor of the apple pie made of the remaining N-1 apples will have the smallest possible absolute difference from the flavor of the apple pie made of all the N apples.  Find the flavor of the apple pie made of the remaining N-1 apples when you choose the apple to eat as above.  We can prove that this value is uniquely determined.

Submission attempts (in order):
n,l=map(int,input().split())
A=l-1+n*(n-1)//2
if 1<=1-l and 1-l<=n:
  print(A)
elif 1>1-l:
  print(A-(l-2))
else:
  print(A-n+1-l)

n,l=map(int,input().split())
A=n*(l-1)+n*(n+1)//2
if 1<=1-l and 1-l<=n:
  print(A)
elif 1>1-l:
  print(A-l)
else:
  print(A-n+1-l)


Verdicts: Wrong Answer

Accepted
Problem: You have N apples, called Apple 1, Apple 2, Apple 3, ..., Apple N. The _flavor_ of Apple i is L+i-1, which can be negative.  You can make an apple pie using one or more of the apples. The flavor of the apple pie will be the sum of the flavors of the apples used.  You planned to make an apple pie using all of the apples, but being hungry tempts you to eat one of them, which can no longer be used to make the apple pie.  You want to make an apple pie that is as similar as possible to the one that you planned to make. Thus, you will choose the apple to eat so that the flavor of the apple pie made of the remaining N-1 apples will have the smallest possible absolute difference from the flavor of the apple pie made of all the N apples.  Find the flavor of the apple pie made of the remaining N-1 apples when you choose the apple to eat as above.  We can prove that this value is uniquely determined.

Submission attempts (in order):
import bisect

N,L = map(int,input().split())

L_list =[]

for i in range(1,N+1):
    L_list.append(L+i-1)

L_list.sort()

index = bisect.bisect_left(L_list, 0)

if index == N :
    L_list.pop(index-1)

print(sum(L_list))


N,L = map(int, input().split())

N_list = [ i for i in range(1,N+1)]

aaa_list = []

for i in range(1,N+1):
    aaa_list.append(L+i-1)

print(sum(aaa_list)-min(list_aaa,key=lambda x: abs(x)))


N,L = map(int, input().split())

N_list = [ i for i in range(1,N+1)]

aaa_list = []

for i in range(1,N+1):
    aaa_list.append(L+i-1)

print(sum(aaa_list)-min(aaa_list,key=lambda x: abs(x)))

Verdicts: Wrong Answer

Runtime Error

Accepted
Problem: You have N apples, called Apple 1, Apple 2, Apple 3, ..., Apple N. The _flavor_ of Apple i is L+i-1, which can be negative.  You can make an apple pie using one or more of the apples. The flavor of the apple pie will be the sum of the flavors of the apples used.  You planned to make an apple pie using all of the apples, but being hungry tempts you to eat one of them, which can no longer be used to make the apple pie.  You want to make an apple pie that is as similar as possible to the one that you planned to make. Thus, you will choose the apple to eat so that the flavor of the apple pie made of the remaining N-1 apples will have the smallest possible absolute difference from the flavor of the apple pie made of all the N apples.  Find the flavor of the apple pie made of the remaining N-1 apples when you choose the apple to eat as above.  We can prove that this value is uniquely determined.

Submission attempts (in order):
n, l = map(int, input().split())
a = [l + i for i in range(n)]
if l + n - 2 < 0:
    a.pop(n - 1)
elif l > 0:
    a.pop(0)
    print(a)
print(sum(a))

n, l = map(int, input().split())
a = [l + i for i in range(n)]
if l + n - 1 < 0:
    a.pop(n - 1)
elif l > 0:
    a.pop(0)
    print(a)
print(sum(a))

n, l = map(int, input().split())
a = [l + i for i in range(n)]
if l + n - 1 < 0:
    a.pop(n - 1)
elif l > 0:
    a.pop(0)
print(sum(a))

Verdicts: Wrong Answer

Wrong Answer

Accepted
Problem: You have N apples, called Apple 1, Apple 2, Apple 3, ..., Apple N. The _flavor_ of Apple i is L+i-1, which can be negative.  You can make an apple pie using one or more of the apples. The flavor of the apple pie will be the sum of the flavors of the apples used.  You planned to make an apple pie using all of the apples, but being hungry tempts you to eat one of them, which can no longer be used to make the apple pie.  You want to make an apple pie that is as similar as possible to the one that you planned to make. Thus, you will choose the apple to eat so that the flavor of the apple pie made of the remaining N-1 apples will have the smallest possible absolute difference from the flavor of the apple pie made of all the N apples.  Find the flavor of the apple pie made of the remaining N-1 apples when you choose the apple to eat as above.  We can prove that this value is uniquely determined.

Submission attempts (in order):
import numpy as np
from numba import jit
@jit
n,l=map(int,input().split())
a = np.arange(l,l+n)
d = abs(a).argmin() 
print(a.sum() - a[d])

import numpy as np
a = np.arange(L, L + N)
d = abs(a).argmin() 
print(a.sum() - a[d])

import numpy as np
n,l=map(int,input().split())
a = np.arange(l,l+n)
d = abs(a).argmin() 
print(a.sum() - a[d])

Verdicts: Runtime Error

Runtime Error

Accepted
Problem: You have N apples, called Apple 1, Apple 2, Apple 3, ..., Apple N. The _flavor_ of Apple i is L+i-1, which can be negative.  You can make an apple pie using one or more of the apples. The flavor of the apple pie will be the sum of the flavors of the apples used.  You planned to make an apple pie using all of the apples, but being hungry tempts you to eat one of them, which can no longer be used to make the apple pie.  You want to make an apple pie that is as similar as possible to the one that you planned to make. Thus, you will choose the apple to eat so that the flavor of the apple pie made of the remaining N-1 apples will have the smallest possible absolute difference from the flavor of the apple pie made of all the N apples.  Find the flavor of the apple pie made of the remaining N-1 apples when you choose the apple to eat as above.  We can prove that this value is uniquely determined.

Submission attempts (in order):
n,l=map(int,input().split())
s=int(n*(n+l*2)/2)
m=[]
for i in range(n):
    m.append(abs(s-l+i))
print(min(m))

n,l=map(int,input().split())
L=[i+l for i in range(n)]
s=sum(L)
absorute=1000
m=0
for i in L:
    if absorute>abs(i):
        absorute=abs(i)
        m=i
print(s-m)

Verdicts: Wrong Answer

Accepted
Problem: You have N apples, called Apple 1, Apple 2, Apple 3, ..., Apple N. The _flavor_ of Apple i is L+i-1, which can be negative.  You can make an apple pie using one or more of the apples. The flavor of the apple pie will be the sum of the flavors of the apples used.  You planned to make an apple pie using all of the apples, but being hungry tempts you to eat one of them, which can no longer be used to make the apple pie.  You want to make an apple pie that is as similar as possible to the one that you planned to make. Thus, you will choose the apple to eat so that the flavor of the apple pie made of the remaining N-1 apples will have the smallest possible absolute difference from the flavor of the apple pie made of all the N apples.  Find the flavor of the apple pie made of the remaining N-1 apples when you choose the apple to eat as above.  We can prove that this value is uniquely determined.

Submission attempts (in order):
n, l = map(int, input().split())

if l+n-1<=-1:
  print((n-1)*l + (n-2)*(n-1)/2)
  
elif l>=1:
  print((n-1)*l + n*(n-1)/2)
  
else:
  print(l*n + (n-1)*n/2)


n, l = map(int, input().split())

if l+n<=-1:
  print((n-1)*l + (n-2)*(n-1)/2)
  
elif l>=1:
  print((n-1)*l + n*(n-1)/2)
  
else:
  print(l*n + (n-1)*n/2)

n, l = map(int, input().split())

if l+n-1<=-1:
  print(int((n-1)*l + (n-2)*(n-1)/2))
  
elif l>=1:
  print(int((n-1)*l + n*(n-1)/2))
  
else:
  print(int(l*n + (n-1)*n/2))


Verdicts: Wrong Answer

Wrong Answer

Accepted
Problem: You have N apples, called Apple 1, Apple 2, Apple 3, ..., Apple N. The _flavor_ of Apple i is L+i-1, which can be negative.  You can make an apple pie using one or more of the apples. The flavor of the apple pie will be the sum of the flavors of the apples used.  You planned to make an apple pie using all of the apples, but being hungry tempts you to eat one of them, which can no longer be used to make the apple pie.  You want to make an apple pie that is as similar as possible to the one that you planned to make. Thus, you will choose the apple to eat so that the flavor of the apple pie made of the remaining N-1 apples will have the smallest possible absolute difference from the flavor of the apple pie made of all the N apples.  Find the flavor of the apple pie made of the remaining N-1 apples when you choose the apple to eat as above.  We can prove that this value is uniquely determined.

Submission attempts (in order):
N,L=map(int,input().split())
taste_abs=[]
taste=[]
for i in range(N):
    taste_abs.append(abs(L+i))
    taste.append(L+i)
    print(taste[i])
    
a=taste_abs.index(min(taste_abs))
b=sum(taste)-taste[a]
print(b)


N,L=map(int,input().split())
taste_abs=[]
taste=[]
for i in range(N):
    taste_abs.append(abs(L+i))
    taste.append(L+i)
    
a=taste_abs.index(min(taste_abs))
b=sum(taste)-taste[a]
print(b)


Verdicts: Wrong Answer

Accepted
Problem: You have N apples, called Apple 1, Apple 2, Apple 3, ..., Apple N. The _flavor_ of Apple i is L+i-1, which can be negative.  You can make an apple pie using one or more of the apples. The flavor of the apple pie will be the sum of the flavors of the apples used.  You planned to make an apple pie using all of the apples, but being hungry tempts you to eat one of them, which can no longer be used to make the apple pie.  You want to make an apple pie that is as similar as possible to the one that you planned to make. Thus, you will choose the apple to eat so that the flavor of the apple pie made of the remaining N-1 apples will have the smallest possible absolute difference from the flavor of the apple pie made of all the N apples.  Find the flavor of the apple pie made of the remaining N-1 apples when you choose the apple to eat as above.  We can prove that this value is uniquely determined.

Submission attempts (in order):
N, L = map(int, input().strip().split())

if L > 0:
  print(sum([i + L for i in range(1, N)]))
if L + N > 0:
  print(sum([i + L for i in range(0, N)]))
else:
  print(sum([i + L for i in range(0, N - 1)]))


N, L = map(int, input().strip().split())

if L > 0:
  print(sum([i + L for i in range(1, N)]))
elif L + N > 0:
  print(sum([i + L for i in range(0, N)]))
else:
  print(sum([i + L for i in range(0, N - 1)]))

Verdicts: Wrong Answer

Accepted
Problem: You have N apples, called Apple 1, Apple 2, Apple 3, ..., Apple N. The _flavor_ of Apple i is L+i-1, which can be negative.  You can make an apple pie using one or more of the apples. The flavor of the apple pie will be the sum of the flavors of the apples used.  You planned to make an apple pie using all of the apples, but being hungry tempts you to eat one of them, which can no longer be used to make the apple pie.  You want to make an apple pie that is as similar as possible to the one that you planned to make. Thus, you will choose the apple to eat so that the flavor of the apple pie made of the remaining N-1 apples will have the smallest possible absolute difference from the flavor of the apple pie made of all the N apples.  Find the flavor of the apple pie made of the remaining N-1 apples when you choose the apple to eat as above.  We can prove that this value is uniquely determined.

Submission attempts (in order):
from sys import stdin


def main():
    N, L = [int(x) for x in stdin.readline().rstrip().split()]

    apple_list = []

    for i in range(N):
        apple_list.append(L+i)

    s = sorted(apple_list, key=abs)
    s.pop(0)
    print(sum(s))
    //print(123)


if __name__ == "__main__":
    main()


from sys import stdin


def main():
    N, L = [int(x) for x in stdin.readline().rstrip().split()]

    apple_list = []

    for i in range(N):
        apple_list.append(L+i)

    s = sorted(apple_list, key=abs)
    s.pop(0)
    print(sum(s))


if __name__ == "__main__":
    main()


Verdicts: Runtime Error

Accepted
Problem: You have N apples, called Apple 1, Apple 2, Apple 3, ..., Apple N. The _flavor_ of Apple i is L+i-1, which can be negative.  You can make an apple pie using one or more of the apples. The flavor of the apple pie will be the sum of the flavors of the apples used.  You planned to make an apple pie using all of the apples, but being hungry tempts you to eat one of them, which can no longer be used to make the apple pie.  You want to make an apple pie that is as similar as possible to the one that you planned to make. Thus, you will choose the apple to eat so that the flavor of the apple pie made of the remaining N-1 apples will have the smallest possible absolute difference from the flavor of the apple pie made of all the N apples.  Find the flavor of the apple pie made of the remaining N-1 apples when you choose the apple to eat as above.  We can prove that this value is uniquely determined.

Submission attempts (in order):
n,l=map(int,input().split())
ans=(2*l+n-2)*n//2
if l-1>=0:
  ans-=l
elif l-1<=0 and abs(l-1)>=n:
  ans-=l+n-1
print(ans)

n,l=map(int,input().split())
ans=(2*l+n-1)*n//2
if l-1>=0:
  ans-=l
elif l-1<=0 and abs(l-1)>=n:
  ans-=l+n-1
print(ans)

Verdicts: Wrong Answer

Accepted
Problem: You have N apples, called Apple 1, Apple 2, Apple 3, ..., Apple N. The _flavor_ of Apple i is L+i-1, which can be negative.  You can make an apple pie using one or more of the apples. The flavor of the apple pie will be the sum of the flavors of the apples used.  You planned to make an apple pie using all of the apples, but being hungry tempts you to eat one of them, which can no longer be used to make the apple pie.  You want to make an apple pie that is as similar as possible to the one that you planned to make. Thus, you will choose the apple to eat so that the flavor of the apple pie made of the remaining N-1 apples will have the smallest possible absolute difference from the flavor of the apple pie made of all the N apples.  Find the flavor of the apple pie made of the remaining N-1 apples when you choose the apple to eat as above.  We can prove that this value is uniquely determined.

Submission attempts (in order):
N, L = map(int, input().split())

apple = [L + n for n in range(N)]
eat_apple = min(map(abs, apple))
print(sum(apple) + eat_apple)


N, L = map(int, input().split())

L_max= N + L -1
ans = (L + L_max) * N // 2

if L * L_max <= 0:
    print(ans)
elif ans > 0:
    print(ans - L)
else:
    print(ans - L_max)


Verdicts: Wrong Answer

Accepted
Problem: You have N apples, called Apple 1, Apple 2, Apple 3, ..., Apple N. The _flavor_ of Apple i is L+i-1, which can be negative.  You can make an apple pie using one or more of the apples. The flavor of the apple pie will be the sum of the flavors of the apples used.  You planned to make an apple pie using all of the apples, but being hungry tempts you to eat one of them, which can no longer be used to make the apple pie.  You want to make an apple pie that is as similar as possible to the one that you planned to make. Thus, you will choose the apple to eat so that the flavor of the apple pie made of the remaining N-1 apples will have the smallest possible absolute difference from the flavor of the apple pie made of all the N apples.  Find the flavor of the apple pie made of the remaining N-1 apples when you choose the apple to eat as above.  We can prove that this value is uniquely determined.

Submission attempts (in order):
n,k=map(int,input().split())
ans=10000
for i in range(n):
  ans=min(ans,abs(k+i))
print(n*k+(n-2)*(n-1)//2-ans)


n,k=map(int,input().split())
ju=False
for i in range(n):
  if k+i==0:
    ju=True
    break
ans=0
if ju:
  if k<0:
    for i in range(n-1):
      ans+=k+i
  else:
    for i in range(1,n):
      ans+=k+i
else:
  for i in range(n):
    ans+=k+i
print(ans)


n,k=map(int,input().split())
ju=False
for i in range(n):
  if k+i==0:
    ju=True
    break
ans=0
if not ju:
  if k<0:
    for i in range(n-1):
      ans+=k+i
  else:
    for i in range(1,n):
      ans+=k+i
else:
  for i in range(n):
    ans+=k+i
print(ans)


Verdicts: Wrong Answer

Wrong Answer

Accepted
Problem: You have N apples, called Apple 1, Apple 2, Apple 3, ..., Apple N. The _flavor_ of Apple i is L+i-1, which can be negative.  You can make an apple pie using one or more of the apples. The flavor of the apple pie will be the sum of the flavors of the apples used.  You planned to make an apple pie using all of the apples, but being hungry tempts you to eat one of them, which can no longer be used to make the apple pie.  You want to make an apple pie that is as similar as possible to the one that you planned to make. Thus, you will choose the apple to eat so that the flavor of the apple pie made of the remaining N-1 apples will have the smallest possible absolute difference from the flavor of the apple pie made of all the N apples.  Find the flavor of the apple pie made of the remaining N-1 apples when you choose the apple to eat as above.  We can prove that this value is uniquely determined.

Submission attempts (in order):
N,L = map(int,input().split())
s = []
for i in range(N):
    s.append(L+i)
ans_pre = abs(np.array([s]))
if L + N < 0:
    print(-1*(sum(ans_pre[0])-min(ans_pre[0])))
else:
    print(sum(s)-min(ans_pre[0]))

import numpy as np
N,L = map(int,input().split())
s = []
for i in range(N):
    s.append(L+i)
ans_pre = abs(np.array([s]))
if L + N <= 0:
    print(-1*(sum(ans_pre[0])-min(ans_pre[0])))
else:
    print(sum(s)-min(ans_pre[0]))

Verdicts: Runtime Error

Accepted
Problem: You have N apples, called Apple 1, Apple 2, Apple 3, ..., Apple N. The _flavor_ of Apple i is L+i-1, which can be negative.  You can make an apple pie using one or more of the apples. The flavor of the apple pie will be the sum of the flavors of the apples used.  You planned to make an apple pie using all of the apples, but being hungry tempts you to eat one of them, which can no longer be used to make the apple pie.  You want to make an apple pie that is as similar as possible to the one that you planned to make. Thus, you will choose the apple to eat so that the flavor of the apple pie made of the remaining N-1 apples will have the smallest possible absolute difference from the flavor of the apple pie made of all the N apples.  Find the flavor of the apple pie made of the remaining N-1 apples when you choose the apple to eat as above.  We can prove that this value is uniquely determined.

Submission attempts (in order):
n,l = map(int, input().split())
a = []
ans = 0
for i in range(1, n+1):
  a.append([l + i - 1, abs(l + i - 1)])
a = sorted(a, key = lambda x:x[1], reverse = True)
a.pop()
for _ in range(n-1):
  ans += a[0]
print(ans)



n,l = map(int, input().split())
a = []
ans = 0
for i in range(1, n+1):
  a.append([l + i - 1, abs(l + i - 1)])
a = sorted(a, key = lambda x:x[1], reverse = True)
a.pop()
for i in range(n-1):
  ans += a[i][0]
print(ans)

Verdicts: Runtime Error

Accepted
Problem: You have N apples, called Apple 1, Apple 2, Apple 3, ..., Apple N. The _flavor_ of Apple i is L+i-1, which can be negative.  You can make an apple pie using one or more of the apples. The flavor of the apple pie will be the sum of the flavors of the apples used.  You planned to make an apple pie using all of the apples, but being hungry tempts you to eat one of them, which can no longer be used to make the apple pie.  You want to make an apple pie that is as similar as possible to the one that you planned to make. Thus, you will choose the apple to eat so that the flavor of the apple pie made of the remaining N-1 apples will have the smallest possible absolute difference from the flavor of the apple pie made of all the N apples.  Find the flavor of the apple pie made of the remaining N-1 apples when you choose the apple to eat as above.  We can prove that this value is uniquely determined.

Submission attempts (in order):
n, l = [int(i) for i in input().split()]
ans = (l-1)*n+n*(n+1)//2
if l-1<=0 and l-1+n>=0:
  print(ans)
elif l+n-1<0:
  print(ans-(l+n-1))
elif l-1 >0:
  print(ans-l+1)

n, l = [int(i) for i in input().split()]
ans = (l-1)*n+n*(n+1)//2
if l<=0 and l-1+n>=0:
  print(ans)
elif l+n-1<0:
  print(ans-(l+n-1))
elif l >0:
  print(ans-l)

Verdicts: Wrong Answer

Accepted