CodingTest/Softeer (1) 썸네일형 리스트형 [ Softeer ] 통근버스 출발 순서 검증하기 첫 제출에서 테케가 다 맞는 것도 어쩌면 행운이 아니라 불행이더라. 신나서 검토 과정 없이 제출하게 됨 ; from itertools import combinations import sys input = sys.stdin.readline n = int(input()) buses = list(map(int, input().split())) count = 0 dict = {} for i in range(len(buses)): dict[i] = buses[i] comb = list(combinations(range(len(buses)),3)) for c in comb: if dict[c[0]] dict[c[2]]: count += 1 print(count).. 이전 1 다음