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