Created
May 12, 2021 17:39
-
-
Save VxDxK/7a6362c5391b5fc324b2cbfefdee0cb8 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
f = open("27-a.txt") | |
n = int(f.readline()) | |
arr = [[] for i in range(9)] | |
for i in range(n): | |
now = int(f.readline()) | |
arr[now % 9].append(now) | |
for i in range(9): | |
arr[i].sort() | |
arr[i] = arr[i][0:4] | |
print(arr) | |
t = [] | |
mna = 10000000000 | |
for i in range(1, 10): | |
for j in range(1, 10): | |
for k in range(1, 10): | |
for g in range(1, 10): | |
if i + j + k + g == 9: | |
u = [i, j, k, g] | |
u.sort() | |
u = tuple(u) | |
t.append(u) | |
#print(i, j, k, g) | |
#mna = min(mna, arr[i]) | |
j = list(set(t)) | |
for i in j: | |
print(list(i)) | |
for i in j: | |
s = 0 | |
for k in i: | |
s += arr[k][0] | |
print(s) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment