Wrong Answer
Code
#include <bits/stdc++.h>
using namespace std;
void solve(int cs) {
int n;
cin >> n;
vector<int> a(n), b(n);
for (auto &i : a) cin >> i;
for (auto &i : b) cin >> i;
if (n < 3) {
cout << "Yes\n";
return;
}
sort(a.begin(), a.end());
sort(b.begin(), b.end());
if (a.back() > b.back() || b.back() > a.back()) cout << "Yes\n";
else cout << "No\n";
}
int32_t main() {
cin.tie(0) -> sync_with_stdio(0);
int t = 1;
cin >> t;
for (int i = 1; i <= t; i++) {
solve(i);
}
return 0;
}
Information
- Submit By
- Type
- Submission
- Problem
- P1193 C. Roy and Peak Array
- Contest
- Brain Booster #10
- Language
- C++17 (G++ 13.2.0)
- Submit At
- 2025-06-13 15:41:49
- Judged At
- 2025-06-13 15:41:49
- Judged By
- Score
- 0
- Total Time
- 22ms
- Peak Memory
- 532.0 KiB