/ SeriousOJ /

Record Detail

Accepted


  
# Status Time Cost Memory Cost
#1 Accepted 1ms 540.0 KiB
#2 Accepted 7ms 540.0 KiB
#3 Accepted 7ms 540.0 KiB
#4 Accepted 3ms 772.0 KiB
#5 Accepted 13ms 580.0 KiB
#6 Accepted 14ms 560.0 KiB
#7 Accepted 15ms 556.0 KiB

Code

/**
 *    author:   Binoy Barman
 *    created:  2025-01-02 20:35:35
**/

#include<bits/stdc++.h>
#ifdef LOCAL
#include "debug/trace.hpp"
#else
#define dbg(...) 42
#define print(...) 42
#endif
using namespace std;
using ll = long long;
const int mod = 1e9 + 7;
const int inf = 1e9;

#define int long long
#define nl '\n'
#define all(v) v.begin(), v.end()
#define Testcase_Handler int tts, tc = 1; cin >> tts; hell: while(tts--)
#define uniq(v) sort(all(v)), v.resize(distance(v.begin(), unique(v.begin(), v.end())))
template<class T> using minheap = priority_queue<T, vector<T>, greater<T>>;
template<typename T> istream& operator>>(istream& in, vector<T>& a) {for(auto &x : a) in >> x; return in;};
template<typename T> ostream& operator<<(ostream& out, vector<T>& a) {bool first = true;for(auto &x : a) {if(!first) out << ' ';first = false;out << x;}return out;};

namespace Dark_Lord_Binoy {
void preprocess() {}
void setup() {
    ios_base::sync_with_stdio(false); 
    cin.tie(nullptr);
    preprocess();

    #ifdef LOCAL
    freopen("input.txt", "r", stdin);
    freopen("output.txt", "w", stdout);
    #endif
}
}

int32_t main() {
    Dark_Lord_Binoy::setup();
    Testcase_Handler {
        int n, m;
        cin >> n >> m;
        vector<int> a(10), b(10);
        for (int i = 0; i < n; i++) {
            int x; cin >> x;
            a[x] = 1;
        }
        for (int i = 0; i < m; i++) {
            int x; cin >> x;
            b[x] = 1;
        }
        bool ok = true;
        for (int i = 0; i < 4; i++) ok &= (a[i] == 1);
        for (int i = 0; i < 10; i++) ok &= (b[i] == 1);
        cout << (ok ? "YES" : "NO") << nl;
    }

    print(_Time_);
    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:38:41
Judged At
2025-01-02 14:38:41
Judged By
Score
100
Total Time
15ms
Peak Memory
772.0 KiB