[python][hackerrank] Jumping on the Clouds: Revisited
아직은 역시 웜업 단계인가 보다.
쉽다.
n, k = tuple(map(int, input().strip().split(' ')))
c = tuple(map(int, input().strip().split(' ')))
result =100
tmp =0whileTrue:
tmp =(tmp + k)% n
result -=(1+ c[tmp]*2)if tmp ==0:breakprint(result)
댓글 없음:
댓글 쓰기