/ SeriousOJ /

Record Detail

Wrong Answer


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

Code

#include "bits/stdc++.h"
// #ifndef ONLINE_JUDGE
// #include "debug.h"
// #else
// #define dbg(x...)
// #endif
using namespace std;
using ll = long long;
#define int ll
#define endl '\n'
const int mod = 1000000007;
// clang-format off
template<typename typC,typename typD> istream &operator>>(istream &cin,pair<typC,typD> &a) { return cin>>a.first>>a.second; }
template<typename typC> istream &operator>>(istream &cin,vector<typC> &a) { for (auto &x:a) cin>>x; return cin; }
template<typename typC,typename typD> ostream &operator<<(ostream &cout,const pair<typC,typD> &a) { return cout<<a.first<<' '<<a.second; }
template<typename typC,typename typD> ostream &operator<<(ostream &cout,const vector<pair<typC,typD>> &a) { for (auto &x:a) cout<<x<<'\n'; return cout; }
template<typename typC> ostream &operator<<(ostream &cout,const vector<typC> &a) { int n=a.size(); if (!n) return cout; cout<<a[0]; for (int i=1; i<n; i++) cout<<' '<<a[i]; return cout; }
// #define _GLIBCXX_DEBUG
// clang-format on

void solve()
{
    ll t, m, n, a, b;
    string h;
    cin >> n >> m;
    map<int, int> mp1, mp2;
    for (int i = 0; i < n; i++)
    {
        cin >> a;
        mp1[a]++;
    }
    for (int i = 0; i < m; i++)
    {
        cin >> a;
        mp2[a]++;
    }
    for (int i = 0; i <= 9; i++)
    {
        if (!mp1[i] || !mp2[i])
        {
            cout << "NO" << endl;
            return;
        }
    }
    cout << "YES" << endl;
    return;
}
int32_t main()
{
    ios::sync_with_stdio(false);
    cin.tie(0);
    // #ifndef ONLINE_JUDGE
    //     freopen("input.txt", "r", stdin);
    //     freopen("output.txt", "w", stdout);
    // #endif
    int t;
    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 14:38:42
Judged At
2025-01-02 14:38:42
Judged By
Score
80
Total Time
17ms
Peak Memory
532.0 KiB