Wrong Answer
Code
#include <bits/stdc++.h>
using namespace std;
int main()
{
int t;
cin>>t;
while(t--)
{
int n,m;
cin>>n>>m;
vector<int>lst1(n);
vector<int>lst2(m);
for(int i = 0; i<n; i++)
{
cin>>lst1[i];
}
for(int i = 0; i<m; i++)
{
cin>>lst2[i];
}
bool lst[10] = {0}, lst_two[10] = {0};
for (int x : lst1)
{
lst[x] = true;
}
for (int y : lst2)
{
lst_two[y] = true;
}
bool a = true, b = true;
for (int i = 0; i < 10; i++)
{
if (!lst[i])
{
a = false;
}
if (!lst_two[i])
{
b = false;
}
}
if (a || b)
{
cout << "YES"<<endl;
}
else
{
cout << "NO"<<endl;;
}
}
}
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 15:38:02
- Judged At
- 2025-01-02 15:38:02
- Judged By
- Score
- 0
- Total Time
- 18ms
- Peak Memory
- 532.0 KiB