fork download
  1. #!/usr/bin/env python3
  2. from statistics import median, median_high
  3.  
  4. def foo(x):
  5. return median_high(x) if len(x) % 2 == 0 else median(x)
  6.  
  7. if __name__ == '__main__':
  8. n = int(input())
  9. a = [int(x) for x in input().split(' ')[:n]]
  10. print(foo([foo(k) for k in sum([[a[j: i + j + 1]
  11. for j in range(n) if i + j < n]
  12. for i in range(n)], [])]))
  13.  
Runtime error #stdin #stdout #stderr 0.14s 26460KB
stdin
Standard input is empty
stdout
Standard output is empty
stderr
Traceback (most recent call last):
  File "./prog.py", line 8, in <module>
EOFError: EOF when reading a line