Created
February 21, 2014 23:27
-
-
Save rorhug/9145824 to your computer and use it in GitHub Desktop.
aipo final 2013 q3
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(raw_input()) | |
a = [ int(raw_input()) for x in range(n) ] | |
average_count = 0 | |
for (i, el) in enumerate(a): | |
a.pop(i) # remove that element | |
for to_avg_with in a: | |
avg = (el + to_avg_with) / 2 | |
if avg in a: | |
average_count += 1 | |
print(average_count) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment