백준 2512. 예산
·
백준
https://www.acmicpc.net/problem/2512 2512번: 예산 첫째 줄에는 지방의 수를 의미하는 정수 N이 주어진다. N은 3 이상 10,000 이하이다. 다음 줄에는 각 지방의 예산요청을 표현하는 N개의 정수가 빈칸을 사이에 두고 주어진다. 이 값들은 모두 1 이상 www.acmicpc.net n = int(input()) lst = list(map(int,input().split())) budget = int(input()) start, end = 0, max(lst) while start mid: total += mid else: total += i if total
백준 5073. 삼각형과 세 변
·
백준
https://www.acmicpc.net/problem/5073 5073번: 삼각형과 세 변각 입력에 맞는 결과 (Equilateral, Isosceles, Scalene, Invalid) 를 출력하시오.www.acmicpc.netimport sysinput = sys.stdin.readlinewhile True: lst = list(map(int,input().split())) if lst[0] == lst[1] == lst[2] == 0: break lst.sort() if lst[2] >= lst[0] + lst[1]: print('Invalid') else: if len(set(lst)) == 1: print('..
백준 20920. 영단어 암기는 괴로워
·
백준
https://www.acmicpc.net/problem/20920 20920번: 영단어 암기는 괴로워 첫째 줄에는 영어 지문에 나오는 단어의 개수 $N$과 외울 단어의 길이 기준이 되는 $M$이 공백으로 구분되어 주어진다. ($1 \leq N \leq 100\,000$, $1 \leq M \leq 10$) 둘째 줄부터 $N+1$번째 줄까지 외울 단 www.acmicpc.net import sys input = sys.stdin.readline n, m = map(int, input().split()) word_dict = {} for _ in range(n): word = input().rstrip() if len(word) >= m: if word in word_dict: word_dict[word]..
2학기 특화 프로젝트 회고 - 1
·
ssafy
보호되어 있는 글입니다.
백준 13305. 주유소
·
백준
https://www.acmicpc.net/problem/13305 13305번: 주유소 표준 입력으로 다음 정보가 주어진다. 첫 번째 줄에는 도시의 개수를 나타내는 정수 N(2 ≤ N ≤ 100,000)이 주어진다. 다음 줄에는 인접한 두 도시를 연결하는 도로의 길이가 제일 왼쪽 도로부터 N-1 www.acmicpc.net n = int(input()) # 도시의 개수 len = list(map(int,input().split())) # 도로의 길이 cost = list(map(int,input().split())) # 주유소 리터당 가격 # 여태까지 지났던 주유소의 리터당 가격 중 가장 작은 값으로 도로를 이동 res = 0 min_cost = cost[0] for i in range(n-1): if..
백준 17266. 어두운 굴다리
·
백준
https://www.acmicpc.net/problem/17266 17266번: 어두운 굴다리 인하대학교 후문 뒤쪽에는 어두운 굴다리가 있다. 겁쟁이 상빈이는 길이 조금이라도 어둡다면 가지 않는다. 따라서 굴다리로 가면 최단거리로 집까지 갈수 있지만, 굴다리는 어둡기 때문에 빙 www.acmicpc.net import sys input = sys.stdin.readline n = int(input()) # 굴다리의 길이 m = int(input()) # 가로등의 개수 L = list(map(int,input().split())) # 설치 가능한 가로등의 위치 start, end = 0, n # 이분 탐색을 위한 시작점과 끝점 ans = n # 최소 높이의 최대값으로 초기화 while start