It broke through in 3 minutes. I was confused about how easy it was to write, but since the length is up to 10, I wondered if the possible answer brute force was the fastest.
S = input()
for i in range(1, 6):
if S == 'hi' * i:
print('Yes')
exit()
print('No')
Break through in 8 minutes. It's a B problem, so if you think it's okay to brute force, it's impossible to see the limit. I just had to brute force the discount ticket.
A, B, M = map(int, input().split())
a = list(map(int, input().split()))
b = list(map(int, input().split()))
result = min(a) + min(b)
for _ in range(M):
x, y, c = map(int, input().split())
t = a[x - 1] + b[y - 1] - c
if t < result:
result = t
print(result)
Lost. I wrote only to write, but I ate WA as well as 70% type TLE, so I left about 1 hour left and my heart broke (laugh).
Recommended Posts