LoginSignup
0
0

More than 3 years have passed since last update.

AtCoder参加記録(ABC147)

Posted at

AtCoder 初参加

AtCoder Beginner Contest 147 に初参加しました。
以後、参加したものとその記録をつけていきます。

AtCoder Beginner Contest 147 (以下、ABC 147)は、AからFまでの6問があり、徐々に難しくなっていく模様。
各問題を解いた際のコードの記載と、解けなかった問題の解き直しを行っていきます。
改善点などあればお気軽にご指摘ください。

ABC147はこちら

ABC147 A - Blackjack

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

if a+b+c > 21:
    print('bust')
elif a+b+c <= 21:
    print('win')

解説では、最後のところが単純にelseでしたね。

ABC147 B - Palindrome-philia

s = input()
l = len(s)
count = 0

for i in range(l//2):
    if s[i:i+1] != s[l-1-i:l-i]:
        count += 1
print(count)

if文の条件節は、もちっとシンプルにできたのかもしれない。

C以降の問題はできませんでした。
今後の課題ですね。

0
0
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
0
0