Wrong Answer
Code
#include <bits/stdc++.h>
using namespace std;
#define int long long
void iusearchbtw () {
int n; cin >> n;
vector<int> c;
for (int i = 1, x; i <= n; i++) cin >> x, c.push_back(x);
for (int i = 1, x; i <= n; i++) cin >> x, c.push_back(x);
if (n <= 2) {
cout << "Yes\n";
return;
}
sort(c.rbegin(), c.rend());
cout <<(c[n - 3] > c[n - 2] ? "Yes\n" : "No\n");
}
signed main () {
ios_base::sync_with_stdio(0);
cin.tie(0);
cout.tie(0);
int tt = 1;
cin >> tt;
while (tt --> 0) iusearchbtw();
}
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:59:27
- Judged At
- 2025-06-13 15:59:27
- Judged By
- Score
- 0
- Total Time
- 22ms
- Peak Memory
- 788.0 KiB