/ SeriousOJ /

Record Detail

Wrong Answer


  
# Status Time Cost Memory Cost
#1 Accepted 1ms 568.0 KiB
#2 Wrong Answer 19ms 540.0 KiB
#3 Wrong Answer 18ms 540.0 KiB

Code

#include<bits/stdc++.h>
using namespace std;
int main()
{
    int t;
    cin>>t;
    while(t--)
    {
        int n,m;
        cin>>n>>m;
        int a[n+2],b[m+2],c[20]={0};
        for(int i=0;i<n;i++)
        {
            cin>>a[i];
            c[a[i]]++;
        }
        for(int i=0;i<m;i++)
        {
            cin>>b[i];
            c[b[i]]++;
        }
        int flag=0;
        for(int i=0;i<=3;i++)
        {
            if(c[i]<2)
            {
                flag=1;
                break;
            }
        }
        if(flag==1) cout<<"NO"<<endl;
        else
        {
            for(int i=4;i<=9;i++)
            {
                if(c[i]<1)
                {
                    flag=1;
                    break;
                }
            }
            if(flag==1)
            {
                cout<<"NO"<<endl;
            }
            else
            {
                cout<<"YES"<<endl;
            }
        }
    }
    return 0;
}

Information

Submit By
Type
Submission
Problem
P1153 Is Date Possible?
Language
C++17 (G++ 13.2.0)
Submit At
2025-01-03 19:13:47
Judged At
2025-01-03 19:13:47
Judged By
Score
0
Total Time
19ms
Peak Memory
568.0 KiB