문제 링크 5666번: Hot Dogs In 2012 a new world record was set in the famous Nathan’s Hot Dog Eating Competition: the champion, Joey Chestnut, ate 68 hot dogs in ten minutes, an amazing increase from the 62 hot dogs eaten by the same Chestnut in 2011. Nathan’s Famous Corporation, www.acmicpc.net 문제 풀이 입력값에 EOF가 들어올 때 까지 계속 계산 결과를 출력해준다. 계산은 단순 사칙연산이고, 소숫점 2번째 자리까지 출력한다. 정답 코드 try : while True : a, b =..
문제 링크 5356번: Triangles Read in a letter and a number. The number indicates how big the letter triangle should be. The number indicating the size of the triangle will have a range from 0 to 250 (i.e., num>=0 and num
문제 링크 5354번: J박스 첫째 줄에 테스트 케이스의 개수가 주어진다. 각 테스트 케이스는 한 줄로 이루어져 있고, 박스의 크기가 주어진다. 박스의 크기는 10보다 작거나 같다. www.acmicpc.net 문제 풀이 이 문제는 단순 출력 문제이다. 단 고려해하는 경우가 있다. 케이스마다 빈 줄 하나씩 출력 박스의 크기가 1인 경우 개인적으로 박스를 만들어줄 때, 첫번째 줄과 마지막 줄을 따로 출력을 해줘서 박스의 크기가 1인 경우에 첫줄에서 "#"출력, 마지막줄에서 "#"출력이 되어 틀렸었다. 주의하자. 정답 코드 t = int(input()) for i in range(t) : n = int(input()) print("#" * n) mid = "#" + "J" * (n - 2) + "#" for..
문제 링크 5342번: Billing The accounting office is having troubling with billing each department for the supplies purchased last semester. Below is a chart of all the supplies and how much they cost. You must write a program that reads a list of the supplies and computes the total www.acmicpc.net 문제 풀이 각 물건에 해당하는 가격을 저장한 후, 입력값을 받을 때마다 물건의 가격을 더해준다. 출력은 소수점 2번째 자리까지만 출력해준다. 정답 코드 costs = {"Paper" : 5..
문제 링크 5340번: Secret Location Someone is waiting at a secret location and has sent a text message with the coordinates of their location. The message contains the latitude and longitude coordinates in degrees, minutes, and seconds. Of course, the message is encoded so you must write a www.acmicpc.net 문제 풀이 이 문제는 총 6줄의 문자열이 주어지는데, 각각의 문자열의 길이를 출력 조건에 맞게 출력해주면 된다. 단, 이 문제가 문자열 중 마지막 문자로 공백이 들어올 수도 ..
문제 링크 5292번: Counting Swann’s Coins Governor Weatherby Swann orders you to count the number of coins in the government treasury. To make the job more interesting you decide to say ”Dead” for all numbers that are a multiple of 3 and ”Man” for all numbers that are a multiple of 5. For www.acmicpc.net 문제 풀이 3의 배수이면 "Dead"를 출력하고, 5의 배수를 "Man"을 출력한다. 3의 배수이자 5의 배수라면 "DeadMan"을 출력한다. 그 외의 수일 경우, 출력하고 ..
문제 링크 5102번: Sarah's Toys Input will be a number of lines, with each line representing a night in Sarah’s house. Each line will have 2 whole numbers, separated by a space. The first number is how many stuffed toys she owns at the time. The second number is the number of toys left www.acmicpc.net 문제 풀이 몫과 나머지를 조건에 맞게 구해주는 문제이다. 두 입력값 a, b가 주어진다면, 현재 사라가 가지고 있는 장난감의 수는 a - b이다. 따라서 a - b의 값에 따라 출력..
문제 링크 5074번: When Do We Finish? For each line of input, produce one line of output containing a single time, also in the format hh:mm, being the end time of the event as a legal 24 hour time. If this time is not on the same day as the start time, the time will be in the format hh:mm +n, www.acmicpc.net 문제 풀이 이 문제는 시작 시간과 소요 시간이 주어지고, 끝나는 시간을 출력하는 문제이다. 먼저, 형식에 맞게 입력값을 받아준 뒤, 시작 시간에 소요 시간을 더해주고, ..