|
|
back to boardвыдает runtime error python Posted by ana 16 Jun 2021 03:22 Постоянно выдает runtime error! в чем может быть причина? import math, sys, itertools from collections import Counter _w = list(map(int,sys.stdin.read().split())) if _w[0] % 2 == 0: n = _w[0]/2 else: n = _w[0]/2 + 1 s_group_list = [] iter_list = list(itertools.combinations(_w[1:], n)) for i in iter_list: s_group_list.append(list((Counter(_w[1:]) - Counter(i)).elements())) t = list(zip(iter_list,s_group_list)) for i in t: final_list.append(abs(sum(i[0]) - sum(i[1]))) print(min(final_list)) Edited by author 16.06.2021 03:27 |
|
|