I wanted to solve the ABC164 A ~ D problem with Python

Introduction

It was three completes from A to C.

A problem

Problem

** Thoughts ** Yes

s, w = map(int,input().split())

if w >= s:
    print('unsafe')
else:
    print('safe')

B problem

problem

** Thoughts ** Just divide each other's physical strength by the attack power and think about the size, but forget to write the processing when the value is the same, 1WA. very painful

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

x = math.ceil(a/d)
y = math.ceil(c/b)

if x == y:
    print('Yes')
elif x > y:
    print('Yes')
else:
    print('No')

C problem

Problem

** Thoughts ** Just put it in the set and len. Easy. Why is this C?

n = int(input())
s = [input() for _ in range(n)]

s = set(s)
print(len(s))

D problem

Problem

I do not know

Summary

There was a big wall between C and D, so 1WA of B echoed. I'm sick. See you again, good night.

Recommended Posts

I wanted to solve the ABC164 A ~ D problem with Python
I wanted to solve ABC160 with Python
I wanted to solve ABC172 with Python
Solve ABC166 A ~ D with Python
I tried to solve the problem with Python Vol.1
I wanted to solve the Panasonic Programming Contest 2020 with Python
I wanted to solve ABC159 in Python
Solve AtCoder ABC168 with python (A ~ D)
I wanted to solve NOMURA Contest 2020 with Python
Try to solve the internship assignment problem with Python
Solve ABC163 A ~ C 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
Try to solve the traveling salesman problem with a genetic algorithm (Python code)
I wanted to visualize 3D particle simulation with the Python visualization library Matplotlib.
I tried to solve a combination optimization problem with Qiskit
The 15th offline real-time I tried to solve the problem of how to write with python
Solve ABC165 A, B, D in Python
I tried to solve the ant book beginner's edition with python
Solve the Python knapsack problem with a branch and bound method
Solve the subset sum problem with a full search in Python
How to write offline real time I tried to solve the problem of F02 with Python
[Python] I want to make a 3D scatter plot of the epicenter with Cartopy + Matplotlib!
A person who wants to clear the D problem with ABC of AtCoder tried to scratch
Try to solve the fizzbuzz problem with Keras
Try to solve the man-machine chart with Python
I want to make a game with Python
I wanted to play with the Bezier curve
I wanted to install Python 3.4.3 with Homebrew + pyenv
Solve A ~ D of yuki coder 247 with python
I want to solve APG4b with Python (Chapter 2)
Challenge AtCoder (ABC) 164 with Python! A ~ C problem
I want to write to a file with Python
The 16th offline real-time how to write reference problem to solve with Python
Try to solve the traveling salesman problem with a genetic algorithm (Theory)
The 19th offline real-time how to write reference problem to solve with Python
Try to solve a set problem of high school math with Python
I tried "Implementing a genetic algorithm (GA) in python to solve the traveling salesman problem (TSP)"
Try to solve the programming challenge book with python3
Solve AtCoder ABC166 with python
Try to solve the traveling salesman problem with a genetic algorithm (execution result)
ABC163 C problem with python3
[AtCoder explanation] Control the A, B, (C), D problems of ABC165 with Python!
The first algorithm to learn with Python: FizzBuzz problem
I tried to touch the CSV file with Python
[AtCoder explanation] Control the A, B, C, D problems of ABC183 with Python!
I tried to draw a route map with Python
I wanted to use the Python library from MATLAB
I want to inherit to the back with python dataclass
Solve ABC175 D in Python
I want to work with a robot in python.
Solve the Python asymmetric traveling salesman problem with a branch and bound method
I tried to automatically generate a password with Python3
A memo that I touched the Datastore with python
AtCoder ABC 182 Python (A ~ D)
[Python] How to create a 2D histogram with Matplotlib
ABC188 C problem with python3
[AtCoder explanation] Control the A, B, C, D problems of ABC181 with Python!
I want to solve the problem of memory leak when outputting a large number of images with Matplotlib