求助啊
查看原帖
求助啊
390770
D2T1xubiaoshi楼主2020/10/5 21:46
//P4613
#include <iostream>
#include <algorithm>
using namespace std;

int main(){
	long long n,w[105],b[105];
	cin >> n;
	for(int i=0; i<n; i++) cin >> w[i];
	for(int i=0; i<n; i++) cin >> b[i];
	sort(w,w+n);
	sort(b,b+n);
	for(int i=0; i<n; i++){	
		for(int j=0; j<n; j++){
			if(w[i]<=b[j]){
				b[j]=0;
			}
		}
	}
	for(int i=0; i<n; i++){
		if(b[i]!=0){
			cout << "NE";
			return 0;
		}
	}
	cout << "DA";
	return 0;
}

结果

2020/10/5 21:46
加载中...