找了很久的规律,只看十进制数字,各种乱七八糟的规律=没规律!看了别人的解题报告,虽然看懂了,可是怎么发现的这个规律呢T.T~想了很久很久~ 以下是转载的别人的图,自己再画太麻烦了~全部看出0~2n-1-1,下标从0开始!!! 每次洗牌的时候,奇数在后偶数在前时,只需循环右移一下,如下:0(000) -->0(000) -->0(000) -->0(000)1(001) -->4(100) -->2(010) -->1(001)2(010) -->1(001) --…
http://acm.hdu.edu.cn/showproblem.php?pid=4710 Balls Rearrangement Time Limit: 6000/3000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others) Total Submission(s): 735    Accepted Submission(s): 305 Problem Description Bob has N balls and A b…
http://acm.hdu.edu.cn/showproblem.php?pid=4708 Rotation Lock Puzzle Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others) Problem Description Alice was felling into a cave. She found a strange door with a number square m…
http://acm.hdu.edu.cn/showproblem.php?pid=4715 Difference Between Primes Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others) Problem Description All you know Goldbach conjecture.That is to say, Every even integer great…
http://acm.hdu.edu.cn/showproblem.php?pid=4712 Hamming Distance Time Limit: 6000/3000 MS (Java/Others)    Memory Limit: 65535/65535 K (Java/Others) Total Submission(s): 1610    Accepted Submission(s): 630 Problem Description (From wikipedia) For bina…
hduoj 4706 Children's Day 2013 ACM/ICPC Asia Regional Online —— Warmup Herding Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others) Total Submission(s): 2005    Accepted Submission(s): 563 Problem Description Little Joh…
http://acm.hdu.edu.cn/showproblem.php?pid=4707 Pet Time Limit: 4000/2000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others) Problem Description One day, Lin Ji wake up in the morning and found that his pethamster escaped. He searched in th…
http://acm.hdu.edu.cn/showproblem.php?pid=4706 Children's Day Time Limit: 2000/1000 MS (Java/Others)     Memory Limit: 32768/32768 K (Java/Others) Problem Description Today is Children's Day. Some children ask you to output a big letter 'N'. 'N' is c…
Problem Description Elves are very peculiar creatures. As we all know, they can live for a very long time and their magical prowess are not something to be taken lightly. Also, they live on trees. However, there is something about them you may not kn…
http://acm.hdu.edu.cn/showproblem.php?pid=5441 Travel Time Limit: 1500/1000 MS (Java/Others)    Memory Limit: 131072/131072 K (Java/Others)Total Submission(s): 2061    Accepted Submission(s): 711 Problem Description Jack likes to travel around the wo…
http://acm.hdu.edu.cn/showproblem.php?pid=5444 Elven Postman Time Limit: 1500/1000 MS (Java/Others)    Memory Limit: 131072/131072 K (Java/Others)Total Submission(s): 939    Accepted Submission(s): 520 Problem Description Elves are very peculiar crea…
Elven Postman Time Limit: 1500/1000 MS (Java/Others)    Memory Limit: 131072/131072 K (Java/Others)Total Submission(s): 591    Accepted Submission(s): 329 Problem Description Elves are very peculiar creatures. As we all know, they can live for a very…
题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=4749 题目大意:给一个原序列N,再给出一个序列M,问从N中一共可以找出多少个长度为m的序列,序列中的数的相对大小关系与序列M中相对大小关系相同.(序列之间不能重叠) 解题思路:从头开始以i为起点暴搜,不断找长度为m的序列,判断是否满足条件.若满足,跳到i+m之后继续搜,若不满足,向后移一位继续搜. 判断方法压缩数据比较相对大小. #include<cstdio> #include<cstri…
http://acm.hdu.edu.cn/showproblem.php?pid=4750 题意: 定义f(u,v)为u到v每条路径上的最大边的最小值..现在有一些询问..问f(u,v)>=t的点对有所少对,注意(1,2)和(2,1)是不同的点对 分析: 原来最小生成树有一个很鬼畜的结论,那就是一个图的最小生成树中任意两个点的路径中的最大边一定最小.(妈蛋,完全不知道这个) 然后此题就变得很明朗了,用kruskal算法,加边的时候此边连接的两个集合的路径中的最大边就是这个边,存储下来,询问的时…
题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=4751 题目大意:判断一堆人能否分成两组,组内人都互相认识. 解题思路:如果两个人不是相互认识,该两人之间连边.最终构成一张图,二分匹配. #include<cstdio> #include<cstring> #include<iostream> using namespace std; #define maxn 105 #define maxm 20010 int n,e;…
题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=4747 思路: 比赛打得太菜了,不想写....线段树莽一下 实现代码: #include<iostream> #include<cstdio> #include<map> #include<cmath> using namespace std; #define lson l,m,rt<<1 #define rson m+1,r,rt<<1|…
HDU4716 A. A Computer Graphics Problem A题目描述 题意:输出手机剩余电量,保证给出的数是10的倍数. 题解:水题,按题意输出即可. 代码: #include <cstdio> #include <cstring> #include <algorithm> #define ll long long using namespace std; int main() { ,n,m; for (scanf("%d",&a…
Minimum palindrome Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 586    Accepted Submission(s): 110 Problem Description Setting password is very important, especially when you have so many "in…
这个纯粹是一个细节题啊!!! 由于某个地方的浮点数比较写错了,WA了无数次啊…… 代码如下: #include<iostream> #include<cstdio> #include<cmath> #include<algorithm> #include<cstring> using namespace std; ],str2[]; double h,s,l,r,g,b,v; bool is(double h,double a,double b)…
比赛的时候,被题目误导了,题目最后说结果可能很大,要取模,那时就想直接求会TLE的!!! 赛后才知道,坑啊………… 代码如下: #include<iostream> #include<cstdio> #include<cmath> #include<algorithm> #include<cstring> #define ll long long #define M 80001 #define mod 1000000007 using names…
1003 Rotation Lock Puzzle 找出每一圈中的最大值即可 代码如下: #include<iostream> #include<stdio.h> #include<algorithm> #include<iomanip> #include<cmath> #include<cstring> #include<vector> #define ll __int64 #define pi acos(-1.0) #…
HDU 4716 A Computer Graphics Problem 水题.略 HDU 4717 The Moving Points 题目:给出n个点的起始位置以及速度矢量,问任意一个时刻使得最远的两点的距离最小. 分析:显然只有两点的话,答案满足三分性质.对于多个点,画个图分析一下,其实也满足三分性质.因此,先构造n*(n-1)/2个二次函数,于是三分枚举时间即可. #include <iostream> #include <cstdio> #include <cstr…
第一眼就想到DP,然后想了N久就想不到可以不重算的DP  最后没办法了 先算出来 再去重.. 因为最多只有三个 对于三个来说有三种组合情况 x+y+z, x*y*z, x*y+z 那要么 x,y,z都不同 要么 有两个相同 要么有三个相同 对都不同情况我的DP结果会重复两次 对于有两个相同的会重复一次 统计出都相同的 两个相同的 最后减掉..有点乱 不过A了 先预处理 时间差不多4S多 再O(1)询问 #include <iostream> #include<cstdio> #in…
第一个被板刷的题 取余 依次算在周几 #include <iostream> #include<cstdio> #include<cstring> #include<algorithm> #include<stdlib.h> #include<cmath> #include<map> using namespace std; double ll,ss; ]; ][] = {"Monday", "…
AC了,但是不知道为什么,但是恶心的不得了~最近写代码,思路都非常清晰,但是代码各种bug~T.T~说说思路吧:二分~330ms~ 小队友fribbi的思路是离线250msAC~ 预处理solve函数(让能求出来的尽量都求出来)-->a[2]和a[n-3]已知 ①已知a[i]可知a[i+3]②已知a[i] a[i-1] 或者a[i] a[i+1]或者a[i+1] a[i-1]可知全部 ③已知a[0]或a[1]或a[n-2]或a[n-1]可知全部 提问: ①已知则直接输出,不存在a[i+1] a[…
题目描述 略... 题解 注意控制精度即可....变量全部定义成double,结果round就行....妈蛋....被这题目恶心死了.... 代码: #include <iostream> #include <cstdio> #include <cstring> #include <algorithm> #include <cmath> #include <string> using namespace std; #define ES…
题意: + ;];;;], seg[rt <<  | ]);)) * fa.setv;) * fa.setv;;], seg[rt <<  | ], r - l + );;, R, rson);;) * v;;], seg[rt <<  | ], r - l + );, R, v, rson);], seg[rt <<  | ]);], seg[rt <<  | ], r - l + );, R, v, rson);], seg[rt <&…
哈哈哈 #include <iostream> #include <cstring> #include <string> #include <cstdio> #include <cmath> #include <algorithm> #include <vector> #include <queue> #include <map> #define inf 0x3f3f3f3f using names…
Minimum palindrome Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others) Total Submission(s): 309    Accepted Submission(s): 150 Problem Description Setting password is very important, especially when you have so many "i…
Zhuge Liang's Mines Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others) Total Submission(s): 44    Accepted Submission(s): 9 Problem Description In the ancient three kingdom period, Zhuge Liang was the most famous and…