递归求解几类排列组合问题...
分类:
其他好文 时间:
2014-08-05 11:23:29
阅读次数:
161
A Magic Lamp
Time Limit: 2000/1000 MS (Java/Others) Memory Limit:
32768/32768 K (Java/Others)
Problem Descripti...
分类:
其他好文 时间:
2014-08-05 11:23:19
阅读次数:
240
题目:uva10401Injured Queen Problem(递推)
题目大意:依旧是在棋盘上放皇后的问题,这些皇后是受伤的皇后,攻击范围缩小了。攻击范围在图中用阴影表示(题目)。然后给出棋盘的现状,???3?4:在一个6*6的棋盘上,因为皇后是可以列向攻击的,所以一列只能放一个皇后,所以第一个?代表第一列的皇后放的行未知,这样3的意思就是第4列皇后在第三行,也就是确定了第4列皇...
分类:
其他好文 时间:
2014-08-05 11:23:10
阅读次数:
211
链接:http://acm.hdu.edu.cn/showproblem.php?pid=4786
题意:有N个节点(1 5),M条边(0 5),其中一部分边被染成了黑色,剩下的边是白色,问能不能建立一棵树,树中有斐波那契数个白色边。
思路:用克鲁斯卡尔建三次树,第一是用所有边建树,判断是否能建成一棵树,第二次用黑边建树,最多可以用到x条黑边(不成环),n-1-x就是最少需要用的白边的数量,第...
分类:
其他好文 时间:
2014-08-05 11:22:59
阅读次数:
209
题意:
给你一个区间,每次可以进行两种操作
1:把区间中的数全都变成x
2:把区间中大于x的数变成gcd(a[i], x)
最后输出序列。(n,m
时限 15s,暴力也能过。。。。
线段树做法,区间更新,lazy标记,到需要更新的时候才更新。
num[rt] != -1,表示 区间 L[rt]~R[rt] 所有的数都相同。
#inclu...
分类:
其他好文 时间:
2014-08-05 11:22:53
阅读次数:
187
BestCoder Sequence
Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)
Total Submission(s): 711 Accepted Submission(s): 253
Problem Description
Mr Potato...
分类:
其他好文 时间:
2014-08-05 11:22:52
阅读次数:
231
由Mozilla开发的新移动设备操作系统Firefox os 经过几次版本迭代我们看到了Mozilla的进步与艰辛,在安卓设备满大街的情况下任然坚持做一款新的移动设备操作系统,经过1.3、1.4、2.0、再到现在最新的2.1操作系统,界面UI有了十足的跨越, 简洁清新的界面给人一种干净温暖的感觉,通过firefox os 2.1这一版本我们相信Firefox os 移动设备操作系统离我们更近了!
...
分类:
其他好文 时间:
2014-08-05 11:20:59
阅读次数:
198
#include
#include
#include
#include
#include
#include
using namespace std;
const int MAXN = 100 + 1; //阵地行数
const int MAXM = 10 + 1; //阵地列数
const int State_Num = 60 + 1; //阵地列状态...
分类:
其他好文 时间:
2014-08-05 11:20:39
阅读次数:
167
原题http://acm.hdu.edu.cn/showproblem.php?pid=4907
Task schedule
Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)
Total Submission(s): 692 Accepted Submission(s)...
分类:
其他好文 时间:
2014-08-05 11:20:19
阅读次数:
218
#include
#include
#include
/*
有符号 结构体1
*/
struct bits
{
int b1:5;
/*
因为是int型,最大设置32位,由于int型是有符号整形,
所以这里5位为有符号类型。
11111 -1
10000 -16
01111 15
00000 0
*/
int :2;
int b2:2;
/*
11 -1
10 -2
01 1
0...
分类:
其他好文 时间:
2014-08-05 11:20:09
阅读次数:
205
map解法
#include
using namespace std;
mapp;
int main()
{
string a,b;
while(cin>>a)
{
if(getchar()=='\n')
break;
cin>>b;
p[b]=a;
}
if(p[a]=="")...
分类:
其他好文 时间:
2014-08-05 11:19:49
阅读次数:
169
杭电的图论题目列表,共计500题,努力刷吧
AC 64ms
#include
#include
#include
#include
#include
const int INF = 1e8;
using namespace std;
int father[100010];
bool vis[100010];
int findx(int r)
{
int i = r,j;
...
分类:
其他好文 时间:
2014-08-05 11:19:39
阅读次数:
235
链接:http://acm.hdu.edu.cn/showproblem.php?pid=4790
题意:从【a,b】中随机找出一个数字x,从【c,d】中随机找出一个数字y,给出p,m,如果(x+y)%p==m则算成功,问成功的概率是多少。
思路:【a,b】中连续p个数,【c,d】中连续p个数,用这2*p个数进行组合能找到p种的成功组合(具体不证),所以找到【a,b】中p循环的个数x1,【c,...
分类:
其他好文 时间:
2014-08-05 11:19:29
阅读次数:
166
Description
People are different. Some secretly read magazines full of interesting girls' pictures, others create an A-bomb in their cellar, others like using Windows, and some like difficult mathe...
分类:
其他好文 时间:
2014-08-05 11:18:39
阅读次数:
245
A Simple Problem with Integers
Time Limit: 5000MS
Memory Limit: 131072K
Total Submissions: 60441
Accepted: 18421
Case Time Limit: 2000MS
Description
You have N...
分类:
其他好文 时间:
2014-08-05 11:18:29
阅读次数:
254
你站在桥上看风景,看风景的人在窗外看你,娱乐围观又何尝不是如此。韩寒VS四娘的首次正面对决在观众和媒体的一片看热闹声势中,携手达到了双赢的欢乐结局。...
分类:
其他好文 时间:
2014-08-05 11:18:19
阅读次数:
184
1.背包问题:
①最优装载问题:把物体重量从小到大排列,依次选择每个物体,只顾眼前,却能得到最优解。
②部分背包问题:把物体的“价值除以重量的值”从小到大排序,一次选择每个物体(贪心只能对一个变量贪心,这是一种巧妙的转换)。
③乘船问题:只让眼前的浪费最少。(注意是让什么最少,是让浪费最少!)
2.区间相关问题(排序:排左边还是右边?):
①选择不相交区间:
②区间选点问题:
③区间...
分类:
其他好文 时间:
2014-08-05 11:18:09
阅读次数:
163