Break through in two and a half minutes. Well, just write.
K = int(input())
t = [1, 1, 1, 2, 1, 2, 1, 5, 2, 2, 1, 5, 1, 2, 1, 14, 1, 5, 1, 5, 2, 2, 1, 15, 2, 2, 5, 4, 1, 4, 1, 51]
print(t[K - 1])
Break through in about 6 minutes. 1WA. I completely forgot the case where H and W are 1.
H, W = map(int, input().split())
if H == 1 or W == 1:
print(1)
elif W % 2 == 0:
print(H * W // 2)
else:
if H % 2 == 0:
print(H * W // 2)
else:
print((W + 1) // 2 + (H - 1) * W // 2)
panasonic2020C - Sqrt Inequality
Lost. Even though I knew that I had to calculate with an integer, I couldn't drop it into an integer formula. If I was told that I should square it twice, I would understand it immediately. For some reason, I don't know during the contest. orz. I hate math problems.
a, b, c = map(int, input().split())
if c - a - b > 0 and (c - a - b) * (c - a - b) > 4 * a * b:
print('Yes')
else:
print('No')
panasonic2020D - String Equivalence
Break through in 32 and a half minutes. 1WA. No matter how many times I read it, I was in trouble because the definition did not come to my mind. So, I completely misunderstood the definition and ate WA, and then until about N = 4 I finally understood by writing everything by hand AC. In short, the answer is that I added the character string from a to the next one in the largest dictionary order of the characters that have appeared so far.
N = int(input())
q = ['a']
for i in range(N - 1):
nq = []
for s in q:
stop = ord(max(s)) + 2
for i in range(ord('a'), stop):
nq.append(s + chr(i))
q = nq
for s in q:
print(s)
Recommended Posts