/ SeriousOJ /

Record Detail

Wrong Answer


  
# Status Time Cost Memory Cost
#1 Accepted 1ms 788.0 KiB
#2 Wrong Answer 11ms 540.0 KiB
#3 Accepted 11ms 540.0 KiB
#4 Accepted 4ms 540.0 KiB
#5 Accepted 18ms 796.0 KiB
#6 Accepted 18ms 2.078 MiB
#7 Accepted 19ms 2.078 MiB

Code

#include <bits/stdc++.h>
#define ll long long int
using namespace std;
 
int main() {
    // your code goes here
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    ll t;
    cin>>t;
    
    while(t--){
        ll n,m;
        cin>>n>>m;

        vector<ll> a(n), b(m);
        map<ll,ll> m1, m2;
        for(int i=0; i<n; i++){
            cin>>a[i];
            m1[a[i]]++;
        }
        for(int i=0; i<m; i++){
            cin>>b[i];
            m2[b[i]]++;
        }

        ll c=0;
        for(int i=0; i<=3; i++){
            if(m1.find(i)==m1.end()){
                c++;
                break;
            }
        }
        for(int i=1; i<=9; i++){
            if(m2.find(i)==m2.end()){
                c++;
                break;
            }
        }
        if(c){
            cout<<"NO"<<endl;
        }
        else{
            cout<<"YES"<<endl;
        }
    }    
}

Information

Submit By
Type
Submission
Problem
P1153 Is Date Possible?
Language
C++17 (G++ 13.2.0)
Submit At
2025-01-02 17:53:47
Judged At
2025-01-02 17:53:47
Judged By
Score
80
Total Time
19ms
Peak Memory
2.078 MiB