Skip to content

Instantly share code, notes, and snippets.

@Eckankar
Created October 6, 2013 08:55
Show Gist options
  • Select an option

  • Save Eckankar/6851413 to your computer and use it in GitHub Desktop.

Select an option

Save Eckankar/6851413 to your computer and use it in GitHub Desktop.
Fwnies' solution to NCPC 2013 Problem A
import sys
sys.stdin.readline()
line = sys.stdin.readline()
xs = [int(x) for x in line.split()]
xs = sorted(xs)[::-1]
res = max(x + y + 2 for x, y in enumerate(xs))
print res
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment