LoginSignup
0
0

More than 3 years have passed since last update.

はじめに

前回
今日も類題です。数理の翼二日目

#18

考えたこと
ABC095-A
カウントしてから*100するだけ

s = str(input())
print(700+s.count('o')*100)

ABC085-A
sの4番目からが出力と共通の部分なのでスライスで保持。それに2019を連結しています。

s = str(input())
print('2018'+s[4:])

ABC069-B
len(s)から最初と最後の2文字を引いて解くだけ

s = str(input())
print(s[0]+str(len(s)-2)+s[-1])

ABC082-B
1WA。文字列のsortとかが苦手
文字列のsortを忘れていたので、ordで数字に変換してsortしていました。辞書順の差を最大化するためにはsはa→z順、tはz→aにする。あとは比較するだけ。

s = str(input())
t = str(input())

s = list(map(ord,s))
t = list(map(ord,t))
s.sort()
t.sort(reverse=True)
if s < t:
    print('Yes')
else:
    print('No')

まとめ

数理の翼で感化されたので、量子コンピュータの方もがんばる。では、また

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