Accepted
Code
//sadias
#include<bits/stdc++.h>
using namespace std;
int main() {
int t; cin >> t;
while(t--){
int n, m; cin >> n >> m;
set<int> st1, st2;
int num;
for(int i = 0; i < n; i++) {
cin >> num;
st1.insert(num);
}
for(int i = 0; i < m; i++) {
cin >> num;
st2.insert(num);
}
//first digit set must have values 0-3 and second digit set must have values (0-9)
bool check = false;
for(int i = 0; i <= 3; i++) {
if(st1.find(i) == st1.end() || st2.size() < 10) {
cout << "NO\n";
check = true;
break;
}
}
if(!check){
cout << "YES\n";
}
}
return 0;
}
Information
- Submit By
- Type
- Submission
- Problem
- P1153 Is Date Possible?
- Language
- C++17 (G++ 13.2.0)
- Submit At
- 2025-01-11 08:46:49
- Judged At
- 2025-01-11 08:46:49
- Judged By
- Score
- 100
- Total Time
- 62ms
- Peak Memory
- 544.0 KiB