/ SeriousOJ /

Record Detail

Wrong Answer


  
# Status Time Cost Memory Cost
#1 Accepted 1ms 768.0 KiB
#2 Wrong Answer 22ms 336.0 KiB
#3 Wrong Answer 19ms 540.0 KiB

Code

#include<bits/stdc++.h>
using namespace std;
#define int             long long
#define pb              push_back
#define endl            '\n'
#define pp              pair<int,pair<int,int>>
#define asort(a,n)      sort(a,a+n) 
#define arsort(a,n)     sort(a,a+n,greater<int>()) 
#define arrout(a,n)     for(int i=1;i<=n;i++)cout<<a[i]<<" ";
#define vcout(v)        for(auto i:v)cout<<i<<endl;
#define vsort(v)        sort(v.begin(),v.end())
#define vrsort(v)       sort(v.rbegin(),v.rend());
#define pqr             priority_queue<int,vector<int>,greater<int>>
#define debug           cout<<"HERE"<<endl;
#define ff              first
#define ss              second
void edm()
{
    ios::sync_with_stdio(false);cin.tie(nullptr);cout.tie(nullptr);
    #ifndef ONLINE_JUDGE
    freopen("input.txt","r",stdin);
    freopen("output.txt","w",stdout);
    #endif
}
void solve()
{
    int n,m;cin>>n>>m;
    map<int,int>mp1,mp2;
    for(int i=0;i<n;i++)
    {
        int x;cin>>x;
        mp1[x]=1;
    }
    for(int i=0;i<m;i++)
    {
        int x;cin>>x;
        mp2[x]=1;
    }
    if(mp1[0] && mp1[1])
    {
        int flag=1;
        for(int i=0;i<=9;i++)
        {
            if(mp2[i]==0)flag=0;
        }
        if(flag)cout<<"YES"<<endl;
        else cout<<"NO"<<endl;
        return;
    }
    cout<<"NO"<<endl;

}
int32_t main()
{
    //edm();
    int t = 1;
    cin >> t;
    for(int i=1;i<=t;i++)
    {
        solve();
    }
} 

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:40:11
Judged At
2025-01-02 14:40:11
Judged By
Score
0
Total Time
22ms
Peak Memory
768.0 KiB