Accepted
Code
#include<bits/stdc++.h>
using namespace std;
#define ll long long int
int main()
{
ll tc;
cin>>tc;
while(tc--)
{
ll n,m;
cin>>n>>m;
vector<ll>v(n),p(m);
map<ll,ll>mp,sp;
for(int i=0;i<n;i++)
{
cin>>v[i];
mp[v[i]]++;
}
for(int i=0;i<m;i++)
{
cin>>p[i];
sp[p[i]]++;
}
if(mp[0]>0 && mp[1]>0 && mp[2]>0 && mp[3]>0)
{
ll c=0;
for(int i=0;i<=9;i++)
{
if(sp[i]==0)
{
c=1;
break;
}
}
if(c)
cout<<"NO\n";
else
cout<<"YES\n";
}
else
cout<<"NO\n";
}
}
Information
- Submit By
- Type
- Submission
- Problem
- P1153 Is Date Possible?
- Contest
- Happy New Year 2025
- Language
- C++17 (G++ 13.2.0)
- Submit At
- 2025-01-02 14:37:14
- Judged At
- 2025-01-02 14:37:14
- Judged By
- Score
- 100
- Total Time
- 36ms
- Peak Memory
- 2.059 MiB