/ SeriousOJ /

Record Detail

Accepted


  
# Status Time Cost Memory Cost
#1 Accepted 1ms 556.0 KiB
#2 Accepted 22ms 556.0 KiB
#3 Accepted 20ms 540.0 KiB
#4 Accepted 5ms 332.0 KiB
#5 Accepted 34ms 788.0 KiB
#6 Accepted 36ms 2.051 MiB
#7 Accepted 36ms 2.059 MiB

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