SHARE
TWEET

Untitled

a guest Dec 8th, 2019 70 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #include <iostream>
  2. #include <vector>
  3. #include <algorithm>
  4.  
  5. using namespace std;
  6.  
  7. int main() {
  8.     int n;
  9.     cin >> n;
  10.     vector <unsigned int> a(n);
  11.     for (int i = 0; i < n; i++) {
  12.         cin >> a[i];
  13.     }
  14.     sort(a.begin(), a.end());
  15.     cout << a[a.size() - 2] + a[a.size() - 1];
  16.     return 0;
  17. }
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