HDU 5006 Resistance
思路:这题由于数据是随机的。。电阻不是1就是0,就可以先缩点,把电阻为0的那些边缩掉,只考虑有电阻的边,这样的话缩下来点数就不多了,就可以利用高斯消元+基尔霍夫定律去搞了
代码:
#include
#include
#include
#include
#include
using namespace std;
const int...
分类:
其他好文 时间:
2014-09-15 22:55:54
阅读次数:
294
XORTime Limit: 2000/1000 MS (Java/Others)Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 1364Accepted Submission(s): 402Problem Descript...
分类:
其他好文 时间:
2014-09-14 02:30:56
阅读次数:
263
一、高斯消元法
能使用消元法的情况:每次消元过程中,对角线元素始终不能为0,即矩阵可逆
我们一般利用高斯消元法进行矩阵的消元。下面我们通过举例说明:
如果按照我们初中所学的解法,一般是先用第三个方程将z用y表示,然后代入到第二个方程就可以用x来表示y和z,最后代入第一个方程就可以求得x,y,z。这个算法的核心就是消元!下面我们看看矩阵形式的消...
分类:
其他好文 时间:
2014-09-12 17:19:04
阅读次数:
144
把N个点先转化为2*N-2个点。比方说把012345转化成0123454321。这样,就能够找出随意两两个点之间的关系。然后依据关系能够得出来一个一元多项式的矩阵。然后就用高斯消元求出矩阵就可以。#include#include#include#include#include#includeusin...
分类:
其他好文 时间:
2014-09-10 15:36:30
阅读次数:
178
Youmust have heard the name of Kernighan and Ritchie, the authors ofThe C Programming Language. While coding in
C, we use differentcontrol statements and loops, such as, if-then-else,
for, do-while,...
分类:
其他好文 时间:
2014-09-02 15:59:14
阅读次数:
206
Where is the canteen
Problem Description
After a long drastic struggle with himself, LL decide to go for some snack at last. But when steping out of the dormitory, he found a serious problem...
分类:
其他好文 时间:
2014-08-28 13:23:19
阅读次数:
431
#include
#include
#include
#include
using namespace std;
int a[40][40],x[40];//系数矩阵,解数组
int equ,var;//方程数,变元数
void Debug()
{
for(int i=0;i<equ;i++)
{
for(int j=0;j<=var;j++)
...
分类:
其他好文 时间:
2014-08-24 22:18:43
阅读次数:
213
Flip Game
Time Limit: 1000MS
Memory Limit: 65536K
Total Submissions: 30805
Accepted: 13409
Description
Flip game is played on a rectangular 4x4 field with two-sided...
分类:
其他好文 时间:
2014-08-24 18:07:32
阅读次数:
209
The Water Bowls
Time Limit: 1000MS
Memory Limit: 65536K
Total Submissions: 4352
Accepted: 1721
Description
The cows have a line of 20 water bowls from which they dr...
分类:
其他好文 时间:
2014-08-24 18:07:14
阅读次数:
275
The Pilots Brothers' refrigerator
Time Limit: 1000MS
Memory Limit: 65536K
Total Submissions: 18641
Accepted: 7145
Special Judge
Description
The game “The Pilo...
分类:
其他好文 时间:
2014-08-24 18:06:42
阅读次数:
240