3273
-
[ Python] BOJ 3273 : 두 수의 합코딩테스트/백준 2024. 10. 10. 08:13
https://www.acmicpc.net/problem/3273요구사항시간 제한 1초 지만 N O(N**2) 는 힘들다. 메모리 제한 128M지만 100,000이라 리스트를 너무 남발하면 초과할 것. 설계 1combinations 모듈을 불러와서 2개의 조합을 구한다.자연수 x와 조합의 합이 같은 지 비교하여 count 한다.구현 1import sysfrom itertools import combinationsinput = lambda: sys.stdin.readline().rstrip()N = int(input())n_list = tuple(map(int, input().split()))compare_num = int(input())count = 0for combi in combinations(n_l..