Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- using namespace std;
- int n, a[10001], b[10001];
- void obmen(){
- for(int i = 0; i < n; i++){
- for(int j = 0; j < n - 1; j++){
- if(a[j] > a[j + 1] && b[j] > b[j + 1]){
- swap(a[j], a[j + 1]);
- swap(b[j], b[j + 1]);
- }
- }
- }
- }
- int main()
- {
- cin >> n;
- for(int i = 0; i < n; i++){
- cin >> a[i];
- }
- for(int i = 0; i < n; i++){
- cin >> b[i];
- }
- obmen();
- bool ok = true;
- for(int i = 0; i < n - 1; i++){
- if(a[i] >= a[i + 1]){
- ok = false;
- }
- }
- cout << (ok ? "Yes" : "No");
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement