/ SeriousOJ /

Record Detail

Accepted


  
# Status Time Cost Memory Cost
#1 Accepted 1ms 540.0 KiB
#2 Accepted 10ms 540.0 KiB
#3 Accepted 9ms 540.0 KiB
#4 Accepted 3ms 800.0 KiB
#5 Accepted 16ms 544.0 KiB
#6 Accepted 18ms 540.0 KiB
#7 Accepted 18ms 536.0 KiB

Code

// I AM A MUSLIM

#include "bits/stdc++.h"

#pragma GCC optimize("O3,unroll-loops")
#pragma GCC target("avx2,bmi,bmi2,lzcnt,popcnt")

#define fast_io std::ios::sync_with_stdio(0);std::cin.tie(0)
#define lli long long int
#define flush fflush(stdout)
#define new_line printf("\n")
#define yn(a, b) printf("%s\n", (a) >= (b) ? "YES":"NO")
#define amodm(a, M) (((a)%M+M)%M)
// #define int lli

using pii = std::pair<int,int>;

const int MOD = 1000000007;
const int mxN = 200100;

signed main() {
    int testCases=1;
    scanf("%d",&testCases);
    
    for (int TC = 1; TC <= testCases; TC++) {
        int n, m;
        scanf("%d%d",&n,&m);
        int fi[5] = {0};  // 0 1 2 3
        int se[10] = {0};  // 0 1 2 3 4 5 6 7 8 9
        
        for (int i = 0; i < n; i++) {
            int v;
            scanf("%d",&v);
            if (v <= 3) fi[v] = 1;
        }
        
        for (int i = 0; i < m; i++) {
            int v;
            scanf("%d",&v);
            se[v] = 1;
        }
        
        bool ok = 1;
        for (int i = 0; i <= 3; i++) {
            ok &= fi[i];
        }
        for (int i = 0; i <= 9; i++) {
            ok &= se[i];
        }
        
        yn(ok, 1);
        
    }
    
    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:24
Judged At
2025-01-02 14:38:24
Judged By
Score
100
Total Time
18ms
Peak Memory
800.0 KiB