题面在这里!

 

    把每个数替换成它在2上的指数,然后发现0只能和>=2的相邻,所以手玩一下就好啦。

 

#include<bits/stdc++.h>
#define ll long long
using namespace std;
const int N=1e5+5;

int n,now,cnt[3];

int main(){
	scanf("%d",&n);
	for(int i=1,j;i<=n;i++){
		scanf("%d",&now),j=0;
		if(!(now&1)) now>>=1,j++;
		if(!(now&1)) now>>=1,j++;
		cnt[j]++;
	}
	
	if(cnt[2]>=cnt[0]||(!cnt[1]&&cnt[0]==cnt[2]+1)) puts("Yes");
	else puts("No");
	return 0;
}

  

相关文章:

  • 2022-12-23
  • 2021-11-07
  • 2022-12-23
  • 2022-12-23
  • 2021-09-14
  • 2022-12-23
  • 2021-11-23
  • 2021-05-25
猜你喜欢
  • 2022-12-23
  • 2021-08-24
  • 2021-10-03
  • 2021-10-12
  • 2022-12-23
  • 2022-12-23
  • 2021-06-28
相关资源
相似解决方案