2
3

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 3 years have passed since last update.

PythonでABC164のA~D問題を解きたかった

Posted at

はじめに

A~Cの三完でした。

A問題

問題

考えたこと
はい

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

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

B問題

問題

考えたこと
互いの体力を攻撃力で割って大小を考えるだけですが、同じ値の時の処理を書き忘れて1WA。とても痛い

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問題

問題

考えたこと
setにいれてlenするだけ。簡単。なんでこっちがCなんだ。

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

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

D問題

問題

わかりません

まとめ

CとDの間に大きい壁があったので、Bの1WAが響いた。くやしい。ではまた、おやすみなさい。

2
3
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
2
3

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?