冷门自制好东西
2023-12-31 11:11:29
发布于:广东
14阅读
0回复
0点赞
非常简单,韩继毅看过来
#include<bits/stdc++.h>
using namespace std;
int main()
{
int t;
cin >> t;
while(t--)
{
int n,k;
cin >> n >>k;
int a[n];
bool isDrop = 0;
for(int i=0; i<n; i++)
{
cin >> a[i];
if(i>0 && a[i]<a[i-1]) isDrop=1;
}
if(k>=2)
{
cout << "YES"<<endl;
}else if (isDrop){
cout << "NO"<<endl;
}else{
cout << "YES"<<endl;
}
}
return 0;
}
这里空空如也
有帮助,赞一个