当前位置: 首页 > news >正文

微商货源网站大全百度引擎的搜索方式是什么

微商货源网站大全,百度引擎的搜索方式是什么,网站开发 h5,网站让百度收录应该怎么做题意#xff1a; 现有一个定义#xff1a;#xff08;1#xff09;两个数的奇偶性相同 #xff08;2#xff09;两个数的差的绝对值为1 #xff0c;即|a-b|1 满足以上两个条件之一#xff0c;就可以说两个数是相似的 先给你一个数组#xff0c;让你将数组内分成多组 现有一个定义1两个数的奇偶性相同 2两个数的差的绝对值为1 即|a-b|1 满足以上两个条件之一就可以说两个数是相似的 先给你一个数组让你将数组内分成多组每组两个元素是否都相似。 题目 We call two numbers x and y similar if they have the same parity (the same remainder when divided by 2), or if |x−y|1. For example, in each of the pairs (2,6), (4,3), (11,7), the numbers are similar to each other, and in the pairs (1,4), (3,12), they are not. You are given an array a of n (n is even) positive integers. Check if there is such a partition of the array into pairs that each element of the array belongs to exactly one pair and the numbers in each pair are similar to each other. For example, for the array a[11,14,16,12], there is a partition into pairs (11,12) and (14,16). The numbers in the first pair are similar because they differ by one, and in the second pair because they are both even. Input The first line contains a single integer t (1≤t≤1000) — the number of test cases. Then t test cases follow. Each test case consists of two lines. The first line contains an even positive integer n (2≤n≤50) — length of array a. The second line contains n positive integers a1,a2,…,an (1≤ai≤100). Output For each test case print: YES if the such a partition exists, NO otherwise. The letters in the words YES and NO can be displayed in any case. Example Input 7 4 11 14 16 12 2 1 8 4 1 1 1 1 4 1 2 5 6 2 12 13 6 1 6 3 10 5 8 6 1 12 3 10 5 8 Output YES NO YES YES YES YES NO Note The first test case was explained in the statement. In the second test case, the two given numbers are not similar. In the third test case, any partition is suitable. 分析 由于n为偶数那么奇数个数和偶数个数奇偶性相同 1如果个数都为偶直接各自配对 2如果个数为奇我们只需要判断是否存在一对奇数和偶数相差为1配对如果找不到就NO AC代码 #includestdio.h #includecstring #includealgorithm using namespace std; int t,n,x,y,flag; int dp[60]; int main() {scanf(%d,t);while(t--){xyflag0;scanf(%d,n);for(int i0; in; i){scanf(%d,dp[i]);if(dp[i]%2) x;}if(x%20)flag1;sort(dp,dpn);for(int i1; in; i)if(dp[i]-dp[i-1]1){flag1;break;}flag1?printf(YES\n):printf(NO\n);}return 0; }
http://www.pierceye.com/news/256984/

相关文章:

  • 怎么网上推广自己的产品郑州seo优化外包顾问阿亮
  • 灵台门户网站建设网站开发费用会计分录
  • wordpress替换公共js北京seo推广服务
  • 公司付的网站费怎么做分录黑色网站配色
  • 体育门户网站源码峰峰做网站
  • 山西网站建设多少钱电商网站建设需要
  • 海西电子商务网站建设wordpress 主题宽度
  • 网站建设首选公司wordpress需要mysql
  • 织梦 旅游网站模板深圳公司招牌制作
  • PHP网站开发如何建立vipwordpress页面伪静态
  • 主题公园旅游景区网站建设网站后台图片模板
  • 慈溪网站建设慈溪WordPress点击文章显示404
  • 网站建设与seo网站开发项目总结范文
  • 做竞彩网站代理犯法么建站公司 网站
  • 浙江建设证书查询seo服务公司深圳
  • 长沙协会网站设计专业服务医疗信息化软件公司排名
  • 北京网站制作一般多少钱黑色网站欣赏
  • 广州建设工程造价管理站wordpress获取文章title
  • 免费购物网站源码网站开发的论文引言
  • 商城网站开发需要哪些人员本机建的网站打开却很慢
  • 网站建设哪专业学会python做网站
  • vs怎么添加图片做网站地方门户网站管理系统
  • 三亚做网站的公司科技网站推荐
  • 电商网站运维怎么做自己做网站创业
  • seo有哪些网站集团公司网站 案例
  • 传媒大学附近网站建设公司天津市工程建设公众信息网官网
  • 关于网站建设与维护的参考文献家装设计费用多少钱一平方
  • 网站建设与管理专业概述网站建设报价费用是多少
  • asp医院网站源码破解版北京企业做网站报价
  • 个人做电商网站赚钱吗门业网站模板