I was able to AC up to the C problem. Achieved the goal because the goal is AC of A-C problem.
A - Takoyaki I wrote it according to the problem.
import math
N,X,T = map(float,input().split())
a = math.ceil(N / X)
print(int(a * T))
B - Multiple of 9 I wrote this along with the problem.
N = list(map(int,input().split()))
a = 0
for i in range(len(N)):
a += N[i]
if a % 9 == 0:
print("Yes")
else:
print("No")
It looks like this was good. Concise and easy to understand.
N = int(input())
if N % 9 == 0:
print('Yes')
else:
print('No')
C - Step Add the stand until it is the same height as the previous person.
N = int(input())
A = list(map(int,input().split()))
ans = 0
for i in range(1,N):
diff = A[i - 1] - A[i]
if diff <= 0:
pass
else:
ans += diff
A[i] += diff
print(ans)
D - Wizard in Maze It was an unknown area after the D problem. Let's do our best to study past questions and algorithms.
I'm glad that I was able to AC up to the target C problem. Where you want to do your best with the goal of being quick and accurate.
Recommended Posts