当前你的浏览器版本过低,网站已在兼容模式下运行,兼容模式仅提供最小功能支持,网站样式可能显示不正常。
请尽快升级浏览器以体验网站在线编辑、在线运行等功能。

建议使用的浏览器:

谷歌Chrome 火狐Firefox Opera浏览器 微软Edge浏览器 QQ浏览器 360浏览器 傲游浏览器

4795:Easy Problem Once More

题目描述
Define matrix , if for every m(1 ≤ m ≤ n),

then matrix A can be called as partially negative matrix. Here matrix
, and {i1,..,im} is a sub set of {1,..,n}.If you are not familiar with determinant of a matrix, please read the Note part of this problem.
For example, matrix is a partially negative matrix because |-2|, |-6| andare negative.
A symmetric matrix is a square matrix that equals to its transpose. Formally, matrix A is symmetric if A = AT. For example, is a symmetric matrix.
Given two N-dimensional vector x and b, and we guarantee that there will be at least
one 0 value in vector b. You task is to judge if there exists a symmetric partially
negative matrix A, which fulfills Ax = b.
输入解释
There are several test cases. Proceed to the end of file.
Each test case is described in three lines.
The first line contains one integer N (2 ≤ N ≤ 100000) .
The second line contains N integers xi (-1000000 < xi < 1000000, 1 ≤ i ≤ N), which is vector x.
The third line contains N integers bi (-1000000 < bi < 1000000, 1 ≤ i ≤ N), which is vector b. There will be at least one bi which equals to zero.
输出解释
For each test case, output “Yes” if there exists such a matrix A, or “No” if there is no such matrix.
输入样例
2
2 1
0 6
输出样例
Yes
提示
There exists a symmetric partially negative matrix 


Note

Determinant of an n ×  n matrix A is  defined as below:

Here the sum is computed over all permutations σ of the set {1, 2, ..., n}.
A permutation is a function that reorders this set of integers.
The value in the  ith position after the reordering σ is denoted σi.
For example, for n = 3, the original sequence 1, 2, 3 might be reordered to σ = [2, 3, 1],with σ[sub]1[/sub] = 2, σ[sub]2[/sub] = 3, and σ[sub]3[/sub] = 1.
The set of all such permutations (also known as the symmetric group on n elements) is denoted Sn. 
For each permutation σ, sgn(σ) denotes the signature of σ, a value that is +1
whenever the reordering given by σ can be achieved by successively interchanging two entries an even number of times,
and −1 whenever it can be achieved by an odd number of such interchanges.
来自杭电HDUOJ的附加信息
Recommend

该题目是Virtual Judge题目,来自 杭电HDUOJ

源链接: HDU-4795

最后修改于 2020-10-25T23:16:53+00:00 由爬虫自动更新

共提交 0

通过率 --%
时间上限 内存上限
4000/2000MS(Java/Others) 32768/32768K(Java/Others)