Created
April 7, 2021 16:17
-
-
Save VxDxK/00b75aa8c2bbd8ff0e6a090983c76274 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("test.txt") | |
def get(): | |
return list( map(int, f.readline().split())) | |
n = int(f.readline()) | |
s = get() | |
for i in range(n - 1): | |
para = get() | |
cmb = [a + b for a in s for b in para] | |
#print(cmb) | |
s1 = [0] * 10 | |
for x in cmb: | |
if x > s1[x % 10]: | |
s1[x % 10] = x | |
s = [x for x in s1 ] | |
print(s) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment