Created
May 30, 2019 21:49
-
-
Save lucas404x/d3e8abe4327a217202e873da4120f4ad 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
n = int(input()) | |
n1 = int(input()) | |
n2 = int(input()) | |
n3 = n - (n1 + n2) | |
if n1 > n2 and n1 > n3: | |
print(n1) | |
elif n2 > n1 and n2 > n3: | |
print(n2) | |
else: | |
print(n3) |
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
n = [0 for i in range(int(input()))] | |
repetem = [] | |
for i in range(len(n)): | |
n[i] = int(input()) | |
if len(n) == 1: | |
print(1) | |
else: | |
for i in range(len(n)): | |
if n.count(n[i]) > 1 and not n[i] in repetem: | |
repetem.append(n[i]) | |
for number in repetem: | |
oneNumber = n.index(number) | |
if n[oneNumber] == n[oneNumber + 1] or n[oneNumber] == n[oneNumber - 1]: | |
repetem.remove(number) | |
print(len(repetem) * 2) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment