/ SeriousOJ /

Record Detail

Accepted


  
# Status Time Cost Memory Cost
#1 Accepted 1ms 768.0 KiB
#2 Accepted 11ms 484.0 KiB
#3 Accepted 10ms 772.0 KiB
#4 Accepted 3ms 540.0 KiB
#5 Accepted 17ms 812.0 KiB
#6 Accepted 19ms 1.324 MiB
#7 Accepted 19ms 1.32 MiB

Code

#include <iostream>
#include <vector>
#include <set>
#include <algorithm>
using namespace std;

int main(){
	ios :: sync_with_stdio(false);
	cin.tie(0);
	
	int tc;
	cin>>tc;
	while(tc--){
		int n,m;
		cin>>n>>m;
		vector<int>v(n),vv(m);
		set<int>st,st2;
		int a = 0,b = 0,c = 0,d = 0;
		for(auto &it:v){
			cin>>it;
			st.insert(it);
			if(it == 0) a = 1;
			else if(it == 1) b = 1;
			else if(it == 2) c = 1;
			else if(it == 3) d = 1;
		}
		for(auto &it:vv){
			cin>>it;
			st2.insert(it);
		}
		//cout<<a<<" "<<b<<" "<<c<<" "<<d<<endl;
		if(a+b+c+d == 4){
			if(st2.size() == 10){
				cout<<"YES\n";
			}
			else{
				cout<<"NO\n";
			}
		}
		else{
			cout<<"NO\n";
		}
	}
	return 0;
}

Information

Submit By
Type
Submission
Problem
P1153 Is Date Possible?
Language
C++17 (G++ 13.2.0)
Submit At
2025-01-03 11:01:10
Judged At
2025-01-03 11:01:10
Judged By
Score
100
Total Time
19ms
Peak Memory
1.324 MiB