Advertisement
Guest User

Untitled

a guest
Dec 29th, 2019
307
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.92 KB | None | 0 0
  1. #include <iostream>
  2. #include <vector>
  3. #include <map>
  4. #include <set>
  5. #include <queue>
  6. #include <algorithm>
  7. #include <string>
  8. #include <cmath>
  9. #include <cstdio>
  10. #include <iomanip>
  11. #include <fstream>
  12. #include <cassert>
  13. #include <cstring>
  14. #include <unordered_set>
  15. #include <unordered_map>
  16. #include <numeric>
  17. #include <ctime>
  18. #include <bitset>
  19. #include <complex>
  20. #include <random>
  21.  
  22. using namespace std;
  23.  
  24. void solve() {
  25.     int n, k1, k2;
  26.     cin >> n >> k1 >> k2;
  27.     int m1 = 0;
  28.     int m2 = 0;
  29.     while (k1--) {
  30.         int x;
  31.         cin >> x;
  32.         m1 = max(m1, x);
  33.     }
  34.     while (k2--) {
  35.         int x;
  36.         cin >> x;
  37.         m2 = max(m2, x);
  38.     }
  39.     if (m1 > m2) {
  40.         cout << "YES\n";
  41.     } else {
  42.         cout << "NO\n";
  43.     }
  44. }
  45.  
  46. signed main() {
  47.     ios_base::sync_with_stdio(false);
  48.     cin.tie(0);
  49.    
  50.     int q;
  51.     cin >> q;
  52.     while (q--) {
  53.         solve();
  54.     }
  55. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement