/ SeriousOJ /

Record Detail

Accepted


  
# Status Time Cost Memory Cost
#1 Accepted 2ms 328.0 KiB
#2 Accepted 18ms 556.0 KiB
#3 Accepted 15ms 560.0 KiB
#4 Accepted 5ms 340.0 KiB
#5 Accepted 28ms 328.0 KiB
#6 Accepted 28ms 568.0 KiB
#7 Accepted 28ms 564.0 KiB

Code

#include<bits/stdc++.h>
using namespace std;

#define ll long long
#define nl "\n"
#define ws " "
#define FASTIO ios_base::sync_with_stdio(false); cin.tie(NULL);
#define MOD 1000000007

typedef vector<ll> vi;
typedef vector<pair<ll, ll>> vii;

int main () {
    FASTIO
    int t;
    cin>>t;
    while (t--) {
        int n, m;
        cin>>n>>m;
        set <int> st1, st2;
        for (int i = 0; i < n; i++) {
            int x;
            cin>>x;
            st1.insert(x);
        }
        for (int i = 0; i < m; i++) {
            int x;
            cin>>x;
            st2.insert(x);
        }
        bool p = true;
        for (int i = 0; i <= 3; i++) {
            if (st1.find(i) == st1.end()) {
                p = false;
                break;
            }
        }
        for (int i = 0; i <= 9; i++) {
            if (st2.find(i) == st2.end()) {
                p = false;
                break;
            }
        }
        if (p) {
            cout<<"YES\n";
        } else {
            cout<<"NO\n";
        }
    }
    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 14:48:54
Judged At
2025-01-02 14:48:54
Judged By
Score
100
Total Time
28ms
Peak Memory
568.0 KiB