구현

Algorithm/PS

[BOJ/백준] 9366 - 삼각형 분류 [python]

문제 링크 9366번: 삼각형 분류 입력의 첫 줄에는 테스트케이스의 개수 T(1

Algorithm/PS

[BOJ/백준] 9317 - Monitor DPI [python]

문제 링크 9317번: Monitor DPI Each input line will have 3 numbers, the decimal value D, the integer value \(\text{Resolution}_{\text{Horizontal}}\), and the integer value \(\text{Resolution}_{\text{Vertical}}\). An input line of three zeroes will signify end of input www.acmicpc.net 문제 풀이 입력값을 받고, 문제에 나오는 공식을 적용해 출력해주면 된다. 정답 코드 while True : D, RH, RV = map(float, input().split()) if D == RH == RV ==..

Algorithm/PS

[BOJ/백준] 9310 - Arithmetic and Geometric Sums [python]

문제 링크 9310번: Arithmetic and Geometric Sums The input will be given by 2 lines for each data set. The first line will be N, the term to which the sum should be computed. The next line of data is the series of numbers. They will be integers with a space separating each one. The series will be either www.acmicpc.net 문제 풀이 입력값이 등차수열 혹은 등비수열일 경우에 따라 다른 조건으로 계산해준 뒤 출력해준다. 정답 코드 while True : n = int(in..

Algorithm/PS

[BOJ/백준] 9306 - Practice: Roll Call [python]

문제 링크 9306번: Practice: Roll Call For each case, output the line “Case x:” where x is the case number, on a single line. This is followed by the full name entered, using the format “Last, First”. www.acmicpc.net 문제 풀이 입력값을 두 줄씩 받고, 두번째 줄이 먼저 출력될 수 있도록 구현한다. 정답 코드 for i in range(1, int(input()) + 1) : a = input() b = input() print(f"Case {i}: {b}, {a}")

Algorithm/PS

[BOJ/백준] 9299 - Math Tutoring [python]

문제 링크 9299번: Math Tutoring For each case, output the line “Case x:” where x is the case number, on a single line. The output polynomial is to be formatted in the same manner as the input: the first value being the highest polynomial, and the successive values being the coefficie www.acmicpc.net 문제 풀이 이 문제는 도함수를 구하는 문제이다. 한 줄씩 입력값이 주어질 때, 그 값들에 차수를 곱해주면 된다. 정답 코드 for i in range(1, int(input()) + ..

Algorithm/PS

[BOJ/백준] 9295 - 주사위 [python]

문제 링크 9295번: 주사위 각 테스트 케이스마다 "Case x: "를 출력한 다음, 주사위를 두 번 던져 나온 두 수의 합을 출력한다. 테스트 케이스 번호(x)는 1부터 시작한다. www.acmicpc.net 문제 풀이 테스트케이스마다 주어지는 두 수의 합을 조건에 맞게 출력한다. 정답 코드 for i in range(1, int(input()) + 1) : n, m = map(int, input().split()) print(f"Case {i}: {n + m}")

Algorithm/PS

[BOJ/백준] 9288 - More Dice [python]

문제 링크 9288번: More Dice For each case, output the line “Case x:” where x is the case number, on a single line. Then output a list of possible dice-pairs that result in that sum, one on each line. Each dice-pair should be comma-separated and enclosed by parentheses. In each pa www.acmicpc.net 문제 풀이 이 문제는 두 개의 주사위의 합으로 주어진 입력값을 표현할 수 있는 경우의 수를 구하는 문제이다. 두 주사위 중 처음으로 출력될 주사위는 두번째로 출력될 주사위보다 작아야하므로 그..

Algorithm/PS

[BOJ/백준] 9286 - Gradabase [python]

문제 링크 9286번: Gradabase For each case, output the line “Case x:” where x is the case number, on a single line, followed by a list of integers, each on a new line, between 1 and 6. If the student has graduated from the school, do not print them. www.acmicpc.net 문제 풀이 조건에 따라 입력값을 받고, 입력값 + 1이 1이상 6이하일 경우 출력하는 문제이다. 정답 코드 import sys input = sys.stdin.readline for i in range(1, int(input()) + 1) : pr..

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