목록알고리즘/풀이 (181)
규도자 개발 블로그
Objective In this challenge, you'll work with arithmetic operators. Check out the Tutorial tab for learning materials and an instructional video! Task Given the meal price (base cost of a meal), tip percent (the percentage of the meal price being added as tip), and tax percent(the percentage of the meal price being added as tax) for a meal, find and print the meal's total cost. Note: Be sure to ..
Objective Today, we're discussing data types. Check out the Tutorial tab for learning materials and an instructional video! Task Complete the code in the editor below. The variables , , and are already declared and initialized for you. You must:Declare variables: one of type int, one of type double, and one of type String.Read lines of input from stdin (according to the sequence given in the Inp..
Objective In this challenge, we review some basic concepts that will get you started with this series. You will need to use the same (or similar) syntax to read input and write output in challenges throughout HackerRank. Check out the Tutorial tab for learning materials and an instructional video! Task To complete this challenge, you must save a line of input from stdin to a variable, print Hell..
HackerLand University has the following grading policy:Every student receives a in the inclusive range from to .Any less than is a failing grade.Sam is a professor at the university and likes to round each student's according to these rules:If the difference between the and the next multiple of is less than , round up to the next multiple of .If the value of is less than , no rounding occurs as ..
Sam's house has an apple tree and an orange tree that yield an abundance of fruit. In the diagram below, the red region denotes his house, where is the start point, and is the endpoint. The apple tree is to the left of his house, and the orange tree is to its right. You can assume the trees are located on a single point, where the apple tree is at point , and the orange tree is at point .When a ..
[백준/10950/파이썬] A+B - 3 문제 두 정수 A와 B를 입력받은 다음, A+B를 출력하는 프로그램을 작성하시오. 입력 첫째 줄에 테스트 케이스의 개수 T가 주어진다.각 테스트 케이스는 한 줄로 이루어져 있으며, 각 줄에 A와 B가 주어진다. (0 < A, B < 10) 출력 각 테스트 케이스마다 A+B를 출력한다. 입출력 예 입력출력 5 1 1 2 3 3 4 9 8 5 22 5 7 17 7 풀이 count = int(input()) result_list = [] for i in range(count): number_input = input().split() number_input = map(int, number_input) result_list.append(sum(number_input)) f..
You are in charge of the cake for your niece's birthday and have decided the cake will have one candle for each year of her total age. When she blows out the candles, she’ll only be able to blow out the tallest ones. Your task is to find out how many candles she can successfully blow out.For example, if your niece is turning years old, and the cake will have candles of height , , , , she will be..
Given five positive integers, find the minimum and maximum values that can be calculated by summing exactly four of the five integers. Then print the respective minimum and maximum values as a single line of two space-separated long integers.For example, . Our minimum sum is and our maximum sum is . We would print16 24 Function DescriptionComplete the miniMaxSum function in the editor below. It ..
Consider a staircase of size : # ## ### #### Observe that its base and height are both equal to , and the image is drawn using # symbols and spaces. The last line is not preceded by any spaces.Write a program that prints a staircase of size .Function DescriptionComplete the staircase function in the editor below. It should print a staircase as described above.staircase has the following paramete..
Given an array of integers, calculate the fractions of its elements that are positive, negative, and are zeros. Print the decimal value of each fraction on a new line.Note: This challenge introduces precision problems. The test cases are scaled to six decimal places, though answers with absolute error of up to are acceptable.For example, given the array there are elements, two positive, two nega..