/ SeriousOJ /

Record Detail

Accepted


  
# Status Time Cost Memory Cost
#1 Accepted 1ms 532.0 KiB
#2 Accepted 11ms 324.0 KiB
#3 Accepted 9ms 532.0 KiB
#4 Accepted 3ms 324.0 KiB
#5 Accepted 17ms 532.0 KiB
#6 Accepted 17ms 532.0 KiB
#7 Accepted 17ms 532.0 KiB

Code

// Created on: 2025-01-02 20:40
// Author: Safwan_Ibrahim

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

#define ll long long
#define endl '\n'

void solve() {
    int n, m; cin >> n >> m;
    set<int>a, b;
    for (int i = 1; i <= n; i++) {
        int x; cin >> x;
        a.insert(x);
    }
    for (int i = 1; i <= m; i++) {
        int x; cin >> x;
        b.insert(x);
    }


    for (int i = 0; i <= 3; i++) {
        if (a.find(i) == a.end()) {
            cout << "NO\n"; return;
        }
    }

    for (int i = 0; i <= 9; i++) {
        if (b.find(i) == b.end()) {
            cout << "NO\n"; return;
        }
    }

    cout << "YES\n";

    
}

int32_t main() {
    ios_base::sync_with_stdio(0);
    cin.tie(0);
    int t = 1; cin >> t;
    while(t--) solve();
    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 15:23:50
Judged At
2025-01-02 15:23:50
Judged By
Score
100
Total Time
17ms
Peak Memory
532.0 KiB