/ SeriousOJ /

Record Detail

Accepted


  
# Status Time Cost Memory Cost
#1 Accepted 1ms 540.0 KiB
#2 Accepted 9ms 332.0 KiB
#3 Accepted 9ms 540.0 KiB
#4 Accepted 3ms 776.0 KiB
#5 Accepted 18ms 644.0 KiB
#6 Accepted 17ms 1.188 MiB
#7 Accepted 19ms 1.312 MiB

Code

#include<bits/stdc++.h>
using namespace std;
#define fast ios_base::sync_with_stdio(false);cin.tie(0);cout.tie(0);
#define ll long long int
#define YES cout<<"YES\n"
#define NO cout<<"NO\n"
#define endl "\n"
vector<int> takeVectorInput(int n){
    vector<int>v(n);
    for(auto &ele:v)cin>>ele;


//     vector<int>v(n+1);
//    for(int i=1;i<=n;++i) {
//     cin>>v[i];
//    }
    return v;
}
void solve(){
    int n,m;
    cin>>n>>m;
    auto a=takeVectorInput(n);
    auto b=takeVectorInput(m);
    set<int>st;
    for(auto &ele:b)st.insert(ele);
    if(st.size()!=10){
        NO;
        return;
    }
    int c1=count(a.begin(),a.end(),0);
    int c2=count(a.begin(),a.end(),1);
    int c3=count(a.begin(),a.end(),2);
    int c4=count(a.begin(),a.end(),3);
    if(c1&&c2&&c3&&c4)YES;
    else NO;

}
signed main(){
    fast
    int t;
    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:37:35
Judged At
2025-01-02 14:37:35
Judged By
Score
100
Total Time
19ms
Peak Memory
1.312 MiB