Problem C CALCULATOR CONUNDRUMAlice got a hold of an old calculator that can display n digits. She was bored enough to come up with the following time...
分类:
其他好文 时间:
2014-08-18 12:07:54
阅读次数:
269
题目连接:uva 684 - Integral Determinant
题目大意:给定一个行列式,求行列式的值。
解题思路:将行列式转化成上三角的形式,值即为对角线上元素的积。因为要消元,又是整数,所以用分数去写了。
#include
#include
#include
using namespace std;
typedef long long type;
struct...
分类:
其他好文 时间:
2014-08-18 01:35:03
阅读次数:
250
You are given the task to design a lighting system for a huge conference hall. After doing a lot of calculation & sketching, you have figured out the requirements for an energy-efficient design that c...
分类:
其他好文 时间:
2014-08-18 00:21:55
阅读次数:
211
Secret agent Maria was sent to Algorithms City to carry out an especially dangerous mission. After several thrilling events we find her in the first station of Algorithms City Metro, examining the tim...
分类:
其他好文 时间:
2014-08-18 00:21:13
阅读次数:
383
Background
Problems that require minimum paths through some domain appear in many different areas of computer science. For example, one of the constraints in VLSI routing problems is minimizing wire ...
分类:
其他好文 时间:
2014-08-18 00:20:23
阅读次数:
331
题目连接:uva 10655 - Contemplation! Algebra
题目大意:输入非负整数,p,q,n,求an+bn的值,其中a和b满足a+b=p,ab=q,注意a和b不一定是实数。
解题思路:定义f(n)=an+bn,则有f(n)?(a+b)=(an+bn)?(a+b)=an+1+abn+ban+bn+1=f(n+1)+abf(n?1),
所以f(n+1)=(a+b)...
分类:
其他好文 时间:
2014-08-18 00:18:23
阅读次数:
373
题目链接:uva 11149 - Power of Matrix
题目大意:给定一个矩阵,求∑ikAi
解题思路:因为k比较大,所以即使用快速幂的话复杂度还是有点高,利用矩阵倍增的方法∑ikAi=(1+Ak/2)?∑ik/2Ai
#include
#include
#include
using namespace std;
const int maxn = 50;
const...
分类:
其他好文 时间:
2014-08-18 00:17:23
阅读次数:
273
题目链接:uva 1560 - Extended Lights Out
题目大意:给定一个5?6的矩阵,每个位置上有一个灯和开关,初始矩阵表示灯的亮暗情况,如果按了这个位置的开关,将会导致周围包括自己位置的灯状态变换,求一个按开关位置,保证所有灯都灭掉。
解题思路:
枚举,枚举第一行的状态,然后递推出后面四行的状态。 高斯消元,对于每个位置对定变量,这样列出30个方程求解。
C...
分类:
其他好文 时间:
2014-08-18 00:16:43
阅读次数:
228
II
U C ONLINE
C ON TEST
2 008
Problem D: GCD LCM
Input: standard input
Output: standard output
The GCD of two positive integers is the largest integer ...
分类:
其他好文 时间:
2014-08-17 21:24:53
阅读次数:
189
InterGames is a high-tech startup company that specializes in developing technology that allows users to play games over the Internet. A market analysis has alerted them to the fact that games of chan...
分类:
其他好文 时间:
2014-08-17 21:22:52
阅读次数:
352