Advertisement
skazzi

Untitled

Dec 18th, 2017
92
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.65 KB | None | 0 0
  1. #include <iostream>
  2. #include <algorithm>
  3. #include <vector>
  4. #include <utility>
  5. #include <string>
  6. #include <set>
  7.  
  8.  
  9. #define forn(i,n) for (int i = 0; i < int(n); i++)
  10. #define pb push_back
  11.  
  12. using namespace std;
  13.  
  14.  
  15. int main()
  16. {
  17. int m;
  18. cin >> m;
  19. vector<string> ans(m,"No");
  20. forn(L, m) {
  21. int n;
  22. cin >> n;
  23. set<int> a;
  24. forn(i, n) {
  25. a.insert(i + 1);
  26. }
  27. forn(i, n) {
  28. int tmp;
  29. cin >> tmp;
  30. a.erase(tmp);
  31. }
  32. if (a.empty()) ans[L] = "Yes";
  33. }
  34. forn(i, m) {
  35. cout << ans[i] << endl;
  36. }
  37. return 0;
  38. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement