/ SeriousOJ /

Record Detail

Accepted


  
# Status Time Cost Memory Cost
#1 Accepted 1ms 532.0 KiB
#2 Accepted 10ms 348.0 KiB
#3 Accepted 10ms 532.0 KiB
#4 Accepted 3ms 532.0 KiB
#5 Accepted 34ms 324.0 KiB
#6 Accepted 17ms 536.0 KiB
#7 Accepted 17ms 532.0 KiB

Code

#include<bits/stdc++.h>
using namespace std;
#define endl '\n'
#define ll long long int
#define vv vector<long long>
#define dq deque<long long>
#define mpp map<long long,long long>
#define ms multiset<long long>
#define ss set<long long>
#define vpp vector<pair<long long, long long>>
#define MOD 1000000007
#define YES cout<<"YES"<<endl
#define NO cout<<"NO"<<endl
#define all(a) a.begin(),a.end()
#define sort_rev(a) sort(a.rbegin(),a.rend())
#define all_n for(int i=0;i<n;i++)
#define print(a) for(auto it:a)cout<<it<<" "
#define print_pair(a) for(auto it:a)cout<<it.first<<" "<<it.second<<endl
#define scan(a,n) for(int i=0;i<n;i++)cin>>a[i]
void requisite(){
    ios::sync_with_stdio(false);
    cin.tie(nullptr);cout.tie(nullptr);
}
void solve(){
    ll n,m;cin>>n>>m;
    ss v,a;
    for (int i = 0; i < n; ++i) {
        int x;cin>>x;
        v.insert(x);
    }
    for (int i = 0; i < m; ++i) {
        int x;cin>>x;
        a.insert(x);
    }
    if (a.size()!=10){
        NO;
        return;
    }
    for (int i = 0; i <=3 ; ++i) {
         if (v.find(i)==v.end()){
            NO;
            return;
        }
    }
    YES;
}
int main() {
    requisite();
    ll t=1;
    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:48:18
Judged At
2025-01-02 14:48:18
Judged By
Score
100
Total Time
34ms
Peak Memory
536.0 KiB