/ SeriousOJ /

Record Detail

Accepted


  
# Status Time Cost Memory Cost
#1 Accepted 1ms 532.0 KiB
#2 Accepted 7ms 536.0 KiB
#3 Accepted 7ms 560.0 KiB
#4 Accepted 2ms 324.0 KiB
#5 Accepted 13ms 532.0 KiB
#6 Accepted 13ms 532.0 KiB
#7 Accepted 13ms 532.0 KiB

Code

#include <bits/stdc++.h>

using i64 = long long;

void solve() {
    int n, m;
    std::cin >> n >> m;
    int a = 0, b = 0;
    for (int i = 0; i < n; i++) {
        int x;
        std::cin >> x;
        a |= 1 << x;
    }
    for (int i = 0; i < m; i++) {
        int x;
        std::cin >> x;
        b |= 1 << x;
    }
    if (((a & 0b1111) == 0b1111) && (b + 1 == (1 << 10))) {
        std::cout << "YES\n";
    } else {
        std::cout << "NO\n";
    }
}

int main() {
    std::ios::sync_with_stdio(false);
    std::cin.tie(nullptr);
    std::cout.tie(nullptr);

    int t;
    std::cin >> t;
    while (t--) {
        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:36:50
Judged At
2025-01-02 14:36:50
Judged By
Score
100
Total Time
13ms
Peak Memory
560.0 KiB