文件名称:array
- 所属分类:
- JSP源码/Java
- 资源属性:
- [Java] [源码]
- 上传时间:
- 2017-10-07
- 文件大小:
- 672kb
- 下载次数:
- 1次
- 提 供 者:
- 堪***
- 相关连接:
- 无
- 下载说明:
- 别用迅雷下载,失败请重下,重下不扣分!
介绍说明--下载内容均来自于网络,请自行研究使用
小易有一个长度为N的正整数数列A = {A[1], A[2], A[3]..., A[N]}。
牛博士给小易出了一个难题:
对数列A进行重新排列,使数列A满足所有的A[i] * A[i + 1](1 ≤ i ≤ N - 1)都是4的倍数。
小易现在需要判断一个数列是否可以重排之后满足牛博士的要求。
输入描述:
输入的第一行为数列的个数t(1 ≤ t ≤ 10),
接下来每两行描述一个数列A,第一行为数列长度n(1 ≤ n ≤ 10^5)
第二行为n个正整数A[i](1 ≤ A[i] ≤ 10^9)
输出描述:
对于每个数列输出一行表示是否可以满足牛博士要求,如果可以输出Yes,否则输出No。
输入例子1:
2
3
1 10 100
4
1 2 3 4
输出例子1:
Yes
No
*/(It has a length of N integers A = {A[1], A[2], A[3], A[N]}...
Dr out of a problem for small:
The series A rearrange the sequence of A meet all A[i] * A[i + 1] (I = 1 ~ N - 1) are multiples of 4.
Xiao Yi now need to determine whether a series can meet the requirements after the rearrangement of Dr.
Input descr iption:
The number of the first series of T input (t = 1 ~ 10),
Then every two lines describe a series of A, the first act of sequence length n (1 N 10^5)
Second n positive integer A[i] (1 A[i] 10^9)
Output descr iption:
For each sequence, output a line indicating whether it can meet the requirements of Dr. Niu, and if you can output Yes, otherwise output No.
Input example 1:
Two
Three
110100
Four
1234
Output example 1:
Yes
No
* /)
牛博士给小易出了一个难题:
对数列A进行重新排列,使数列A满足所有的A[i] * A[i + 1](1 ≤ i ≤ N - 1)都是4的倍数。
小易现在需要判断一个数列是否可以重排之后满足牛博士的要求。
输入描述:
输入的第一行为数列的个数t(1 ≤ t ≤ 10),
接下来每两行描述一个数列A,第一行为数列长度n(1 ≤ n ≤ 10^5)
第二行为n个正整数A[i](1 ≤ A[i] ≤ 10^9)
输出描述:
对于每个数列输出一行表示是否可以满足牛博士要求,如果可以输出Yes,否则输出No。
输入例子1:
2
3
1 10 100
4
1 2 3 4
输出例子1:
Yes
No
*/(It has a length of N integers A = {A[1], A[2], A[3], A[N]}...
Dr out of a problem for small:
The series A rearrange the sequence of A meet all A[i] * A[i + 1] (I = 1 ~ N - 1) are multiples of 4.
Xiao Yi now need to determine whether a series can meet the requirements after the rearrangement of Dr.
Input descr iption:
The number of the first series of T input (t = 1 ~ 10),
Then every two lines describe a series of A, the first act of sequence length n (1 N 10^5)
Second n positive integer A[i] (1 A[i] 10^9)
Output descr iption:
For each sequence, output a line indicating whether it can meet the requirements of Dr. Niu, and if you can output Yes, otherwise output No.
Input example 1:
Two
Three
110100
Four
1234
Output example 1:
Yes
No
* /)
相关搜索: java
(系统自动生成,下载前可以参看下载内容)
下载文件列表
Array.java
a.lol
a.lol