Advertisement
nightwing_808

gotta catch em all

Apr 10th, 2023
17
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.69 KB | Source Code | 0 0
  1. #include<bits/stdc++.h>
  2. using namespace std;
  3. const int N=10000010;
  4. int main()
  5. {
  6. int t;
  7. cin>>t;
  8. for (int i=1;i<=t;i++)
  9. {
  10. int n;
  11. cin>>n;
  12. long arr[n],arr2[n];
  13. for (int j=0;j<n;j++)
  14. cin>>arr[j];
  15. for (int j=0;j<n;j++)
  16. cin>>arr2[j];
  17. sort(arr,arr+n);
  18. sort(arr2,arr2+n);
  19. int x=n-1,y=n-1,bob=0;
  20. while (x>-1 && y>-1)
  21. {
  22. if (arr[x]>arr2[y])
  23. x--;
  24. else
  25. {
  26. bob++;
  27. y--;
  28. x--;
  29. }
  30. }
  31. cout<<"Case "<<i<<": "<<n-bob<<endl;
  32. }
  33. return 0;
  34. }
  35.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement