<span style="font-family: Arial, Helvetica, sans-serif;">#include<iostream></span>
using namespace std;
int size_balls[55]={0};
int hash_size[1005]={0};
int main()
{
int n;
cin>>n;
int bsize;
for(int i=1;i<=n;++i){
cin>>bsize;
size_balls[i]=bsize;
hash_size[bsize]=1;
}
int cur=0;
for(int i=1;i<=n;++i){
cur=size_balls[i];
if((hash_size[cur+1]==1) && (hash_size[cur+2]==1))
{
cout<<"YES"<<endl;
return 0;
}
}
cout<<"NO"<<endl;
return 0;
}
转载请注明原文地址: https://ju.6miu.com/read-1298699.html