Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <bits/stdc++.h>
- using namespace std;
- #define ll long long
- #define _test int _TEST; cin>>_TEST; while(_TEST--)
- #define ff first
- #define pb push_back
- int main()
- {
- int n;
- cin>>n;
- vector<int> a(n);
- for(auto &e: a)
- cin>>e;
- sort(a.begin(), a.end());
- for(int i=1; ;i++)
- {
- if(a[i]-1 != a[i-1])
- {
- cout<<a[i]-1<<"\n";
- break;
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment