#include <bits/stdc++.h>
#define ff first
#define int long long int
#define ss second
#define pb push_back
#define mp make_pair
#define mt make_tuple
#define pii pair<int,int>
#define vi vector<int>
#define mii map<int,int>
#define pqb priority_queue<int>
#define max_size 100000000
#define pqs priority_queue<int,vi,greater<int> >
#define setbits(x) __builtin_popcountll(x)
#define mod 13371337
#define w(t) int t; cin >> t; while(t--)
#define inf 1e18
//#define ps(x,y) fixed<<setprecision(y)<<x
#define mk(arr,n,type) type *arr=new type[n];
#define range(a,b) substr(a,b-a+1)
#define mina(a,b,c) min(a, min(b, c))
#define maxa(a,b,c) max(a, max(b, c))
#define sz(a) (int)a.size()
#define endl '\n'
#define trace(x) cerr<<#x<<": "<<x<<" "<<endl;
#define FIO ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0)
#define FOR(x,y) for(int i = x; i < y; i++)
using namespace std;
bool sortbyfirst(const pair<int,int> &a, const pair<int,int> &b){ return (a.first > b.first); }
int64_t ceil_div(int64_t a, int64_t b) {if(a%b != 0){ return ((a/b)+1);} else{ return (a/b);}}
double max(double a, double b){ if(a >= b){ return a; } else{ return b; } }
double min(double a, double b){if(a <= b){return a;} else{return b; }}
bool modd(double a, double b){if(floor(a/b) == ceil(a/b)){return true;} return false;}
bool stringsort(const string &a, const string &b){return a.length() > b.length();}
bool specsort(const pair<long double,int> &a, const pair<long double,int> &b){
if(a.first == b.first){
return a.second < b.second;
}
else return a.first > b.first;
}
void solve() {
int n;
cin >> n;
vi a(n);
vi b(n);
FOR(0,n) cin >> a[i];
FOR(0, n) cin >> b[i];
sort(a.begin(), a.end());
sort(b.begin(), b.end());
bool f = true;
for(int i = 0; i < n; i++){
if(a[i] > b[i]){
f = false;
break;
}
}
if(f) cout << "DA" << endl;
else cout << "NE" << endl;
}
int32_t main(){
FIO;
solve();
return 0;
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
1 ms |
204 KB |
Output is correct |
2 |
Correct |
1 ms |
204 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
1 ms |
204 KB |
Output is correct |
2 |
Correct |
1 ms |
204 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
0 ms |
204 KB |
Output is correct |
2 |
Correct |
1 ms |
204 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
1 ms |
308 KB |
Output is correct |
2 |
Correct |
1 ms |
204 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
1 ms |
204 KB |
Output is correct |
2 |
Correct |
1 ms |
204 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
1 ms |
204 KB |
Output is correct |
2 |
Correct |
1 ms |
204 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
0 ms |
204 KB |
Output is correct |
2 |
Correct |
1 ms |
204 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
1 ms |
204 KB |
Output is correct |
2 |
Correct |
1 ms |
204 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
1 ms |
204 KB |
Output is correct |
2 |
Correct |
1 ms |
204 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
1 ms |
204 KB |
Output is correct |
2 |
Correct |
1 ms |
204 KB |
Output is correct |