/ SeriousOJ /

Record Detail

Wrong Answer


  
# Status Time Cost Memory Cost
#1 Accepted 1ms 532.0 KiB
#2 Wrong Answer 12ms 532.0 KiB
#3 Wrong Answer 11ms 532.0 KiB

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;
		for(auto &it:v){
			cin>>it;
			st.insert(it);
		}
		for(auto &it:vv){
			cin>>it;
			st2.insert(it);
		}
		sort(vv.begin(),vv.end());
		if(st.size() >= 4){
			if(st2.size() == 9){
				if(vv[0] != 0){
					cout<<"NO\n";
				}
				else{
					cout<<"YES\n";
				}
			}
			else 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?
Contest
Happy New Year 2025
Language
C++17 (G++ 13.2.0)
Submit At
2025-01-02 14:53:18
Judged At
2025-01-02 14:53:18
Judged By
Score
0
Total Time
12ms
Peak Memory
532.0 KiB