hdu3666 THE MATRIX PROBLEM--单源最短路径&差分约束
发布日期:2021-10-03 20:32:13 浏览次数:3 分类:技术文章

本文共 983 字,大约阅读时间需要 3 分钟。

原题链接:

一:原题内容

Problem Description
You have been given a matrix C
N*M, each element E of C
N*M is positive and no more than 1000, The problem is that if there exist N numbers a1, a2, … an and M numbers b1, b2, …, bm, which satisfies that each elements in row-i multiplied with ai and each elements in column-j divided by bj, after this operation every element in this matrix is between L and U, L indicates the lowerbound and U indicates the upperbound of these elements.
Input
There are several test cases. You should process to the end of file.
Each case includes two parts, in part 1, there are four integers in one line, N,M,L,U, indicating the matrix has N rows and M columns, L is the lowerbound and U is the upperbound (1<=N、M<=400,1<=L<=U<=10000). In part 2, there are N lines, each line includes M integers, and they are the elements of the matrix.
Output
If there is a solution print "YES", else print "NO".
Sample Input
3 3 1 62 3 48 2 65 2 9
Sample Output
YES

二:分析理解

三:AC代码

转载地址:https://blog.csdn.net/LaoJiu_/article/details/51056459 如侵犯您的版权,请留言回复原文章的地址,我们会给您删除此文章,给您带来不便请您谅解!

上一篇:hdu1272 小希的迷宫--并查集
下一篇:hdu1534 Schedule Problem--单源最短路径&差分约束

发表评论

最新留言

留言是一种美德,欢迎回访!
[***.207.175.100]2024年04月07日 16时48分27秒