풀이 실패 .
.. 난 진짜 거속시랑 전부터 안 친했다 .. ㅎ
운전을 하는 지금도 이 개념이 참 안 들어온다.. 하 . 이번 기회에 짚고 가서 다행이다.
내가 조금 더 상식적인 사람이 되는 것에 기여해줄 소중한 문제라고 예뻐하며 기분 좋게 공부해보자..
생각보다 단순했다.. 뭐 가속도 곱하고 나누고 어쩌고 그래야하는 줄 알았는데..
문제 이해하느라 시간 소요 많이 함..
해당 개념과 관련된 내용 또 만났을 때 당황하지 않게 연관된 문제들 찾아서 몇 개 더 풀어봐야겠다.
1차 제출 [ 10 / 10 ] PASS
T = int(input())
for tc in range(1, T+1):
n = int(input())
distance = 0
add_val = 0
for i in range(n):
command = input()
if command[0] != '0':
command, speed = command.split()
speed = int(speed)
if command == '1':
add_val += speed
elif command == '2':
add_val -= speed
if add_val < 0:
add_val = 0
distance += add_val
print('#{} {}'.format(tc, distance))
'CodingTest > SW Expert Academy' 카테고리의 다른 글
[ SW Expert Academy ] 1285. 아름이의 돌 던지기(python) (0) | 2022.11.15 |
---|---|
[ SW Expert Academy ] 1288. 새로운 불면증 치료법 (0) | 2022.11.15 |
[ SW Expert Academy ] 1945. 소인수분해 (0) | 2022.11.15 |
[ SW Expert Academy ] 1976. 시각 덧셈 (0) | 2022.11.15 |
[ SW Expert Academy ] 1966. 숫자를 정렬하자 (0) | 2022.11.15 |