lis1 [백준] 1365번 '꼬인 전깃줄' - Python https://www.acmicpc.net/problem/1365 1365번: 꼬인 전깃줄 첫 줄에 전봇대의 개수 N(1 ≤ N ≤ 100,000)이 주어지고, 이어서 N보다 작거나 같은 자연수가 N개 주어진다. i번째 줄에 입력되는 자연수는 길 왼쪽에 i번째 전봇대와 연결된 길 오른편의 전봇대가 www.acmicpc.net 문제 풀이 import sys input = sys.stdin.readline n = int(input().rstrip()) pole = list(map(int, input().rstrip().split())) def binary_search(left, right, target): while left < right: mid = (left + right) // 2 if list[mid.. 2023. 12. 29. 이전 1 다음