Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <algorithm>
- #include <vector>
- #include <utility>
- #include <string>
- #include <set>
- #define forn(i,n) for (int i = 0; i < int(n); i++)
- #define pb push_back
- using namespace std;
- int main()
- {
- int m;
- cin >> m;
- vector<string> ans(m,"No");
- forn(L, m) {
- int n;
- cin >> n;
- set<int> a;
- forn(i, n) {
- a.insert(i + 1);
- }
- forn(i, n) {
- int tmp;
- cin >> tmp;
- a.erase(tmp);
- }
- if (a.empty()) ans[L] = "Yes";
- }
- forn(i, m) {
- cout << ans[i] << endl;
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement