BOJ - 15953 - 상금 헌터
Updated:
import sys
def solution():
T = int(input())
rank = []
for _ in range(T):
rank.append(list(map(int, sys.stdin.readline().split())))
money = [0] * T
for i in range(T):
if rank[i][0] > 0:
if rank[i][0] == 1:
money[i] += 5000000
elif rank[i][0] <= 3:
money[i] += 3000000
elif rank[i][0] <= 6:
money[i] += 2000000
elif rank[i][0] <= 10:
money[i] += 500000
elif rank[i][0] <= 15:
money[i] += 300000
elif rank[i][0] <= 21:
money[i] += 100000
if rank[i][1] > 0:
if rank[i][1] == 1:
money[i] += 5120000
elif rank[i][1] <= 3:
money[i] += 2560000
elif rank[i][1] <= 7:
money[i] += 1280000
elif rank[i][1] <= 15:
money[i] += 640000
elif rank[i][1] <= 31:
money[i] += 320000
for i in money:
print(i)
solution()
https://www.acmicpc.net/problem/15953
Leave a comment