
[Python] 백준 #2512- 예산
·
코딩테스트/백준[Python]
문제 2512번: 예산 첫째 줄에는 지방의 수를 의미하는 정수 N이 주어진다. N은 3 이상 10,000 이하이다. 다음 줄에는 각 지방의 예산요청을 표현하는 N개의 정수가 빈칸을 사이에 두고 주어진다. 이 값들은 모두 1 이상 www.acmicpc.net 코드 My answer import sys input= sys.stdin.readline N=int(input()) budget=list(map(int,input().split())) target=int(input()) start,end=0,max(budget) while(start=mid else i for i in budget]) if(tmp>target): end = mid-1 else: start = mid+1 print(end) 풀이 이분탐색..