题解:CF2102B The Picky Cat
wangboyue_740325 · · 题解
思路
明显,此题的答案只与
代码
#include<bits/stdc++.h>
#define int long long
#define endl '\n'
using namespace std;
const int N=1e5+5;
int a[N];
bool help(){
int n;
cin>>n;
int cnt=0;
for(int i=1;i<=n;i++){
cin>>a[i];
if(abs(a[i])>abs(a[1])){
cnt++;
}
}
if(cnt>=(n-1)/2){
return true;
}
return false;
}
signed main(){
int t;
cin>>t;
while(t--){
cout<<(help()?"YES":"NO")<<endl;
}
return 0;
}