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:
p=list(input())
f=0
for i in range(len(l)-1):
  if l[i]==l[i+1]:
    f+=1
    break
if f>0:
  print("Bad")
else:
  print("Good")

Submission status: Runtime Error

Solution code:
import numpy as np
N = int(input())
C = []*2*N
for i in range(N):
    a,b = map(int,input().split())
    C.append(b)
    C.append(a)
D = np.array(C).reshape(N,2).tolist()
D.sort()
time = 0
flag = 1
for i in range(len(D)):
    if time + D[i][1] > D[i][0]:
        flag = 0
        break
    else:
        time += D[i][1]

if flag == 1:
    print('Yes')
else:
    print('No')

Submission status: Runtime Error

Solution code:
def bSort(a,b):
    for i in range(len(a)):
        for j in range(len(b)-1,i,-1):
            if b[j] < b[j-1]:
                       b[j],b[j-1] = b[j-1],a[j]
                       a[j],a[j-1] = a[j-1],b[j]
    return a,b
n = int(input())
a = []
b = []
for i in range(n):
    l,m =list(map(int ,input().strip().split()))
    a.append(l)
    b.append(m)
bSort(a,b)

sum = a[0]
for i in range(n):
    if sum <= b[i]:
        if i == n-1:
            print("Yes")
        sum += a[i]
        continue
    else:
        print("No")
        break

Submission status: Runtime Error

Solution code:
S = str(input())

if S[0] == S[1] or S[1]==S[2] or S[2]==S[3] or S[3]==S[4]:
  print('Bad')
else:
  print('Good')

Submission status: Runtime Error

Solution code:
def bSort(a,b):
    for i in range(len(a)):
        for j in range(len(b)-1,i,-1):
            if b[j] < b[j-1]:
                       b[j],b[j-1] = b[j-1],a[j]
                       a[j],a[j-1] = a[j-1],b[j]
    return a,b
    
n = int(input())
a = []
b = []
for i in range(n):
    l,m =list(map(int ,input().strip().split()))
    a.append(l)
    b.append(m)
bSort(a,b)
sum = a[0]
for i in range(n):
    if sum <= b[i]:
        if i == n-1:
            print("Yes")
        sum += a[i]
        continue
    else:
        print("No")
        break

Submission status: Runtime Error

Solution code:
s = set(input())
ans = True
for i in range(3):
    ans = ans and (s[i] != s[i+1])
if ans: print('Good')
else: print('Bad')

Submission status: Runtime Error

Solution code:
s = str(input())
if s[0] == s[1] or s[1] == s[2] or s[2] == s[3] or s[3] == s[4]:
    print('Bad')
else:
    print('Good')

Submission status: Runtime Error

Solution code:
s = str(input())
if s[0] == s[1] or s[1] == s[2] or s[2] == s[3] or s[3] == s[4]:
    print('Bad')
else:
    print('Yes')

Submission status: Runtime Error

Solution code:
s = int(input())
if a[0] == s[1] or s[1] == s[2] or s[2] == s[3] or s[3] == s[4]:
    print('Bad')
else:
    print('Yes')

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
s=input()

if s[0] == s[1] and s[1] == s[2] and s[2] == s[3]
    print('Bad')    
else:
    print('Good')

Submission status: Runtime Error

Solution code:
s=input()

if s[0] == s[1] and s[1] == s[2] and s[2] == s[3]
    print('Bad')    
else:
    print('Good')

Submission status: Runtime Error

Solution code:
#s[0]ってするとsの1つ目を示すらしい・・・だから
s=input()

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

Submission status: Runtime Error

Solution code:
#s[0]ってするとsの1つ目を示すらしい・・・だから
ｓ=input()

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

Submission status: Runtime Error

Solution code:
a=int(input())
b=int(input())
c=int(input())
d=int(input())

S=[a,b,c,d]
if num=(a=b,b=c,c=d):
    print('Bad')
else:
    print('Good')

Submission status: Runtime Error

Solution code:
S = int(input())
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:
#ABCA - Security
a = int(input())
s = list(a)
count = 0
for i in range(3):
    if s[i] != s[i+1]:
        count += 1
if count == 3:
    print("Good")
else:
    print("Bad")

Submission status: Runtime Error

Solution code:
s=input()


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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
A,B,C,D = map(int,input().split())
 
cList = []
 
dList = []
 
numList = []
 
supC = (B // C)
infC = (A // C)
 
supD = (B // D)
infD = (A // D)
 
for i in range(A,B+1):
	numList.append(i)
 
 
for i in range(infC,supC+1):
	cList.append(i * C)
 
for i in range(infD,supD+1):
	dList.append(i * D)
	
numList = len(set(numList) - set(cList) - set(dList))
 
print(numList)
A,B,C,D = map(int,input().split())

cList = []

dList = []

numList = []

supC = (B // C)
infC = (A // C)

supD = (B // D)
infD = (A // D)

for i in range(A,B+1):
	numList.append(i)


for i in range(infC,supC+1):
	cList.append(i * C)

for i in range(infD,supD+1):
	dList.append(i * D)
	
numList = len(set(numList) - set(cList) - set(dList))

print(numList)

Submission status: Runtime Error

Solution code:
import copy

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

n_L = list(range(n))
a_L = list(map(lambda x:l+x,n_L))
# out of rangeを防ぐため
a_L.append(0)

allsum = sum(a_L)

result_L = []


diff = abs(allsum-sum(a_L[1:]))

for val in range(n):
    b_L = copy.copy(a_L)
    b_L.pop(val)
    temp_sum = sum(b_L)

    if abs(allsum-temp_sum) <= diff:
        result = temp_sum
    diff = abs(allsum-temp_sum)

print(result)

Submission status: Runtime Error

Solution code:
s = int(input())

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:
n=imput()
if n[i]==n[i+1] for i in range(0,3):
    print("Bad")
else:
    print("Good")

Submission status: Runtime Error

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

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:
S=list(map(int,input().split()))

if (S[0]=S[1]) or (S[1]=S[2]) or (S[2]=S[3]):
  print("Bad")
else:
  print("Yes")

Submission status: Runtime Error

Solution code:
s=input()
ans=0
if t[0]==t[1] or t[1]==t[2] or t[2]==t[3]:
    ans='Bad'
else:
    ans='Good'
print(ans)

Submission status: Runtime Error

Solution code:
s=int(input())
n=str(s)
t=list(map(int,n))
ans=0
if t[0]==t[1] or t[1]==t[2] or t[2]==t[3]:
    ans='Bad'
else:
    ans='Good'
print(ans)

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
A = input()
print('Bad' if A[0] == A[1] or A[1] == A[2] or A[2] == A[3] or A[3] == A[4]  else 'Good')

Submission status: Runtime Error

Solution code:
A =input()
print('Bad' if A[0] == A[1] | A[1] == A[2] | A[2] == A[3] | A[3] == A[4]  else 'Good')

Submission status: Runtime Error

Solution code:
A = inout()
print('Bad' if A[i] == A[i+1] for i in range(4) else 'Good')

Submission status: Runtime Error

Solution code:
s=input()
n=0
for i in range(3):
    if s[i]==s[i+1]:
        n+=1
    else:
        n+=0
if n=>1:
    print('Bad')
else:
    print('Good')

Submission status: Runtime Error

Solution code:
s=input()
n=0
for i in range(3):
    if s[i]==s[i+1]:
        n+=1
    else:
        n+=0
if n>0
    print('Bad')
else:
    print('Good')

Submission status: Runtime Error

Solution code:
s=list(input())+['']
n=0
for i in range(4):
    if s[i]==s[i+1]:
        n+=1
    else:
        n+=0
if n>0
    print('Bad')
else:
    print('Good')

Submission status: Runtime Error

Solution code:
s=input()+['']
n=0
for i in range(4):
    if s[i]==s[i+1]:
        n+=1
    else:
        n+=0
if n>0
    print('Bad')
else:
    print('Good')

Submission status: Runtime Error

Solution code:
s=input()
n=0
for i in range(4):
    if s[i]==s[i+1]:
        n+=1
    else:
        n+=0
if n>0
    print('Bad')
else:
    print('Good')

Submission status: Runtime Error

Solution code:
s = list(map(int,input()))

result = True
for i in range(len(s)-1):
    if a[i] == a[i+1]:
        result = bad
        break
if result == "bad":
    print("Bad")
else:
    print("Good")

Submission status: Runtime Error

Solution code:
S = list(int(input()))

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:
S = input()
if S[0]==S[1] or S[1]==S[2] or S[2]==S[3] or S[3]==S[4]:
    print("Bad")
else:
    print("Good")

Submission status: Runtime Error

Solution code:
import pandas as pd
s = input()

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

print("Good")

Submission status: Runtime Error

Solution code:
S=str(input())
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:
#131a
S = int(input())
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:
s = input()
s = [i for i in s]
p = str()
for j in range(len(s)):
  if j < len(s):
    if s[j] == s[j + 1]:
      print('Bad')
      exit()
print('Good')

Submission status: Runtime Error

Solution code:
s = input()

tmp = ""
for val in s:
  if tmp == val:
    print("Bad")
    import sys.exit(0)
  tmp = val

print("Good")

Submission status: Runtime Error

Solution code:

import sys
input = sys.stdin.readline
sys.setrecursionlimit(10**6)
##############################
from fractions import gcd

# 最小公倍数
def lcm(x, y):
    return (x * y) // gcd(x, y)


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

A -= 1

# a/b以下の条件を満たす数
nb = B - B//C - B//D + B//lcm(C, D)
na = A - A//C - A//D + A//lcm(C, D)

print(nb - na)

Submission status: Runtime Error

Solution code:
# -*- coding:utf8 -*-

s = input()
ans = 'Good'
for i in (len(s) - 1):
        if s[i] != s[i+1]:
                ans = 'Bad'
print(ans)

Submission status: Runtime Error

Solution code:
import numpy as np
N=int(input())
a=[]
b=[]
xa=[]
xb=[]
y=[]
for i in range (0,N):
    c,d=(int(x) for x in input().split(" "))
    xa.append(c)
    xb.append(d)
     
z=np.argsort(xb)

for i in range (0,N):
    a.append(xa[z[i]])
    b.append(xb[z[i]])
for i in range (0,N):
    if i==0:
      	y.append(a[0])
    else:
      	y.append(a[i]+y[i-1])
def check(i,a,b):
    if b[i]>=y[i]:
        return True
    else:
        return False
def final_check(a,b,N):
    for i in range (0,N):
        if check(i,a,b)==False:
            return "No"
    return "Yes"
print (final_check(a,b,N))

Submission status: Runtime Error

Solution code:
s=list(str(int(input())))
print('Bad' if s[0]==s[1] or s[1]==s[2] or s[2]==s[3] else 'Good')

Submission status: Runtime Error

Solution code:
S=input()

for i in range(3):
    if S[i]=S[i+1]:
print('Bad')

    else:
print('Good')

Submission status: Runtime Error

Solution code:
s = [x for x in input()]
for _ in range(3):
  if s[i] == s[i+1]:
    print('Bat')
    break
  else:
    print('Good')

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
S = map(int,input())
 
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:
S = map(int,input())

if S[0]==S[1] or S[1]==S[2] or S[2]==S[3] or S[3]==S[4] :
	print('Bad')
else:
	print('Good')

Submission status: Runtime Error

Solution code:
S = map(int,input())

if S[0]=S[1] or S[1]=S[2] or S[2]=S[3] or S[3]=S[4] :
	print('Bad')
else:
	print('Good')

Submission status: Runtime Error

Solution code:
s = input()

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

Submission status: Runtime Error

Solution code:
s = input()

if pas[0] == pas[1] or pas[1] == pas[2] or pas[2] == pas[3]:
    print('Bad')
else:
    print('Good')

Submission status: Runtime Error

Solution code:
S = map(int,input())

for i in range(4) :
	if S[i-1] == S[i] :
		print('Bad')
	break :
	else: 
		print('Good')

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
a=map(int,input().split())
if a[0]==a[1]:
  print("Bad")
  elif a[1]==a[2]:
    print("Bad")
    elif a[2]==a[3]:
      print("Bad")
      else:
        print("Good")

Submission status: Runtime Error

Solution code:
a,b,c,d=map(int,input().split())
if a==b:
  print("Bad")
  elif b==c:
    print("Bad")
    elif c==d:
      print("Bad")
      else:
        print("Good")

Submission status: Runtime Error

Solution code:
S = input()
if s[0] == s[1]:
  print(Bad)
elif s[2] == s[1]:
  print(Bad)
elif s[3] == s[2]:
  print(Bab)
else:
  print(Good)

Submission status: Runtime Error

Solution code:
S = input()
if s[0] == s[1] and s[2] == s[1] and s[3] == s[2]:
  print(Bad)
else:
  print(Good)

Submission status: Runtime Error

Solution code:
a,b,c,d=map(int,input().split())
if a==b:
  print("bad")
  elif b==c:
    print("bad")
    elif c==d:
      print("bad")
      else:
        print("good")

Submission status: Runtime Error

Solution code:
a,b,c,d=map(int,input().split())
if a==b:
  print("bad")
  else if b==c:
    print("bad")
    else if c==d:
      print("bad")
      else:
        print("good")

Submission status: Runtime Error

Solution code:
a,b,c,d=map(int,input().split())
if a=b:
  print("bad")
  else if b=c:
    print("bad")
    else if c=d:
      print("bad")
      else:
        print("good")

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
def gcd(x,y):
  if y == 0:
    return x
  else:
    return gcd(y,x%y)
a,b,c,d = map(int, input().split())
p = b//c + (-a//c) +1
q = b//d + (-a//d) +1
r = b*gcd(c,d)//(c*d) + (-a*gcd(c,d)//(c*d)) +1
print(b-a+1-p-q+r)

Submission status: Runtime Error

Solution code:
li = list(input())
flag = False
for i in range(li):
  if i == 0:
    continue
  flag = li[i-1] == li[i]
  if flag:
    break
print("Bad" if flag else "Good")

Submission status: Runtime Error

Solution code:
A, B, C, D = list(map(int, input().split())) 

#A, Bの公約数 (gcd(C,D)), 公倍数
from fractions import gcd
LCM = C * D / gcd(C,D)
    

# B以下でCでもDでも割り切れない数
Ans_B = B - (B//C + B//D - B//LCM)
# A未満でCでもDでも割り切れない数
Ans_A = A-1 - ((A-1)//C + (A-1)//D  - (A-1)//LCM) 
    
print(Ans_B - Ans_A)

Submission status: Runtime Error

Solution code:
s = input()

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

Submission status: Runtime Error

Solution code:
N, L = map(int, input().split())
p_list = []
for i in range(1, N+1):
    p_list += [L + i - 1]
print(sum(p_list) - sorted(p_list, key=abs)[0])

Submission status: Runtime Error

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

#cとdの最大公約数を求める
first = [c,d%c]
first.sort()
if d%c==0:
  cd = c
elif first[0]==1:
  cd = 1
else:
  while first[0]>=2:
    first[1] = first[1]%first[0]
    first.sort()
    if first[0]==0:
      cd = first[1]
    elif first[0]==1:
      cd = 1
lcm = c*d/cd
      
zen = b-a+1
c_num = (b//c) -math.ceil(a/c)+1
d_num = (b//d) -math.ceil(a/d)+1
lcm_num = (b//lcm) - math.ceil(a/lcm)+1
ans = zen - c_num - d_num + lcm_num
print(ans)

Submission status: Runtime Error

Solution code:
s = list(map(int, input().solit()))
flg = 1
for i in range(4) :
  if i != 0 & s[i -1] == s[i] :
    flg = 0
if flg == 1 :
  print("Good")
else :
  print("Bad")

Submission status: Runtime Error

Solution code:
lst = list(int(input()))
flag = 0
for i in range(3):
    if lst[i] == lst[i+1]:
        flag += 1
if flag == 0:
    print('Good')
else:
    print('Bad')

Submission status: Runtime Error

Solution code:

import math

S = input().split()
A = int(S[0])
B = int(S[1])
C = int(S[2])
D = int(S[3])

E = (C * D) // math.gcd(C, D)

X = (B//C)-((A-1)//C)
Y = (B//D)-((A-1)//D)
Z = (B//E)-((A-1)//E)

print(B-A+1-X-Y+Z)

Submission status: Runtime Error

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

if C != D:
    C = min(C, D)
    D = max(C, D)
else:
    C = C
    D = D

def gcd(x, y):
    while y != 0:
        x, y = y, x % y
    return x

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

s = B // C - (A - 1) // C
t = B // D - (A - 1) // D
u = B // lcm - (A - 1) // lcm

print(B - A + 1 - s - t + u)

Submission status: Runtime Error

Solution code:
S = list(input)
if S[0]!=S[1] and S[1]!=S[2] and S[2]!=S[3]:
    print("Bad")
else:
    print("Good")

Submission status: Runtime Error

Solution code:
S = list(input())
if S[0]==S[1]orS[1]==S[2]orS[2]==S[3]:
  print("Bad")
else: print("Good")

Submission status: Runtime Error

Solution code:
from sys import exit

S = input()

for i in range(len(S)+1):
    if i > 1:
        if S[i-1] == S[i]:
            print('Bad')
            exit()

print('Good')

Submission status: Runtime Error

Solution code:
n,l = map(int,input().split())
li = []
for i in range(1,n+1):
  li.append(abs(l+i-1))
m = min(li)
if l+i-1 >= 0:
  print(int((n*(l-1)+(n*(n+1)/2)-l-i+1)))
else:
  print(int((n*(l-1)+(n*(n+1)/2)+l+i-1)))

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
N = input()
tmp = N[0]
for i in range(1,4):
    if tmp == N[i]:
        print("Bad")
        exit(1)
    tmp = N[i]
print("Good")

Submission status: Runtime Error

Solution code:
a, b, c, d = map(int, input().split())
if (a + b) / 2 == a:
  print('Bad')
elif (b + c) / 2 == b:
  print('Bad')
elif (c + d) / 2 == c:
  print('Bad')
else:
  print('Good')

Submission status: Runtime Error

Solution code:
a, b, c, d = map(int, input().split())
if (a + b) // 2 == a:
  print('Bad')
elif (b + c) // 2 == b:
  print('Bad')
elif (c + d) // 2 == c:
  print('Bad')
else:
  print('Good')

Submission status: Runtime Error

Solution code:
a, b, c, d = map(int, input().split())
if (a + b) // 2 == a;
  print('Bad')
elif (b + c) // 2 == b;
  print('Bad')
elif (c + d) // 2 == c;
  print('Bad')
else;
  print('Good')

Submission status: Runtime Error

Solution code:
matchNums=input()

flg=False
for i in range(len(matchNums)-1):
    if matchNums[i] == matchNums[i+1]:
        flg = True
if flg:
    print("Bad")
else
    print("Good")

Submission status: Runtime Error

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

apples = [l+i for i in range(n)] #りんごの味
ans = sum(apples) - apples[apples.index(min(apples, key=abs))] #りんごの味の合計ーりんごの味の絶対値の最小
print(ans)

Submission status: Runtime Error

Solution code:
# import math
import fractions


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


def lcm(x, y):
    # DeprecationWarning: fractions.gcd() is deprecated. Use math.gcd() instead.
    return x * y // fractions.gcd(x, y)


a1 = a - 1
div_a = (a1 // c) + (a1 // d) - (a1 // lcm(c, d))
div_b = (b // c) + (b // d) - (b // lcm(c, d))

print((b - a + 1) - (div_b - div_a))

Submission status: Runtime Error

Solution code:
s = input()
for i in range(len(s)):
    if s[i] == s[i+1]:
        print("Bad")
        exit()
print("Good")

Submission status: Runtime Error

Solution code:
s=input()
if s[0]==s[1] or s[1]==s[2] or s[2]==s[3] or s[3]==s[4]:
    print("bad")
else:
    print("good")

Submission status: Runtime Error

Solution code:
s=input()
if s[0]==s[1] or s[1]==s[2] or s[2]==s[3] or s[3]==s[4]:
    print("good")
else:
    print("bad")

Submission status: Runtime Error

Solution code:
s = list(input())
if s//1000==s//100-s//1000*10:
    print("good")
    if s//100-s//1000*10==s//10-s//100*10+s//1000*100:
        print("good")
        if s//10-s//100*10+s//1000*100==s-s//10*10+s//100*100-s//1000*1000:
print("bad")

Submission status: Runtime Error

Solution code:
s = list(input())
i = 0
f = 1
for i < 3 :
    if s[i] == s[i+1] :
        f = f*0
    i += 1
if f == 1 :
    print("Good")
else :
    print("Bad")

Submission status: Runtime Error

Solution code:
from fractions import gcd
a,b,c,d = map(int,input().split())
l = (c*d) // fractions.gcd(c,d)
 
x = b//c - (a-1)//c
y = b//d - (a-1)//d
z = b//l - (a-1)//l
s = int(x+y-z)
 
print(b-a+1-s)

Submission status: Runtime Error

Solution code:
from fractions import gcd
a,b,c,d = map(int,input().split())
l = (c*d) // gcd(c,d)
 
x = b//c - (a-1)//c
y = b//d - (a-1)//d
z = b//l - (a-1)//l
s = int(x+y-z)
 
print(b-a+1-s)

Submission status: Runtime Error

Solution code:
import math
a,b,c,d = map(int,input().split())
l = (c*d) // math.gcd(c,d)

x = b//c - (a-1)//c
y = b//d - (a-1)//d
z = b//l - (a-1)//l

s = (x+y-z)
print(b-a+1-s)

Submission status: Runtime Error

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

x = b//c - (a-1)//c
y = b//d - (a-1)//d
z = b//l - (a-1)//l

s = (x+y-z)
print(b-a+1-s)

Submission status: Runtime Error

Solution code:
s = input()

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:
N, L = map(int, input().split())
flavors = [x + L - 1 for x in range(1, N + 1)]
flavors.remove(min(flavors, key=abs))
print(sum(flavors))

Submission status: Runtime Error

Solution code:
import math


def solve():
    a, b, c, d = map(int, input().split())
    lcm = c * d // math.gcd(c, d)
    num_b = b - b // c - b // d + b // lcm
    num_a = a - 1 - (a - 1) // c - (a - 1) // d + (a - 1) // lcm
    return num_b - num_a


if __name__ == "__main__":
    print(solve())

Submission status: Runtime Error

Solution code:
char_list = list(str)
for i in range(4):
    
    if i == 3:
        print('Good')
        break
    
    if char_list[i] == char_list[i+1] and i < 3:
        print('Bad')
        break

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
s = int(input())
s2 = str(s)

for i in range(3):
    if s2[i] == s2[i+1]:
        print('Bad')
        break
    else:
        continue
else:
    print('Good')

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
S = str(input())
l = list(S)
s = int(len(S))

num = 0
for i in range(s):
    if l[i] == l[i+1]:
        num += 1
    else:
        num += 0

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

Submission status: Runtime Error

Solution code:
S = str(input())
l = list(S)
s = int(len(S))

num = 0
for i in range(s):
    if l[i] == l[i+1]:
        num += 1
    else:
        num += 0

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

Submission status: Runtime Error

Solution code:
import sys
S = str(input())
l = list(S)
s = int(len(S))

num = 0
for i in range(s):
    if l[i] == l[i+1]:
        print("Bad")
        sys.exit()
    else:
        num += 1
        if num == 3:
            print("Yes")

Submission status: Runtime Error

Solution code:
import sys
S = int(input())
l = list(S)
s = int(len(S))

num = 0
for i in range(s):
    if l[i] == l[i+1]:
        print("Bad")
        sys.exit()
    else:
        num += 1
        if num == 3:
            print("Yes")

Submission status: Runtime Error

Solution code:
s = int(input())
for i in range(1, s):
    if s[i] == s[i-1]:
        print ('Bad')
        exit()

print ('Good')

Submission status: Runtime Error

Solution code:
S=int(input())
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()
for i in range(len(s)):
  if s[i] == s[i+1]:
    print("Bad")
  else:
    print("Good")

Submission status: Runtime Error

Solution code:

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

# 味リストはL, L+1, L+2...
tastes = []
for i in range(n):
    tastes += [l+i]

# 味0があったらそれを食えばいい
if 0 in tastes:
    print(sum(tastes))
else:
    # 差が最小なのを食えばいい
    tastes.sort(key=abs)
    print(sum(tastes[1:]))

Submission status: Runtime Error

Solution code:
S=list(int(i) for i in input().split())
for x in range(len(S)-1):
  if S[x]==S[x+1]:
    print('Bad')
  break
  else:
    print('Good')

Submission status: Runtime Error

Solution code:
S=list(int(i) for i in input().split())
for x in range(len(S)+1):
  if S[x]==S[x+1]:
    print('Bad')
  break 
else:
  print('Good')

Submission status: Runtime Error

Solution code:
S=list(int(i) for i in input().split())
for x in range(len(S)+1):
  if S[x]==S[x+1]:
    print('Bad')
    break 
else:
  print('Good')

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
S=list(int(i) for i in input().split())
if S[i]==S[i+1]:
  print('Bad')
else:
  print('Good')

Submission status: Runtime Error

Solution code:
s = list(map(int, list(input())))
for i in range(s - 1):
    if s[i] == s[i + 1]:
        print('Bad')
    print('Good')

Submission status: Runtime Error

Solution code:
N,L=map(int, input().split())  #複数数値入力　「A B」みたいなスペース空いた入力のとき

aji=0
eat=99999

for i in range(1,N+1):
    aji=aji+i+L-1
    if abs(aji) < abs(eat):
        eat = aji
        
print(aji)

Submission status: Runtime Error

Solution code:
import numpy as np
N,L = map(int, input() . split())
x=[]
M = 0
N_list = np.array([])

for i in range(N):
  M += L + (i+1) - 1
  N_list = np.append(N_list, L + (i+1) - 1)
  
m = np.abs(N_list).argmin()

#M - N_list[m]
print(int(M - N_list[m]))

Submission status: Runtime Error

Solution code:
import numpy as np
import math
A, B, C, D = list(map(int, input().split()))

def lcm(x, y):
    return (x * y) / math.gcd(x, y)
E = lcm(C, D)

u = np.arange(A,B+1)
count_U = len(u)
u_c = [i for i in u if i % C == 0]
count_C = len(u_c)
u_d = [i for i in u if i % D == 0]
count_D = len(u_d)
u_e = [i for i in u if i % E == 0]
count_E = len(u_e)

answer = count_U - (count_C + count_D -count_E)
print(answer)

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
import fractions
def lcm(a,b):
  return a*b //fractions.gcd(a, b)

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

b_num = B//C + B//D - B//lcm(C, D)
a_num = (A-1)//C + (A-1)//D - (A-1)//lcm(C, D)
print((B-(A-1))-(b_num-a_num))

Submission status: Runtime Error

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


def lcm(a, b):
    return a * b // gcd(a, b)

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

b_num = B//C + B//D - B//lcm(C, D)
a_num = (A-1)//C + (A-1)//D - (A-1)//lcm(C, D)

print((B-A+1) -(b_num - a_num))

Submission status: Runtime Error

Solution code:
s=[int(i) for i in input().split()]
if s[1]==s[2] or s[2]==s[3] or s[3]==s[4]:
    print("Bad")
else:
    print("Good")

Submission status: Runtime Error

Solution code:
s = input()
b = 0

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

Submission status: Runtime Error

Solution code:
s = list(map(int,input().split()))
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:
w=input()

cnt=0
for i in w:
  if w[cnt] == w[cnt+1]:
    print("Bad")
  else:
    print("Good")
  cnt += 1

Submission status: Runtime Error

Solution code:
flag = True
S = input()
for i in range(1,len(S)):
  if S[i] == S[i-1]:
    flag = False

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

Submission status: Runtime Error

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

cc=b//c-(a-1)//c
dd=b//d-(a-1)//d
s=b//(c*d//fractions.gcd(c,d))-(a-1)//(c*d//fractions.gcd(c,d))


print((b-(a-1)-(cc+dd-s)))

Submission status: Runtime Error

Solution code:
s = input()
print('Bad' if true in [s[i] is s[i + 1] for i in range(3)] else 'Good')

Submission status: Runtime Error

Solution code:
s = input()
print('Bad' if true in [s[i] is s[i + 1] for i in 3] else 'Good')

Submission status: Runtime Error

Solution code:
s = input()
print('Bad' if true in [s[i] is s[i + 1] for i in 3] 'Good')

Submission status: Runtime Error

Solution code:
S = input()

S = list(map(S.split()))

flg = 0
temp = 0

for i in range(len(S)-1):
    if S[i] == S[i+1]:
        print(Bad)
        flg = 1
        break

if flg == 0:
    print(Good)

Submission status: Runtime Error

Solution code:
n=int(input())
s=str(n)
cnt=0
for i in range(3):
    if s[i]==s[i+1]:
        cnt=1
if cnt==1:
    print("Bad")
else:print("Good")

Submission status: Runtime Error

Solution code:
s = input()
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:
s = input()
bad = False
for i in range(len(s))[1:]:
  if s[i] == s[i-1]:
    bad = True
    break:

if bad:
  print(Bad)
else:
  print(Good)