Wrong Answer
Code
#include <bits/stdc++.h>
#include <cmath>
using namespace std;
int main()
{
int t;
cin>>t;
while(t--)
{
int a,b;
cin>>a>>b;
int count=0;
int cnt=0;
std::vector<int>A(10,0) ;
vector<int>B(10,0);
for(int i=0;i<a;i++)
{
int c;
cin>>c;
if(A[c]==0)
{
A[c]=1;
count++;
}
}
for(int i=0;i<b;i++)
{
int c;
cin>>c;
if(B[c]==0)
{
B[c]=1;
cnt++;
}
}
if((count+cnt==20) || ((count+cnt==19) && A[0]+B[0]==1))
{
cout<<"YES"<<endl;
}
else
{
cout<<"NO"<<endl;
}
}
return 0;
}
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:52:41
- Judged At
- 2025-01-02 15:52:41
- Judged By
- Score
- 80
- Total Time
- 32ms
- Peak Memory
- 772.0 KiB