31 lines
409 B
C++
31 lines
409 B
C++
#include <algorithm>
|
|
#include <iostream>
|
|
#include <vector>
|
|
|
|
using namespace std;
|
|
|
|
void solve() {
|
|
int n, j, k;
|
|
cin >> n >> j >> k;
|
|
vector<int> a(n);
|
|
for (auto &i : a)
|
|
cin >> i;
|
|
|
|
if (a[j - 1] == *max_element(a.begin(), a.end())) {
|
|
cout << "YES\n";
|
|
return;
|
|
}
|
|
|
|
if (k >= 2)
|
|
cout << "YES\n";
|
|
else
|
|
cout << "NO\n";
|
|
}
|
|
|
|
int main() {
|
|
int t;
|
|
cin >> t;
|
|
while (t--)
|
|
solve();
|
|
}
|