Ledger Nano X - The secure hardware wallet
SHARE
TWEET

Untitled

a guest Apr 10th, 2020 138 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. n = int(input())
  2. m = 80
  3. a = [[0, 0] for i in range(m)]
  4. for i in range(n):
  5.     k = int(input())
  6.     if k > a[k % m][1]:
  7.             a[k % m][0] = a[k % m][1]
  8.             a[k % m][1] = k
  9.     elif k > a[k % m][0]:
  10.         a[k % m][0] = k
  11. ans1, ans2 = 0, 0
  12. for i in range(m):
  13.     if a[i][0] != 0 and ans1 + ans2 < a[i][0] + a[i][1]:
  14.         ans1, ans2 = a[i][0],  a[i][1]
  15. print(ans1, ans2)
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Top