Last time It's a similar subject today. Mathematical wings second day
#18 ** Thoughts ** ABC095-A Just count and then * 100
s = str(input())
print(700+s.count('o')*100)
ABC085-A Since the 4th part of s is the common part with the output, it is held as a slice. 2019 is linked to it.
s = str(input())
print('2018'+s[4:])
ABC069-B Just subtract the first and last two letters from len (s) and solve
s = str(input())
print(s[0]+str(len(s)-2)+s[-1])
ABC082-B 1WA. I'm not good at sorting strings I forgot to sort the string, so I converted it to a number with ord and sorted it. To maximize the difference in dictionary order, s is a → z order and t is z → a. All you have to do is compare.
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')
I was inspired by the wings of mathematics, so I will do my best for quantum computers. see you
Recommended Posts