[AtCoder] Solve ABC1 ~ 100 A problem with Python

Introduction

I solved the A problem of ABC1 ~ 100 of AtCoder in Python.

Click here for 101 ~ [AtCoder] Solve A problem of ABC101 ~ 169 with Python

ABC100 Problem

A,B=map(int,input().split())
if A<=8 and B<=8:
  print("Yay!")
else:
  print(":(")

ABC99 Problem

n=int(input())

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

ABC98 Problem

A,B=map(int,input().split())
print(max([A+B,A-B,A*B]))

ABC97 Problem

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

if (abs(b-a)<=d and abs(c-b)<=d) or abs(c-a)<=d:
  print("Yes")
else:
  print("No")

ABC96 Problem

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

if a<=b:
  print(a)
else:
  print(a-1)

ABC95 Problem

S=input()

if S.count('o')==0:
  print(700)
elif S.count('o')==1:
  print(800)
elif S.count('o')==2:
  print(900)
else:
  print(1000)

ABC94 Problem

A,B,X=map(int,input().split())

if X-A>B or A>X:
  print('NO')
else:
  print('YES')

ABC93 Problem

S=input()

if 'a' in S and 'b' in S and 'c' in S:
  print("Yes")
else:
  print("No")

ABC92 Problem

A=int(input())
B=int(input())
C=int(input())
D=int(input())

print(min([A,B])+min([C,D]))

ABC91 Problem

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

if A+B>=C:
  print("Yes")
else:
  print("No")

ABC90 Problem

c1=input()
c2=input()
c3=input()

print(c1[0]+c2[1]+c3[2])

ABC89 Problem

N=int(input())
print(N//3)

ABC88 Problem

N=int(input())
A=int(input())

if N%500<=A:
  print("Yes")
else:
  print("No")

ABC87 Problem

X=int(input())
A=int(input())
B=int(input())

print((X-A)%B)

ABC86 Problem

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

if a*b%2==0:
  print("Even")
else:
  print("Odd")

ABC85 Problem

S=input()
print("2018"+S[4:])

ABC84 Problem

M=int(input())
print(48-M)

ABC83 Problem

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

if A+B>C+D:
  print("Left")
elif A+B==C+D:
  print("Balanced")
else:
  print("Right")

ABC82 Problem

import math

a,b=map(int,input().split())
print(math.ceil((a+b)/2))

ABC81 Problem

s=input()
print(s.count('1'))

ABC80 Problem

N,A,B=map(int,input().split())
print(min([N*A,B]))

ABC79 Problem

N=input()

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

ABC78 Problem

X,Y=input().split()

if X<Y:
  print("<")
elif X==Y:
  print("=")
else:
  print(">")

ABC77 Problem

C1=input()
C2=input()

if C1[0]==C2[2] and C1[1]==C2[1] and C1[2]==C2[0]:
  print("YES")
else:
  print("NO")

ABC76 Problem

R=int(input())
G=int(input())

print(2*G-R)

ABC75 Problem

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

if A==B:
  print(C)
elif B==C:
  print(A)
else:
  print(B)

ABC74 Problem

N=int(input())
A=int(input())

print(N**2-A)

ABC73 Problem

N=input()

if "9" in N:
  print("Yes")
else:
  print("No")

ABC72 Problem

X,t=map(int,input().split())
if X>t:
  print(X-t)
else:
  print(0)

ABC71 Problem

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

if abs(x-a)<abs(x-b):
  print("A")
else:
  print("B")

ABC70 Problem

N=input()

if N[0]==N[2]:
  print("Yes")
else:
  print("No")

ABC69 Problem

n,m=map(int,input().split())
print((n-1)*(m-1))

ABC68 Problem

n=input()
print("ABC"+n)

ABC67 Problem

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

if A%3==0 or B%3==0 or (A+B)%3==0:
  print("Possible")
else:
  print("Impossible")

ABC66 Problem

a,b,c=map(int,input().split())
print(min([a+b,b+c,c+a]))

ABC65 Problem

X,A,B=map(int,input().split())

if A>=B:
  print("delicious")
elif B-A<=X:
  print("safe")
else:
  print("dangerous")

ABC64 Problem

r,g,b=map(int,input().split())

if (10*g+b)%4==0:
  print('YES')
else:
  print("NO")

ABC63 Problem

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

if A+B>=10:
  print("error")
else:
  print(A+B)

ABC62 Problem

x,y=map(int,input().split())
A=[1,3,5,7,8,10,12]
B=[4,6,9,11]

if (x in A and y in A) or (x in B and y in B) or x==y==2:
  print("Yes")
else:
  print("No") 

ABC61 Problem

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

if A<=C<=B:
  print("Yes")
else:
  print("No")

ABC60 Problem

A,B,C=input().split()

if A[len(A)-1]==B[0] and B[len(B)-1]==C[0]:
  print('YES')
else:
  print('NO')

ABC59 Problem

s1,s2,s3=input().split()
S=s1[0]+s2[0]+s3[0]
print(S.upper())

ABC58 Problem

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

if b-a==c-b:
  print('YES')
else:
  print('NO')

ABC57 Problem

A,B=map(int,input().split())
if A+B>=24:
  print(A+B-24)
else:
  print(A+B)

ABC56 Problem

a,b=input().split()

if a=='H':
  print(b)
else:
  if b=='H':
    print('D')
  else:
    print('H')

ABC55 Problem

N=int(input())
print(N*800-(N//15)*200)

ABC54 Problem

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

if A==1:
  A+=13
if B==1:
  B+=13

if A>B:
  print('Alice')
elif A==B:
  print('Draw')
else:
  print('Bob')

ABC53 Problem

x=int(input())

if x<1200:
  print('ABC')
else:
  print('ARC')

ABC52 Problem

A,B,C,D=map(int,input().split())
print(max([A*B,C*D]))

ABC51 Problem

s=input()
print(*s.split(','))

ABC50 Problem

A,op,B=input().split()

if op=='+':
  print(int(A)+int(B))
else:
  print(int(A)-int(B))

ABC49 Problem

c=input()
if c in ['a','e','i','o','u']:
  print('vowel')
else:
  print('consonant')

ABC48 Problem

a,s,c=input().split()
print(a[0]+s[0]+c[0])

ABC47 Problem

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

if a+b==c or a+c==b or b+c==a:
  print('Yes')
else:
  print('No')

ABC46 Problem

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

if a==b==c:
  print(1)
elif a==b or b==c or c==a:
  print(2)
else:
  print(3)

ABC45 Problem

a=int(input())
b=int(input())
h=int(input())
print((a+b)*h//2)

ABC44 Problem

N=int(input())
K=int(input())
X=int(input())
Y=int(input())

if N<=K:
  print(X*N)
else:
  print(X*K+(N-K)*Y)

ABC43 Problem

N=int(input())
sum=0
for i in range(N):
  sum+=i+1
print(sum)

ABC42 Problem

number=list(map(int,input().split()))

if number.count(5)==2 and number.count(7)==1:
  print('YES')
else:
  print('NO')

ABC41 Problem

s=input()
i=int(input())
print(s[i-1])

ABC40 Problem

n,x=map(int,input().split())
print(min([x-1,n-x]))

ABC39 Problem

A,B,C=map(int,input().split())
print(A*B*2+A*C*2+B*C*2)

ABC38 Problem

S=input()
if S[len(S)-1]=='T':
  print('YES')
else:
  print('NO')

ABC37 Problem

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

if A<B:
  print(C//A+(C-(C//A)*A)//B)
else:
  print(C//B+(C-(C//B)*B)//A)

ABC36 Problem

A,B=map(int,input().split())
if B%A==0:
  print(B//A)
else:
  print(B//A+1)

ABC35 Problem

W,H=map(int,input().split())

if W/H==16/9:
  print('16:9')
else:
  print('4:3')

ABC34 Problem

x,y=map(int,input().split())
if x>y:
  print('Worse')
else:
  print('Better')

ABC33 Problem

N=input()
if N[0]==N[1] and N[1]==N[2] and N[2]==N[3]:
  print("SAME")
else:
  print("DIFFERENT")

ABC32 Problem

a=int(input())
b=int(input())
n=int(input())

while True:
  if n%a==0 and n%b==0:
    print(n)
    break
  n+=1

ABC31 Problem

A,D=map(int,input().split())
print(max([(A+1)*D,A*(D+1)]))

ABC30 Problem

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

if b/a<d/c:
  print('AOKI')
elif b/a>d/c:
  print('TAKAHASHI')
else:
  print('DRAW')

ABC29 Problem

W=input()
print(W+'s')

ABC28 Problem

N=int(input())

if N<=59:
  print('Bad')
elif N<=89:
  print('Good')
elif N<=99:
  print('Great')
else:
  print('Perfect')

ABC27 Problem

x,y,z=map(int,input().split())
if x==y:
  print(z)
elif y==z:
  print(x)
else:
  print(y)

ABC26 Problem

A=int(input())
print(A//2*A//2)

ABC25 Problem

S=input()
N=int(input())

if 1<=N<=5:
  print(S[0]+S[N%5-1])
elif 6<=N<=10:
  print(S[1]+S[N%5-1])
elif 11<=N<=15:
  print(S[2]+S[N%5-1])
elif 16<=N<=20:
  print(S[3]+S[N%5-1])
else:
  print(S[4]+S[N%5-1])

ABC24 Problem

A,B,C,K=map(int,input().split())
S,T=map(int,input().split())

if S+T>=K:
  print(A*S+B*T-(S+T)*C)
else:
  print(A*S+B*T)

ABC23 Problem

X=input()
print(int(X[0])+int(X[1]))

ABC22 Problem

N,S,T=map(int,input().split())
A=[int(input()) for i in range(N)]
count=0
best=0

for i in range(N):
  best+=A[i]
  if S<=best<=T:
    count+=1
print(count)

ABC21 Problem

N=int(input())

print(N)
for i in range(1,N+1):
  print(1)

ABC20 Problem

Q=int(input())
if Q==1:
  print('ABC')
else:
  print('chokudai')

ABC19 Problem

a=list(map(int,input().split()))
a.sort()
print(a[1])

ABC18 Problem

A=int(input())
B=int(input())
C=int(input())

if C<B and C<A and B<A:
  print('1\n2\n3')
elif B<C and C<A and B<A:
  print('1\n3\n2')
elif C<B and C<A and A<B:
  print('2\n1\n3')
elif C<B and A<C and A<B:
  print('3\n1\n2')
elif B<C and A<C and B<A:
  print('2\n3\n1')
else:
  print('3\n2\n1')

ABC17 Problem

s1,e1=map(int,input().split())
s2,e2=map(int,input().split())
s3,e3=map(int,input().split())

print(int(s1*e1/10+s2*e2/10+s3*e3/10))

ABC16 Problem

M,D=map(int,input().split())
if M%D==0:
  print('YES')
else:
  print('NO')

ABC15 Problem

A=input()
B=input()
if len(A)>len(B):
  print(A)
else:
  print(B)

ABC14 Problem

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

ABC13 Problem

X=input()

if X=='A':
  print(1)
elif X=='B':
  print(2)
elif X=='C':
  print(3)
elif X=='D':
  print(4)
else:
  print(5)

ABC12 Problem

A,B=map(int,input().split())
print(B,A)

ABC11 Problem

N=int(input())
if N==12:
  print(1)
else:
  print(N+1)

ABC10 Problem

S=input()
print(S+'pp')

ABC9 Problem

N=int(input())
print((N+1)//2)

ABC8 Problem

S,T=map(int,input().split())
print(T-S+1)

ABC7 Problem

N=int(input())
print(N-1)

ABC6 Problem

N=input()

if "3" in N or int(N)%3==0:
  print("YES")
else:
  print("NO")

ABC5 Problem

x,y=map(int,input().split())
print(y//x)

ABC4 Problem

N=int(input())
print(N*2)

ABC3 Problem

N=int(input())
sum=0

for i in range(N):
  sum+=(i+1)*10000

print(sum//N)

ABC2 Problem

A,B=map(int,input().split())
print(max([A,B]))

ABC1 Problem

H1=int(input())
H2=int(input())
print(H1-H2)

Recommended Posts

[AtCoder] Solve ABC1 ~ 100 A problem with Python
Solve AtCoder ABC168 with python (A ~ D)
Solve AtCoder ABC166 with python
Solve AtCoder ABC 186 with Python
Challenge AtCoder (ABC) 164 with Python! A ~ C problem
Solve ABC163 A ~ C with Python
Solve ABC166 A ~ D with Python
Solve ABC168 A ~ C with Python
Solve ABC162 A ~ C with Python
Solve ABC167 A ~ C with Python
Solve ABC158 A ~ C with Python
Solve AtCoder 167 with python
AtCoder ABC 177 Python (A ~ E)
ABC163 C problem with python3
AtCoder ABC 178 Python (A ~ E)
AtCoder ABC 176 Python (A ~ E)
I wanted to solve the ABC164 A ~ D problem with Python
AtCoder ABC 182 Python (A ~ D)
ABC188 C problem with python3
ABC187 C problem with python
Solve Atcoder ABC176 (A, B, C, E) in Python
Solve Atcoder ABC169 A-D in Python
Solve AtCoder Problems Recommendation with python (20200517-0523)
Solve ABC036 A ~ C in Python
Solved AtCoder ABC 114 C-755 with Python3
Template AtCoder ABC 179 Python (A ~ E)
Solve ABC037 A ~ C in Python
AtCoder ABC 174 Python
AtCoder ABC187 Python
AtCoder ABC188 Python
AtCoder ABC 175 Python
[AtCoder explanation] Control ABC180 A, B, C problems with Python!
[AtCoder explanation] Control ABC188 A, B, C problems with Python!
[AtCoder explanation] Control ABC164 A, B, C problems with Python!
[AtCoder explanation] Control ABC168 A, B, C problems with Python!
I wanted to solve ABC160 with Python
Solve ABC165 A, B, D in Python
I wanted to solve ABC172 with Python
[AtCoder commentary] Win the ABC165 C problem "Many Requirements" with Python!
Solve the Python knapsack problem with a branch and bound method
Solve the subset sum problem with a full search in Python
Solve ABC169 in Python
Solve POJ 2386 with python
Solve A ~ D of yuki coder 247 with python
Solve "AtCoder version! Ant book (beginner)" with Python!
[AtCoder explanation] Control the A, B, C problems of ABC182 with Python!
[AtCoder explanation] Control the A, B, C problems of ABC186 with Python!
[AtCoder explanation] Control the A, B, C problems of ABC185 with Python!
Solve with Ruby, Perl, Java and Python AtCoder ABC 047 C Regular Expression
[AtCoder explanation] Control the A, B, C problems of ABC187 with Python!
Try to solve a set problem of high school math with Python
[AtCoder explanation] Control the A, B, C problems of ABC184 with Python!
[Python] Solve equations with sympy
Try to solve the traveling salesman problem with a genetic algorithm (Python code)
Light blue with AtCoder @Python
Atcoder ABC164 A-C in Python
[AtCoder explanation] Control the A, B, (C), D problems of ABC165 with Python!
Try to solve the internship assignment problem with Python
[AtCoder explanation] Control the A, B, C, D problems of ABC183 with Python!
Solve with Ruby and Python AtCoder ABC084 D Cumulative sum of prime numbers
Atcoder ABC167 A-D in Python