Problem:


Score : 100 points

Problem Statement

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.

Constraints

S is a 4-character string consisting of digits.

Input

Input is given from Standard Input in the following format:

S

Output

If S is hard to enter, print Bad; otherwise, print Good.

Sample Input 1

3776

Sample Output 1

Bad

The second and third digits are the same, so 3776 is hard to enter.

Sample Input 2

8080

Sample Output 2

Good

There are no two consecutive digits that are the same, so 8080 is not hard to enter.

Sample Input 3

1333

Sample Output 3

Bad

Sample Input 4

0024

Sample Output 4

Bad



Sample input:
3776


Sample output:
Bad

Submission status: Runtime Error

Solution code:
a,b,c,d = map(int,input().split())
count = 0
e = b - a
for i in range(a,d):
    if(i % c != 0 and i % d != 0):
        count += 1
for i in range(d,b + 1):
    if(i % c != 0 and i % d != 0):
        count += 1 
print(count)

Submission status: Runtime Error

Solution code:
A, B, C, D = map(int, input().split())
p = 0
cntC = int(B / C) - int(A / C)
cntD = int(B / D) - int(A / D)

#a,bの最大公約数
def gcd(C, D):
    while D:
        C, D = D, C % D
    return C

#a,bの最小公倍数
def lcm(C, D):
    return C * D // gcd (C, D)


CD = lcm(C, D)

cntCD = int(B / CD) - int(A / CD)

# print(cntC, cntD, cntCD, CD)
calc = (B-A+1) - (cntC + cntD - cntCD)

if (A % C) == 0 and (B % D) == 0:
        calc -= 1

print(calc)

Submission status: Runtime Error

Solution code:
A , B , C , D = map(int,input().split())
lst = []
list= [i for i in range(A,B) i % C != 0]
for i in list:
    if  i % D != 0:
        lst.append(i)
print(len(lst))

Submission status: Runtime Error

Solution code:
n = int(input())
l = [list(map(int, input().split())) for i in range(n)]
'''for i in range(n):
  x = l[i][1] - l[i][0]
  l[i][2] = x'''
l.sort(key=lambda x: x[1])
#print(l)

check = []
c = 0
for i in range(n):
  if c != l[i][1]:
    check.append(l[i][1])
    c = l[i][1]
#print(check)

sum_t = 0
limit = l[0][1]
ans = 0
for i in range(n):
  if limit != l[i][1]:
    limit = l[i][1]
  sum_t += l[i][0]
  if sum_t > limit:
    ans += 1
#print(ans)
if ans == 0:
  print("Yes")
else:
  print("No")

Submission status: Runtime Error

Solution code:
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)

Submission status: Runtime Error

Solution code:
import fractions

a,b,c,d = map(int,input().split())
lcm = c * d // fractions.gcd(c , d) 

if a % c == 0:
    c_start = int(a/c)
else:
    c_start = int(a/c)+1

if a % d == 0:
    d_start = int(a/d)
else:
    d_start = int(a/d)+1

if a % lcm == 0:
        lcm_start = int(a/lcm)
else:
        lcm_start = int(a/lcm)+1

c_end = int(b/c)
d_end = int(b/d)
lcm_end = int(b/lcm)

c_num = c_end - c_start + 1
d_num = d_end - d_start + 1
lcm_num=lcm_end - lcm_start + 1

print(b - a + 1 - c_num - d_num + lcm_num)

Submission status: Runtime Error

Solution code:
N,L=map(int, input().split())
 
sum = 0
lower = 100
for i in range(1, N+1):
    sum = sum + L + i -1
for i in range(1, N+1):
    s = abs(L + i -1)
    if s < lower:
        lower = s
        ij = i
 
print(sum - (L + ij -1))

Submission status: Runtime Error

Solution code:
a,b,c,d=map(int,input().split())
al = b-a+1
# cで割り切れる個数
x = int(b/c) -int((a-1)/c)
# dで割り切れる個数
y = int(b/d) -int((a-1)/d)
# cdの最小公倍数
lcm_xy = int(c*d/math.gcd(c,d))
# cdの最小公倍数で割り切れる個数
xy = int(b/lcm_xy) -int((a-1)/lcm_xy)
#print(x,y,xy,al)
print(al-(x+y-xy))

Submission status: Runtime Error

Solution code:
a,b,c,d = map(int,input().split())

e = int(b // c)
f = int(a // c)
if f == int(a / c):
    g = e - f + 1
else:
    g = e - f

h = int(b // d)
i = int(a // d)
if i == int(a / d):
    j = h - i + 1
else:
    j = h - i

import fractions

cd = c*d / fractions.gcd(c,d)

k = int(b // cd)
l = int(a // cd)
if l == int(a / cd):
    m = k - l + 1
else:
    m = k - l

ans = (b-a) + 1 - (g + j - m)
print(int(ans))

Submission status: Runtime Error

Solution code:
#include <iostream>
#include <vector>
#include <cmath>
#include <string>
using namespace std;
int main(){
    int N =4;
    char a[4];
    scanf("%s",a);
    for(int i=0;i < N; i++){
        for(int j=i+1; j< N; j++){
            if(a[i]==a[j]){
                printf("Bad\n");
                return 0;
            }
        }
    }
    printf("Good\n");
    return 0;
}

Submission status: Runtime Error

Solution code:

def gcdm(g,l):
    while(l):
        g,l=l,g%l
    return g
def mota(l,r,a):
    if r<a:
        total=0
    else:
        
        if l<a:
            first=a
        elif l>=a:
            if l%a==0:
                first=l
            else:
                first=(l//a + 1)*a
        #print(a,first)
        last=r-r%a
    
        total=((last-first)//a)+1
    return total
a,b,c,d=list(map(int,input().split()))
p=[c,d]
p.sort()
c,d=p[0],p[1]
total1=mota(a,b,c)

#print(total1)
total2=mota(a,b,d)
#print(total2)
h=(c*d)//gcdm(c,d)
total3=mota(a,b,h)
#print(h)
#print(total3)
print(b-a+1-(total1+total2-total3))

Submission status: Runtime Error

Solution code:
import fractions

A, B ,C ,D = map(int, input().split())

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

def num_of_mod0(mod):
    if A%mod == 0:
        start = A
    else:
        start = (int(A/mod) +1) * mod

    end = (int(B /mod)) * mod

    return (end - start) / mod +1

ans =(B-A+1)-(num_of_mod0(C) + num_of_mod0(D)- num_of_mod0(lcm(C,D)))
ans = int(ans)
print(ans)

Submission status: Runtime Error

Solution code:
N = int(input())
arr = [[int(i) for i in input().split()] for j in range(N)]
arr = sorted(arr,key=lambda x:(x[1], x[0]))
i = 0


while i < N-1:
  if (sum(arr[:i+1][0])) > arr[i+1][1]:
    break
  i += 1
    
if i == N-1:
  print("Yes")
else:
  print("No")

Submission status: Runtime Error

Solution code:
def gcd(a,b):
    while (b!= 0):
        a,b=b,a%b
    return a

l = raw_input().split()

a = int(l[0])
b = int(l[1])
c = int(l[2])
d = int(l[3])

lcm = ((c*d)//(gcd(c,d)))

div = []

div.append((a-1)/c)
div.append((a-1)/d)

div.append(b/c)
div.append(b/d)

div.append(a/lcm)
div.append(b/lcm)

ans =  (div[2]-div[0])+(div[3]-div[1])-(div[5]-div[4])
ans = (b-a+1) - ans

print ans

Submission status: Runtime Error

Solution code:
n, l = map(int, input().split())
tastes = range(l, n + l)
ijo = [taste for taste in tastes if taste >= 0]
under = [taste for taste in tastes if taste < 0]
if len(ijo) == 0:
    print(sum(under[:-1]))
elif len(under) == 0:
    print(sum(ijo[1:]))
else:
    print(sum(tastes))

Submission status: Runtime Error

Solution code:
import fractions

A, B, C, D = map(int, input().split())

A -= 1

lcm = (C * D) // fractions.gcd(C, D)

excluded = A - (A // C + A // D - A // lcm)
num = B - (B // C + B // D - B // lcm)

print(num - excluded)

Submission status: Runtime Error

Solution code:
from fractions import gcd
A,B,C,D = map(int, input().split())

A =A-1
CD = int(C * D / gcd(C, D))
num_A_C = int(A / C)
num_A_D = int(A / D)
num_A_CD = int(A / CD)
num_B_C = int(B / C)
num_B_D = int(B / D)
num_B_CD = int(B / CD)

num_C =num_B_C - num_A_C
num_D =num_B_D - num_A_D
num_CD =num_B_CD - num_A_CD

ans = B - A -num_C - num_D + num_CD
print(ans)

Submission status: Runtime Error

Solution code:
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))

Submission status: Runtime Error

Solution code:
import bisect

n = int(input())

a, b = map(int, input().split())
task_lis = [[b, a]]
sum_a = 0
ch_over = 1


for i in range(n-1):
    a, b = map(int, input().split())
    if a > b:
        ch_over = 0
        break
    else:
        pass
    ok2 = bisect.insort_right(task_lis,[b, a])


for i in range(n):
    if chover == 0:
        break
    else:
        pass
    sum_a += task_lis[i][1]
    if task_lis[i][0] < sum_a:
        ch_over = 0
        break

if ch_over == 0:
    print("No")
else:
    print("Yes")

Submission status: Runtime Error

Solution code:
N = int(input())
A=[]
B=[]
for i in range(N):
    a,b = map(int,input().split())
    c = 0
    A.append(a)
    B.append(b)
def merge_sort(arr,b):
    if len(arr) <= 1:
        return (arr,b)

    mid = len(arr) // 2
    # ここで分割を行う
    left = arr[:mid]
    right = arr[mid:]
    leftt =b[:mid]
    rightt = b[mid:]

    # 再帰的に分割を行う
    left,leftt = merge_sort(left,leftt)
    right,rightt = merge_sort(right,rightt)

    # returnが返ってきたら、結合を行い、結合したものを次に渡す
    return merge(left, right,leftt,rightt)


def merge(left, right,leftt,rightt):
    merged = []
    mergedd = []
    l_i, r_i = 0, 0

    # ソート済み配列をマージするため、それぞれ左から見ていくだけで良い
    while l_i < len(left) and r_i < len(right):
        # ここで=をつけることで安定性を保っている
        if left[l_i] <= right[r_i]:
            merged.append(left[l_i])
            mergedd.append(leftt[l_i])
            l_i += 1
        else:
            merged.append(right[r_i])
            mergedd.append(rightt[r_i])
            r_i += 1

    # 上のwhile文のどちらかがFalseになった場合終了するため、あまりをextendする
    if l_i < len(left):
        merged.extend(left[l_i:])
        mergedd.extend(leftt[l_i:])
    if r_i < len(right):
        merged.extend(right[r_i:])
        mergedd.extend(rightt[r_i:])
    return (merged,mergedd)
B,A = merge_sort(B,A)
found = True
SUM = 0
for i in range(N):
    SUM = SUM + A[i]
    if B[i] < SUM:
        found = False
if found:
    print("Yes")
else:
    print("No")

Submission status: Runtime Error

Solution code:
def gcd(a, b):
  while b:
    a, b = b, a % b
  return a

a, b, c, d = map(int, input().split())
num = 0
cd = c*d/(gcd(c,d))
s = b - a + 1
s_c = int(s/c)
s_d = int(s/d)
s_cd = int(s/cd)
if(a%c >= b%c):
  num = num + 1
if(a%d >= b%d):
  num = num + 1
if(a%cd >= b%cd):
  num = num - 1
print(s -(s_c + s_d - s_cd) - num)

Submission status: Runtime Error

Solution code:
S=input()
a = [int(c) for c in s]

if (a[0]-a[1]) * (a[1]-a[2]) * (a[2] - a[3]) ==0:
    print('Bad')
else:
    print('Good')

Submission status: Runtime Error

Solution code:
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))

Submission status: Runtime Error

Solution code:
e = list(map(int,input().split()))
a = e[0]
b = e[1]
c = e[2]
d = e[3]
cnt = 0
for j in range(a,b+1):
    if j%c != 0 and j%d != 0:
        cnt += 1
    else:
        pass
print(cnt)

Submission status: Runtime Error

Solution code:
e = list(map(int,input().split()))
a = e[0]
b = e[1]
c = e[2]
d = e[3]
cnt = 0
for j in range(a,b+1):
    if j%c != 0 and j%d != 0:
        cnt += 1
print(cnt)

Submission status: Runtime Error

Solution code:
import fractions

A, B, C, D = map(int, input().split())

s = B - A + 1

if A % C == 0 or A % D == 0:
    A -= 1

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

E = lcm(C, D)

val1 = A // C
val2 = B // C
val3 = A // D
val4 = B // D
val5 = A // E
val6 = B // E

print(s - (val2 - val1 + val4 - val3 - (val6 - val5)))

Submission status: Runtime Error

Solution code:
import math

A, B, C, D = map(int, input().split())

s = B - A + 1

if A % C == 0 or A % D == 0:
    A -= 1

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

E = lcm(C, D)

val1 = A // C
val2 = B // C
val3 = A // D
val4 = B // D
val5 = A // E
val6 = B // E

print(s - (val2 - val1 + val4 - val3 - (val6 - val5)))

Submission status: Runtime Error

Solution code:
a,b,c,d=map(int,input().split())
import math
import fractions
nc=math.floor((b-a)/c)
nd=math.floor((b-a)/d)
lcd=c*d//fractions.gcd(c,d)
ncd=math.floor((b-a)/lcd)
sum=nc+nd-ncd
print(b-a-sum)

Submission status: Runtime Error

Solution code:
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))

Submission status: Runtime Error

Solution code:
N,L=map(int,input().split())
LL=[L+i for i in range(N)]
LLL=[abs(L+i) for i in range(N)]

if N+L<0:
  print(sum(LL)+min(LLL))
elif N+L=0:
  print(sum(LL))
else:
  print(sum(LL)-min(LLL))

Submission status: Runtime Error

Solution code:
a=list(int(input))
i=0
for j in range(1,4):
  if a[i]== a[j]:
    print('Bad')
    break
  elif a[i]!= a[j] and j == 3:
    print('Good')
  i += 1

Submission status: Runtime Error

Solution code:
from fractions import gcd
import math
a,b,c,d = map(int,input().split())
 
an1 = math.floor(b/c)
an2 = math.floor((a-1)/c)
an3 = math.floor(b/d)
an4 = math.floor((a-1)/d)
 
gcd = round(c * d / gcd(c, d))
 
an5 = math.floor(b/gcd)
an6 = math.floor((a-1)/gcd)
an = an1-an2 + an3-an4 -(an5-an6)
print((b-a+1)-an)

Submission status: Runtime Error

Solution code:
a=list(int(input))
i=0
for j in range(1,4):
  if a[i]== a[j]:
    print('Bad')
    break
  elif a[i]!= a[j] and j == 4:
    print('Good')
  i += 1

Submission status: Runtime Error

Solution code:
from fractions import gcd
import math
a,b,c,d = map(int,input().split())


an1 = math.floor(b/c)
an2 = math.floor((a-1)/c)
an3 = math.floor(b/d)
an4 = math.floor((a-1)/d)

gcd = round(c * d / gcd(c, d))

an5 = math.floor(b/gcd)
an6 = math.floor((a-1)/gcd)
an = an1-an2 + an3-an4 -(an5-an6)
print((b-a+1)-an)

Submission status: Runtime Error

Solution code:
N,L=map(int,input().split())
LL=[L+i for i in range(N)]
LLL=[abs(L+i) for i in range(N)]

if N+L<0:
  print(sum(LL)+min(LLL))
else:
  print(sum(LL)-min(LLL))

Submission status: Runtime Error

Solution code:
a, b, c, d = map(int, input().split())
 
cnt = 0
for i in range(a, b+1):
  if i % c != 0 and i % d != 0:
    cnt += 1
    
print(cnt)

Submission status: Runtime Error

Solution code:
a=list(int(input))
i=0
for j in range(1,4):
  if a[i]== a[j]:
    print('Bad')
    break
  elif a[i]!= a[j] and j == 4:
    print('Good')
  else:
    continue

Submission status: Runtime Error

Solution code:
import asyncio
a, b, c, d = map(int, input().split())
loop = asyncio.get_event_loop()
i = c if c < d else d
num = 0
global num
loop_was_not_running = not loop.is_running()
async def y(q):
  if q % c and q % d:
    num += 1
    
def print_hello_world(future):
  if loop_was_not_running:
    loop.stop()

li = [y(o) for o in range(a, b)]
future = asyncio.gather(*li)
asyncio.ensure_future(future)
future.add_done_callback(print_hello_world)
    if loop_was_not_running:
        loop.run_forever()
print(num)

Submission status: Runtime Error

Solution code:
a,b,c,d=map(int,input().split())
r_ab=range(a,b+1)
count=0
for i in r_ab:
  if i%c!=0 and i%d!=0:
    count+=1
print(count)

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
e = list(map(int,input().split()))
a = e[0]
b = e[1]
c = e[2]
d = e[3]
cnt = 0
t = [j for j in range(a,b+1) if j%c != 0 and j%d != 0]

for i in t:
    if (i//c-i/c != 0) and (i//d-i/d != 0):
        cnt += 1
    else:
        pass
print(cnt)

Submission status: Runtime Error

Solution code:
n = int(input())
xy = [0] * n
for i in range(n):
    xy[i] = tuple([int(j) for j in input().split()])
loop = True
cnt = 0
while loop:
    xy_num = len(xy)
    for i in xy:
        a, b = i
        for j in xy:
            if j[0] == a and j[1] != b:
                d = j[1]
                for k in xy:
                    if k[1] == b and k[0] != a:
                        c = k[0]
                        if (c, d) not in xy:
                            xy.append((c, d))
                            cnt += 1
                    if k[1] == d and k[0] != a:
                        c = k[0]
                        if (c, b) not in xy:
                            xy.append((c, b))
                            cnt += 1
            if j[1] == b:
                c = j[0]
                for k in xy:
                    if k[0] == c and k[1] != b:
                        d = k[1]
                        if (a, d) not in xy:
                            xy.append((a, d))
                            cnt += 1
    if len(xy) == xy_num:
        loop = False
print(cnt)

Submission status: Runtime Error

Solution code:
x = input()
flag = 0

for i in (0,4):
    if x[i] == x[i+1]:
        flag += 1
    else :
        flag += 0

if flag == 0:
    print("Good")
else :
    print("Bad")

Submission status: Runtime Error

Solution code:
def check_key(S, key_length):
    for i,k in enumerate(S):
        if k == S[i+1]:
            return 'Bad'
        if i == key_length - 1:
            return 'Good'
        else:
            continue
S = input()
key_length = len(S)
print(check_key(S, key_length))

Submission status: Runtime Error

Solution code:
x = (input())
flag = 0

for i in (0,4):
    if x[i] == x[i+1]:
        flag += 1
    else :
        flag += 0

if flag == 0:
    print("Good")
else :
    print("Bad")

Submission status: Runtime Error

Solution code:
output = []
 
for (i, x) in enumerate(S):
    if i == 0:
        pre = x
    else:
        if pre == x:
            output = "Bad"
            print(output)
        pre = x
            
if len(output) > 0:
    print(output)
else:
    output = "Good"
    print(output)

Submission status: Runtime Error

Solution code:
x = (input())
int flag = 0

for i in (0,4)
    if x[i] == x[i+1]
        flag += 1
    else 
        flag += 0

if flag == 0
    print('Good')
else print('Bad')

Submission status: Runtime Error

Solution code:
def check_key(S, key_length):
    for i,k in enumerate(S):
        if k == S[i+1]:
            return 'bad'
        if i == key_length - 1:
            return 'Good'
        else:
            continue
S = input()
key_length = len(S)
print(check_key(S, key_length))

Submission status: Runtime Error

Solution code:
n,l = list(map(int,input().split()))

flavor = int(n*(l+(l+n-1))/2)

if (l<0):
  if l>=(-n+1):
  	print(flavor)
  elif l<(-n+1):
    print(flavor-(l+n-1))
    

else:
  print(flavor-l)

Submission status: Runtime Error

Solution code:
output = []

for (i, x) in enumerate(S):
    if i == 0:
        pre = x
    else:
        if pre == x:
            output = "Bad"
        pre = x
            
if output == "Bad":
    print(output)
else:
    output == "Good"
    print(output)

Submission status: Runtime Error

Solution code:
pass = input()
last = Nane
for i in pass:
	if last == i:
        print("Bad")
        break
    else:
        last = i
else:
    print("Good")

Submission status: Runtime Error

Solution code:
def main():

    # 1 <= a <= b <= 10^18
    # 1 <= c,d <= 10^9

    a, b, c, d = map( int, input().split())
    count = 0

    for i in range(a, b):
        if(i % c != 0):
            if(i % d != 0):
                count += 1

    print(count)

if __name__ == '__main__':
    main()

Submission status: Runtime Error

Solution code:
i = input()

for j in range(i-1):
  if(j==j+1):
    print("Bad")
    break
  else(j==(len(i)-2)):
    print("Good")

Submission status: Runtime Error

Solution code:
message = []

for (i, x) in enumerate(S):
    if i == 0:
        pre = 0
        pre = x
    else:
        if pre == x:
            message = "Bad"
        pre = x
            
if message == "Bad":
    print(message)
else:
    print("Good")

Submission status: Runtime Error

Solution code:
ss = input()

for i in range(3):
  if ss[i] = ss[i+1]:
    print("Good")
    break
else:
  print("Bad")

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
N,L = list(map(int,input().split(" ")))

apple = list(range(L,L+N))

s = sum(apple)

m = 1000000000000000000
for x in apple:
  if abs(m) > abs(x):
    m = x

print(s-m)

Submission status: Runtime Error

Solution code:
import numpy as np

l, n = [i for i in input().split(' ')]

nl = np.array([i for i in range(n)]) + 1
ll = nl + l - 1

mini = ll.index(min(abs(ll)))
lll = ll.pop(mini)

print(sum(lll))

Submission status: Runtime Error

Solution code:
ss = input()

for i in range(3):
  if ss[i] = ss[i+1]:
    print("Good")
    break
else:
  print("Bad")

Submission status: Runtime Error

Solution code:
n=int(input())
l=[]
r=[]
for i in range(n):
    a,b=map(int,input().split())
    r.append(a)
    l.append(b)
m=max(l)
s=sum(r)
if s<m:
    print("Yes")
else:
    print("No")

Submission status: Runtime Error

Solution code:
e = list(map(int,input().split()))
a = e[0]
b = e[1]
c = e[2]
d = e[3]

cnt = 0
for i in range(a,b+1):
    if (int(i/c)-i/c != 0) and (int(i/d)-i/d != 0):
        cnt += 1

print(cnt)

Submission status: Runtime Error

Solution code:
a=int(input())
b=[int(x) for x in list(str(a))]
for i in range(len(b)):
  if b[i] ==b[i+1]:
    print("Bad")
  else:
    print("Good")

Submission status: Runtime Error

Solution code:
import fractions
A, B, C, D = (int(x) for x in input().split())

C_ = int(B/C) - int(A/C)
if A%C == 0:                                                                                                                                                                                                
    C_ += 1                                                                                                                                                                                                 
D_ = int(B/D) - int(A/D)
if A % D == 0:                                                                                                                                                                                              
    D_ += 1                                                                                                                                                                                                 

E = C * D / fractions.gcd(C, D)
E_ = int(B/E) - int(A/E)

ans = B - A + 1 - C_ - D_ + E_
print(ans)

Submission status: Runtime Error

Solution code:
N, L = map(int,input().split(' '))
l=list(range(L,N+L,1))
minabs = min([abs(x) for x in l])
if N+L+1<=0:
    print(sum(l)+minabs)
else:
    print(sum(l)-minabs)

Submission status: Runtime Error

Solution code:
a=int(input())
b=[int(x) for x in list(str(a))]
for i in b:
  if b[i] ==b[i+1]:
    print("Bad")
  else:
    print("Good")

Submission status: Runtime Error

Solution code:
a,b,c,d=map(int,input().split())
import fractions
import math
nc=math.floor(b/c)-math.ceil(a/c)+1
nd=math.floor(b/d)-math.ceil(a/d)+1
min=c*d/fractions.gcd(c,d)
ncd=math.floor(b/min)-math.ceil(a/min)+1
print(b-a+1-(nc+nd-ncd))

Submission status: Runtime Error

Solution code:
a = list(map(int, input().split()))

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

Submission status: Runtime Error

Solution code:
a = list(map(int, input().split()))

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

Submission status: Runtime Error

Solution code:
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)

Submission status: Runtime Error

Solution code:
a = int(input().split())

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

Submission status: Runtime Error

Solution code:
a = int(input().split())

if a[0]-a[1]=0 or a[1]-a[2]=0 or a[2]-a[3]=0 or a[3]-a[4]=0:
    print("Bad")
else:
    print("Good")

Submission status: Runtime Error

Solution code:
S = input()
S = list(S)
S.append("a")
hoge = "Good"
for i in range(4):
    if hoge[i] == hoge[i + 1]:
        hoge = "Bad"

print(hoge)

Submission status: Runtime Error

Solution code:
def judge(S):
	S_list  = list(str(S))  #list化
	
	i_pure = None
	for i in S_list:
		if i == i_pure:
			return 'Bad'
		i_pure = i

	return 'Good'


# S = ['3776','8080','1333','0024']

S = stdin.readline()
# for s in S:
# 	print(judge(s))

print(judge(S))

Submission status: Runtime Error

Solution code:
ans = 0
for i in range(len(s)-1):
    if s[i] == s[i+1]:
        ans+=1
    else:
        pass
if ans > 0:
    print("Bad")
else:
    print ("Good")

Submission status: Runtime Error

Solution code:
a=str(input())
b=[str(x) for x in list(str(a))]
for i in b:
    if b[i] == b[i+1]:
        print("Bad")
    else:
        print("Good")

Submission status: Runtime Error

Solution code:
N , L =  map(int,input().split())

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

Submission status: Runtime Error

Solution code:
import sys
from fractions import gcd
sys.setrecursionlimit(10**7)
INF = 10 ** 18
MOD = 10 ** 9 + 7
def LI(): return list(map(int, sys.stdin.readline().split()))
def II(): return int(sys.stdin.readline())
def LS(): return list(map(list, sys.stdin.readline().split()))
def S(): return list(sys.stdin.readline())[:-1]

a, b, c, d = LI()
a = a-1

cd = int(c * d / gcd(c, d))
cs = b // c - a // c
ds = b // d - a // d
cds = b // (cd) - a // (cd)
print(b - a - cs - ds + cds)

Submission status: Runtime Error

Solution code:
N, L = (int(i) for i in input().split())
C = 0
S = 0

if L > 0:
	for i in range(N):
		if i > 0:
			S += L + i
elif L+N-1 < 0:
	for i in range(N):
		if i < N-1:
			S += L + i
else:
	for i in range(N):
		S += L + i

print(S)

Submission status: Runtime Error

Solution code:
a=int(input())
b=[int(x) for x in list(int(a))]
for i in b:
    if b[i] == b[i+1]:
        print("Bad")
    else:
        print("Good")

Submission status: Runtime Error

Solution code:
s = input()

flag = True
for i in range(len(s)-1):
  if s[i] == s[i+1]:
    print("Bad")
	flag = False

if flag:
  	print("Good")

Submission status: Runtime Error

Solution code:
S=input()
for i in range(len(S)):
    if S[i]==S[i+1]:
        print('Bad')
    else:
        print('Good')

Submission status: Runtime Error

Solution code:
ans = 0
for i in range(len(s)-1):
    if s[i] == s[i+1]:
        ans+=1
    else:
        pass
if ans >= 0:
    print("Bad")
else:
    print ("Good")

Submission status: Runtime Error

Solution code:
s = input()

flag = True
for i in range(N-1):
  if s[i] == s[i+1]:
    print("Bad")
	flag = False

if flag:
  	print("Good")

Submission status: Runtime Error

Solution code:
import sys
from io import StringIO
import unittest
def resolve():
    S = input()
    a = 0
    for i in range(len(S) - 1):
        if (S[i] == S[i + 1]):
            a = 1
    if (a == 0):
        print("Good")
    else:
        print("Bad")
resoluve()

Submission status: Runtime Error

Solution code:
s = (input())
l = list(s)
flag = 0
for i in range(0,len(l)-1):
	if l[i+1]==l[i]:
    	flag=1
		break
if flag==1:
	print('Bad')
else:
	print('Good')

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
s = int(input())
digit = lambda i:(digit(i//10) + [i%10]) if i > 0 else []

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

Submission status: Runtime Error

Solution code:
s = (input()
l = list(s)
flag = 0
for i in range(0,len(l)-1):
	if l[i+1]==l[i]:
    	flag=1
		break
if flag==1:
	print('Bad')
else:
	print('Good')

Submission status: Runtime Error

Solution code:
def resolve():
    S = input()
    a = 0
    for i in range(len(S) - 1):
        if (S[i] == S[i + 1]):
            a = 1
    if (a == 0):
        print("Good")
    else:
        print("Bad")
resoluve()

Submission status: Runtime Error

Solution code:
i = int(input())
S = []
while i > 0:
    S.append(i%10)
    i //= 10 # 必須
S.reverse()
if S[0] == S[1] or S[1] == S[2] or S[2] == S[3]:
    print('Bad')
else:
    print('Good')

Submission status: Runtime Error

Solution code:
a=int(input())
b=[int(x) for x in list(int(n))]
for i in b:
    if b[i] == b[i+1]:
        print("Bad")
    else:
        print("Good")

Submission status: Runtime Error

Solution code:
s = (input()
l = list(s)
flag = 0
for i in range(0,len(l)-1):
	if l[i+1]==l[i]:
    	flag=1
   		break
if flag==1:
	print('Bad')
else:
	print('Good')

Submission status: Runtime Error

Solution code:
S1,S2,S3,S4=list(map(int,input().split()))

if S1 == S2 or S2 == S3 or S3 == S4:
    print('Bad')
else:
    print('Good')

Submission status: Runtime Error

Solution code:
a=str(input())
b=[str(x) for x in list(str(n))]
for i in b:
    if b[i] == b[i+1]:
        print("Bad")
    else:
        print("Good")

Submission status: Runtime Error

Solution code:
N,L = map(int, input().split())
list = []
sum = 0
min = 10000
sign = 1
for i in range(1,N+1):
    sum += L+i-1
    list.append(L+i-1)
for num in list:
    if min > abs(num):
        min = abs(num)
        if num > 0:
            sign = 1
        else:
            sign = -1
print(sum-min*sign)

Submission status: Runtime Error

Solution code:
s=int(input())
S=list(s)
a=0

for i in range(0,3):
    if S[i]==S[i+1]:
        print('Bad')
        break
    else:
        a=a+1

if a==3:
    print('Good')

Submission status: Runtime Error

Solution code:
s=list(input())

ans = 'Good'

while i-1 < range(s):
  if s[i] == s[i+1]:
    ans = 'Bad'
    print(ans)
    break
  elif :
    i += 1
    
print(ans)

Submission status: Runtime Error

Solution code:
a=int(input())
b=[int(x) for x in list(str(n))]
for i in b:
    if b[i] == b[i+1]:
        print("Bad")
    else:
        print("Good")

Submission status: Runtime Error

Solution code:
import sys
N = int(input())

if len(N) <= 1:
    print('Good')
    sys.exit()

for i in range(1, len(N)):
    if N[i] == N[i-1]:
        print('Bad')
        sys.exit()

print('Good')

Submission status: Runtime Error

Solution code:
i=int(input())


lst = []
while i > 0:
    lst.append(i%10)
    i //= 10 
lst.reverse()
if (lst[0] == lst[1] or lst[1] == lst[2] or lst[2] == lst[3] ):
    print('Bad')
else:
    print('Good')

Submission status: Runtime Error

Solution code:
N ,L= map(int,input().split())
one_aji = 0
aji = []
answer = []
for i in range(N):
    one_aji = L+i
    if one_aji < 0:
        answer.append(one_aji)
        one_aji *= -1
        aji.append(one_aji)
    else:
        aji.append(one_aji)
        answer.append(one_aji)
zettai = 500
ind = 0
for i, a in enumerate(aji):
    a = int(a)
    if a < zettai:
        zettai = a
        ind = i
         
answer.pop(ind)
print(sum(answer))