I am solving Prom Night. My code passes 3/5 test cases. I want to know the test case it is failing. My code:
#include <iostream>
#include <bits/stdc++.h>
using namespace std;
int main()
{
int t;
cin>>t;
while(t--)
{
int n,m;
bool flag = true;
cin>>m>>n;
int a[m];
int b[n];
for(int i=0;i<m;i++)
cin>>a[i];
for(int i=0;i<n;i++)
cin>>b[i];
if(n<m)
{
cout<<"NO"<<endl;
}
else
{
sort(a,a+m);
sort(b,b+n);
for(int i=0;i<m;i++)
{
//cout<<"a[i]: "<<a[i]<<" b[i]"<<b[i]<<endl;
if(a[i] < b[i])
{
flag = false;
break;
}
}
if(flag)
cout<<"YES"<<endl;
else
cout<<"NO"<<endl;
}
}
return 0;
}