문제 링크 9771번: Word Searching The first line contains a single word to search. A word contains at most 20 characters. The next line and the rest is a text to search for that word. The text can contain up to 100 lines including blank lines. No line exceeds 250 characters. A word cannot www.acmicpc.net 문제 풀이 EOF가 입력될 때 까지 입력값을 받으며, 입력값 중 특정한 문자가 발견된다면 그 문자가 발견된 횟수를 출력해준다. 정답 코드 s = input() cnt = 0 t..
문제 링크 9724번: Perfect Cube A perfect cube is an integer whose cube root is also an integer. For example 1, 8, 27, 64, 125, etc. are examples of perfect cubes but 9, 25 and 113 are not. Given two positive integers A and B, your task is to calculate the number of perfect cubes in the www.acmicpc.net 문제 풀이 두 입력값 A와 B 사이의 완전 세제곱수의 갯수를 출력해준다. 정답 코드 for i in range(1, int(input()) + 1) : A, B = map(int,..
문제 링크 9723번: Right Triangle For each test case, the output contains a line in the format Case #x: M, where x is the case number (starting from 1) and M is “YES” when the given triangle is a right triangle or “NO” otherwise. Note that the quotes are not required to be outputte www.acmicpc.net 문제 풀이 테스트마다 입력값들이 직각삽각형이 가능한 지 피타고라스 정리를 통해 판단한다. 정답 코드 for i in range(1, int(input()) + 1) : triangle = ..
문제 링크 9713번: Sum of Odd Sequence First line of the input contains T, the number of test cases. Each test case contains a single integer N. N is between 1 and 100. www.acmicpc.net 문제 풀이 주어진 케이스의 입력값마다 1부터 입력값까지의 홀수의 합을 구해 출력해준다. 정답 코드 for _ in range(int(input())) : n = int(input()) ans = 0 for i in range(1, n + 1, 2) : ans += i print(ans)
문제 링크' 9699번: RICE SACK For each test case, the output contains a line in the format Case #x: followed by a sequence of integers, where x is the case number (starting from 1) and an integer that indicates the weight of a rice sack that will go to Al-Ameen. www.acmicpc.net 문제 풀이 각 케이스마다 최댓값을 출력한다. 정답 코드 for i in range(1, int(input()) + 1) : print("Case #{:d}: {:d}".format(i, max([*map(int, input(..
문제 링크 9698번: SAHUR & IMSA’ Midhat is a Network Security Engineer, based in Sarajevo. He is assigned to do some important consultation projects around the globe in July and August 2013. It happened that Ramadhan (the fasting month for Muslim) falls during these months for the year 20 www.acmicpc.net 문제 풀이 시간, 분이 케이스마다 입력되는데, 입력된 시간에서 45분 전 시간을 출력해준다. 정답 코드 for i in range(1, int(input()) + 1) : H,..
문제 링크 9635번: Balloons Colors Your program will be tested on one or more test cases. The first line of the input will be a single integer T, the number of test cases (1 ≤ T ≤ 100). Followed by the test cases, the first line of each test case contains 3 integers separated by a singl www.acmicpc.net 문제 풀이 입력값마다 문제의 조건을 통해 출력해준다. 첫째 줄에 문제의 갯수 N, 컬러 X, Y가 주어진다. 두번 째 줄에서는 문제의 리스트가 주어진다. X, Y가 각각 문제의 리..
문제 링크 9622번: Cabin Baggage The first line contains an integer t (1≤ t ≤ 300) which determines the number of test cases (i.e. cabin baggage to verify). The following t lines contain the measurement of cabin baggage. Each line contains 4 values which are length, width, depth and w www.acmicpc.net 문제 풀이 문제의 조건에 맞게 입력값을 처리해주면 된다. 정답 코드 cnt = 0 for _ in range(int(input())) : a, b, c, d = map(float, i..