线性推,矩阵乘法+快速幂求通项。
传送门:点击打开链接
#include
#include
#include
#include
using namespace std;
#define LL long long
struct Mat{
LL f[2][2];
};
LL MOD;
Mat mul(Mat a,Mat b)
{
LL i,j,k;
...
分类:
其他好文 时间:
2014-05-15 14:53:10
阅读次数:
225
题目链接:http://poj.org/problem?id=2135
Farm Tour
Time Limit: 1000MS
Memory Limit: 65536K
Total Submissions: 10862
Accepted: 4024
Description
When FJ's f...
分类:
其他好文 时间:
2014-05-15 11:24:14
阅读次数:
348
Friend Chains
Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)
Total Submission(s): 2882 Accepted Submission(s): 970
Problem Description
For a group o...
分类:
其他好文 时间:
2014-05-15 11:21:04
阅读次数:
438
用 栈 stack 来模拟
题目意思:http://blog.csdn.net/mobius_strip/article/details/12765319
下面的代码有坑,输出格式需要调。
#include
#include
#include
#include
#include
using namespace std;
const int maxn=25+5;
stacks[maxn];
i...
分类:
其他好文 时间:
2014-05-15 07:22:04
阅读次数:
273
Subsequence
Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others)
Total Submission(s): 3995 Accepted Submission(s): 1308
Problem Description
There is a sequenc...
分类:
其他好文 时间:
2014-05-15 06:47:40
阅读次数:
275
题目链接:http://poj.org/problem?id=3469
Dual Core CPU
Time Limit: 15000MS
Memory Limit: 131072K
Total Submissions: 18147
Accepted: 7833
Case Time Limit: 5000MS
...
分类:
其他好文 时间:
2014-05-15 06:23:05
阅读次数:
271
Implement atoi to convert a string to an integer.
Hint: Carefully consider all possible input cases. If you want a challenge, please do not see below and ask yourself what are the possible input cases.
Notes: It is intended for this problem to be specifi...
分类:
其他好文 时间:
2014-05-15 05:00:50
阅读次数:
229
安排任务的问题。
思路:
因为分报告时间和实际执行任务时间,这里要做的就是尽量使得报告时间和实际执行任务的时间重合,并行,那么就可以减小总时间。
原题:http://uva.onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&page=show_problem&problem=2829
0.012s的算法,达到网站最高纪录。
...
分类:
其他好文 时间:
2014-05-15 04:23:35
阅读次数:
269
Problem Description
The new semester begins! Different kinds of student societies are all trying to advertise themselves, by giving flyers to the students for introducing the society. However, due ...
分类:
其他好文 时间:
2014-05-15 03:57:24
阅读次数:
311
题目来源:UVa 10308 Roads in the North
题意:求距离最远的2点之间的距离
思路:裸的树的直径 或者树形DP
#include
#include
#include
using namespace std;
const int maxn = 100010;
struct node
{
int to, w;
node(){}
node(int to, int...
分类:
其他好文 时间:
2014-05-15 03:37:18
阅读次数:
295