Saleh127

codeforces 1358B.cpp

May 26th, 2020
140
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.53 KB | None | 0 0
  1. #include <bits/stdc++.h>
  2. using namespace std;
  3. #define test int t; cin>>t; while (t--)
  4. #define ll long long int
  5. #define pi acos(-1)
  6. int main()
  7. {
  8. ll a[200005],c,d,e,f,i,j,k,l;
  9. test
  10. {
  11. l=0;
  12. e=0;
  13. f=0;
  14. j=0;
  15. cin>>c;
  16. for(i=0;i<c;i++)
  17. {
  18. cin>>a[i];
  19. }
  20. sort(a,a+c);
  21. for(i=0;i<c;i++)
  22. {
  23. e++;
  24. if(e>=a[i])
  25. {
  26. l=e;
  27. }
  28. }
  29. cout<<l+1<<endl;
  30. }
  31. return 0;
  32. }
Advertisement
Add Comment
Please, Sign In to add comment