/ SeriousOJ /

Record Detail

Accepted


  
# Status Time Cost Memory Cost
#1 Accepted 1ms 532.0 KiB
#2 Accepted 21ms 532.0 KiB
#3 Accepted 18ms 532.0 KiB
#4 Accepted 4ms 532.0 KiB
#5 Accepted 37ms 544.0 KiB
#6 Accepted 33ms 532.0 KiB
#7 Accepted 33ms 532.0 KiB

Code

#include <bits/stdc++.h>
#define pb push_back
#define all(x) x.begin(),x.end(); 
#define F first
#define S second
#define ll long long
#define int long long

using namespace std;

const int maxn = 1e5 + 5;

int n,m;

signed main(){

	int tt = 1;
	
	cin >> tt;
	
	for(int ii = 1; ii <= tt; ii++){
		cin >> n >> m;
		
		map <int,bool> mp,mp2;
		
		for(int i = 1; i <= n; i++){
			int x;
			cin >> x;
			mp[x] = 1;
		}
		
		for(int i = 1; i <= m; i++){
			int x;
			cin >> x;
			mp2[x] = 1;
		}

		bool ok = 1;

		for(int i = 0; i <= 3; i++){
			if(!mp[i]){
				ok = 0;
			}
		}
		
		for(int i = 0; i <= 9; i++){
			if(!mp2[i]){
				ok = 0;
			}
		}
		
		if(ok){
			cout << "YES\n";
		}
		else {
			cout << "NO\n";
		}
		
	}
	
	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:39:30
Judged At
2025-01-02 14:39:30
Judged By
Score
100
Total Time
37ms
Peak Memory
544.0 KiB