구현

Algorithm/PS

[BOJ/백준] 4635 - Speed Limit [python]

문제 링크 4635번: Speed Limit The input consists of one or more data sets. Each set starts with a line containing an integer n, 1 ≤ n ≤ 10, followed by n pairs of values, one pair per line. The first value in a pair, s, is the speed in miles per hour and the second value, t, is t www.acmicpc.net 문제 풀이 단순한 사칙연산 문제이다. 다만, 입력값으로 주어지는 t가 누적값이므로 주의하자. 정답 코드 while True : n = int(input()) if n == -1 : break..

Algorithm/PS

[BOJ/백준] 4562 - No Brainer [python]

문제 링크 4562번: No Brainer For each data set, there will be exactly one line of output. This line will be "MMM BRAINS" if the number of brains the zombie eats is greater than or equal to the number of brains the zombie requires to stay alive. Otherwise, the line will be "NO BRAINS". www.acmicpc.net 문제 풀이 x와 y가 주어지는데, x가 y보다 같거나 크다면 "MMM BRAINS"를, 아니라면 "NO BRAINS"를 출력해준다. 정답 코드 for _ in range(int(in..

chanwoong1
'구현' 태그의 글 목록 (10 Page)