본문 바로가기

백준1056

백준 11104 Fridge of Your Dreams https://www.acmicpc.net/problem/11104 11104번: Fridge of Your Dreams Eirik drinks a lot of Bingo Cola to help him program faster, and over the years he has burned many unnecessary calories walking all the way to the kitchen to get some. To avoid this he has just bought a small fridge, which is beautifully placed next to his www.acmicpc.net 1 2 3 4 5 6 7 8 9 10 def sol(n): answer = int(n,2) return.. 2022. 11. 30.
백준 26082 WARBOY https://www.acmicpc.net/problem/26082 26082번: WARBOY 첫째 줄에 세 양의 정수 $A$, $B$, $C$($1 \le A, B, C \le 1\,000$)가 공백으로 구분되어 주어진다. $\mathbf{\mathit{B}}$는 항상 $\mathbf{\mathit{A}}$의 배수이다. www.acmicpc.net 1 2 3 4 5 6 7 def sol(a,b,c): answer = int(b/a)*3*c return answer if __name__ == '__main__': a, b, c= map(int, input().split()) print(sol(a,b,c)) cs 사칙연산입니다 Just calculate 2022. 11. 30.
백준 25828 Corona Virus Testing https://www.acmicpc.net/problem/25828 25828번: Corona Virus Testing Testing for Corona can be done individually, e.g., 100 people require 100 test kits. Alternatively, the test can be done in groups (pools), e.g., 100 people can be divided into five group of 20 people each and then using only one test kid per group. If one www.acmicpc.net 1 2 3 4 5 6 7 8 9 10 11 12 13 14 def sol(g,p,t): origin = .. 2022. 11. 30.
백준 17903 Counting Clauses https://www.acmicpc.net/problem/17903 17903번: Counting Clauses The input is a single instance of the 3-SAT problem. The first line is two space-separated integers: m (1 ≤ m ≤ 20), the number of clauses and n (3 ≤ n ≤ 20), the number of variables. Then m clauses follow, one clause per line. Each clause consists www.acmicpc.net 1 2 3 m, n = map(int, input().split()) print("satisfactory" if m >= 8 .. 2022. 11. 30.
백준 3060 욕심쟁이 돼지 https://www.acmicpc.net/problem/3060 3060번: 욕심쟁이 돼지 입력은 T개의 테스트 데이터로 구성된다. 입력의 첫 번째 줄에는 입력 데이터의 수를 나타내는 정수 T가 주어진다. 각 테스트 데이터는 두 줄로 구성되어 있고, 첫째 줄에는 하루에 배달되는 사 www.acmicpc.net 1 2 3 4 5 6 7 8 9 10 11 12 13 14 def sol(food, pigs): total_sum =sum(pigs) days = 1 while food>=total_sum: total_sum+=total_sum*3 days+=1 return days if __name__ == '__main__': n=int(input()) for i in range(n): food = int(i.. 2022. 11. 30.
백준 25915 연세여 사랑한다 https://www.acmicpc.net/problem/25915 25915번: 연세여 사랑한다 훈규가 비밀번호를 모두 입력하기 위한 이동 거리의 최솟값을 출력한다. www.acmicpc.net 1 2 3 4 5 6 7 8 9 10 11 def sol(c, yonsei): answer = 0 yonsei.insert(0,c) for i in range(1,len(yonsei)): answer+=abs(ord(yonsei[i])-ord(yonsei[i-1])) return answer if __name__ == '__main__': c =input() yonsei = (list('ILOVEYONSEI')) print(sol(c,yonsei)) cs 2022. 11. 30.
백준 15372 A Simple Problem. https://www.acmicpc.net/problem/15372 15372번: A Simple Problem. For each test case, output a single line containing the integer K, the answer for that test case. www.acmicpc.net 1 2 3 4 5 6 7 8 9 import sys def sol(n): return n*n if __name__ == '__main__': t = int(input()) for _ in range(t): n = int(sys.stdin.readline()) print(sol(n)) cs sys.stdin.readline() 입력 받으셔야 시간초과 안떠요 2022. 11. 30.
백준 13623 Zero or One https://www.acmicpc.net/problem/13623 13623번: Zero or One Everyone probably knows the game Zero or One (in some regions in Brazil also known as Two or One), used to determine a winner among three or more players. For those unfamiliar, the game works as follows. Each player chooses a value between zero or one; pro www.acmicpc.net 1 2 3 4 5 6 7 8 9 10 11 12 13 def sol(a,b,c): answer = '*' if a!=b .. 2022. 11. 30.
백준 25600 Triathlon https://www.acmicpc.net/problem/25600 25600번: Triathlon 트라이애슬론(Triathlon)이란 라틴어에서 $3$가지라는 의미를 가진 tri와 경기를 뜻하는 athlon의 합성어이다. 우리나라에서는 트라이애슬론 대신 철인 3종 경기로 알려져 있다. 트라이애슬론은 여러 www.acmicpc.net 1 2 3 4 5 6 7 8 9 10 if __name__ == '__main__': scores =[] n = int(input()) for _ in range(n): a,d,g=map(int,input().split()) score = a*(d+g) if a == (d+g): score*=2 scores.append(score) print(max(scores)) cs 2022. 11. 29.
백준 25881 Electric Bill https://www.acmicpc.net/problem/25881 25881번: Electric Bill The first input line contains two integers (each between 2 and 20, inclusive), indicating the rate/KWH for the first 1000 KWH and the rate/KWH for the additional usage, respectively. The next input line contains a positive integer, n, indicating the number www.acmicpc.net 1 2 3 4 5 6 7 if __name__ == '__main__': first_price, second_pric.. 2022. 11. 29.
백준 25983 Majestic 10 https://www.acmicpc.net/problem/25893 25893번: Majestic 10 The movie “Magnificent 7” has become a western classic. Well, this year we have 10 coaches training the UCF programming teams and once you meet them, you’ll realize why they are called the “Majestic 10”! The number 10 is actually special in many www.acmicpc.net 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 def sol(nums): tri.. 2022. 11. 29.
백준 25858 Divide the Cash https://www.acmicpc.net/problem/25858 25858번: Divide the Cash The UCF Programming Team coaches schedule practices regularly in fall and spring (by the way, all UCF students are welcome to the practices). During summer, the majority of the team members are gone but the coaches know how to make sure the students don’ www.acmicpc.net 1 2 3 4 5 6 7 8 if __name__ == '__main__': n_students, total_priz.. 2022. 11. 29.