/ SeriousOJ /

Record Detail

Wrong Answer


  
# Status Time Cost Memory Cost
#1 Accepted 1ms 532.0 KiB
#2 Wrong Answer 10ms 580.0 KiB
#3 Wrong Answer 9ms 580.0 KiB

Code



// In the name of ALLAH

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

typedef unsigned long long int llu;
typedef long long int ll;
typedef vector<int> vi;
typedef vector<ll> vl;
typedef vector<vi> vvi;
typedef vector<vl> vvl;
typedef pair<int,int> pii;
typedef pair<ll, ll> pll;
typedef vector<pii> vpi;
typedef vector<pll> vpl;
typedef double dl;
typedef vector<vl> matrix;

///*******************************************************************************/

#define Code ios_base::sync_with_stdio(0);
#define By cin.tie(0);
#define Nayeem cout.tie(0);
#define endl '\n'
#define PB push_back
#define PPB pop_back
#define F first
#define S second
#define all(k) (k).begin(), (k).end()
#define MOD 1000000007
#define mems(arr,value) memset(arr, value, sizeof(arr))
#define fraction() cout.unsetf(ios::floatfield); cout.precision(10); cout.setf(ios::fixed, ios::floatfield);
#define file() freopen("input.txt","r",stdin);freopen("output.txt","w",stdout);

ll gcd ( ll a, ll b ) {return __gcd ( a, b );}
ll lcm ( ll a, ll b ) {return a * ( b / gcd(a, b));}

///*******************************************************************************/

template < typename F, typename S >
ostream& operator << ( ostream& os, const pair< F, S > & p ) {
    return os << "(" << p.first << ", " << p.second << ")";
}

template < typename T >
ostream &operator << ( ostream & os, const vector< T > &v ) {
    os << "{";
    for(auto it = v.begin(); it != v.end(); ++it) {
        if( it != v.begin() ) os << ", ";
        os << *it;
    }
    return os << "}";
}

template < typename T >
ostream &operator << ( ostream & os, const set< T > &v ) {
    os << "[";
    for(auto it = v.begin(); it != v.end(); ++it) {
        if( it != v.begin() ) os << ", ";
        os << *it;
    }
    return os << "]";
}

template < typename T >
ostream &operator << ( ostream & os, const multiset< T > &v ) {
    os << "[";
    for(auto it = v.begin(); it != v.end(); ++it) {
        if( it != v.begin() ) os << ", ";
        os << *it;
    }
    return os << "]";
}

template < typename F, typename S >
ostream &operator << ( ostream & os, const map< F, S > &v ) {
    os << "[";
    for(auto it = v.begin(); it != v.end(); ++it) {
        if( it != v.begin() ) os << ", ";
        os << it -> first << " = " << it -> second ;
    }
    return os << "]";
}

template < typename T >
ostream &operator << ( ostream & os, const stack< T > &v ) {
    stack<T> temp = v;
    os << "{";
    bool first = true;
    while(!temp.empty()) {
        if (!first) os << ", ";
        os << temp.top();
        temp.pop();
        first = false;
    }
    return os << "}";
}

#define dbg(args...) do {cerr << #args << " : "; faltu(args); } while(0)

void faltu () {
    cerr << endl;
}

template <typename T>
void faltu( T a[], int n ) {
    for(int i = 0; i < n; ++i) cerr << a[i] << ' ';
    cerr << endl;
}

template <typename T, typename ... hello>
void faltu( T arg, const hello &... rest) {
    cerr << arg << ' ';
    faltu(rest...);
}

///*******************************************************************************/

const double PI = 3.14159265358973; //acos(-1);
const int MAX = 1e6 + 123;
const double esp = 1e-9;
const int INF = INT_MAX;
const ll INFLL = LLONG_MAX;

///*******************************************************************************/


void find_solution() {
    
    int n, m; cin >> n >> m;
    vi v(n), k(m);
    map<int, int> fre;

    for( int i = 0; i < n; i++ ){
        cin >> v[i];
        fre[v[i]]++;
    }
    for( int i = 0; i < m; i++ ){
        cin >> k[i];
        fre[k[i]];
    }

    bool flag = false;

    for( int i = 0; i <= 9; i++ ){
        if( fre.find(i) != fre.end() ){
            continue;
        }else{
            flag = true;
            break;
        }
    }

    if( flag ) cout << "NO" << endl;
    else cout << "YES" << endl;
   
}

void solve_TestCase() {
    ll hide_case; cin >> hide_case;
    for( int i = 1; i <= hide_case; i++ ){
        find_solution();
    }
}

int main() {
    Code By Nayeem
    
    //find_solution();
    solve_TestCase();
    /****** Alhamdulillah ******/
    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:50:51
Judged At
2025-01-02 14:50:51
Judged By
Score
0
Total Time
10ms
Peak Memory
580.0 KiB