hdu
RIPwangh
山东理工大学本科学生
展开
-
HDU-5056-Boring count-周赛4补题
题意: 给你一个串s,让你去计算一下有多少符合串中相同字母的个数不大于k值的子串的数目思路: 尺取法; 设两个指针h,t,让t 向右移动,确保现在的子串满足题目要求,不满足的话,把h向右移动,直到满足为止,当t到串的尾部停止;CODE#include#include#include#define LL __int64int a[30]; char s[1100原创 2015-08-24 08:47:15 · 555 阅读 · 0 评论 -
网赛 HDU 5444 Elven Postman
题目意思 : 排序二叉树,直接上就行了CODE#include#include#include#include#includeusing namespace std;struct node{ int x; struct node *l, *r;};char mp[1010][1010];node *head;void juge()///小的是右边E原创 2015-09-29 20:50:26 · 447 阅读 · 0 评论 -
2015网赛1-The Water Problem-5443
题目意思: 很简单,让你去求一段区间里面的最大的值思路: RMQCODE#include#include#include#include#includeusing namespace std;int mx[51000][50];int ls[51000];int n, m;void RMQ_max()///大的{ int i, j;原创 2015-09-15 20:37:35 · 398 阅读 · 0 评论 -
10.1训练赛--北京14现场赛--HDU5119
题目意思: 从中选择任意的数进行异或运算,看有多少异或运算的结果大于给定值思路:dp[ i+1][j] += dp[i][j];dp[i+1][j^a[i]] += dp[i][j];code#include #include#include#include#define LL long longusing namespace std;const原创 2015-10-04 21:04:21 · 406 阅读 · 0 评论 -
HDU-5120-10.1训练赛-
模板题CODE#include#include#include#include#include#include#define esp 1e-8using namespace std;struct Circle{ double x,y; double r;};double calArea(Circle c1, Circle c2){ dou原创 2015-10-04 21:33:59 · 516 阅读 · 0 评论 -
两圆 相交面积
double calArea(Circle c1, Circle c2){ double d; double s,s1,s2,s3,angle1,angle2,temp; d=sqrt((c1.x-c2.x)*(c1.x-c2.x)+(c1.y-c2.y)*(c1.y-c2.y)); if(d>=(c1.r+c2.r))//两圆相离 return原创 2015-10-04 21:35:11 · 542 阅读 · 0 评论 -
10.1训练赛--2014上海区域赛--- World Cup**
题意思:题目大意:一场比赛,赢的得A分,输的得C分,平手都得B分。有n支队伍,分别比赛一次,选前m个队伍晋级(分数相同的随机排名)。问:可能的最大落榜分数,可能的最小晋级分数。思路:首先若A<C,交换A和C。考虑第一个问题,贪心地让分数都尽量集中到前m+1个队伍身上,那么就要后n-m-1个队伍都给m+1个队伍最多的分数,即max{A, B}。那么前m+1个队伍的竞技中,希望分数转载 2015-10-05 19:05:51 · 622 阅读 · 0 评论 -
10.1训练赛-北京现场赛--HDU5122
思路:从后向前扫一遍就行了CODE#include #include#include#includeusing namespace std;int ls[1000100];int main(){ int t; scanf("%d",&t); int io = 1; while(t--) { int n, i;原创 2015-10-04 19:11:11 · 418 阅读 · 0 评论 -
10.1训练赛---2014北京现场赛-A-hdu5112
题目意思: 要求所给时间段最快的速度思路: 签到题,水过CODE#include #include#include#includeusing namespace std;struct node{ double t; double s;}ls[1000100];bool cmp(node x,node y){ return x.t原创 2015-10-04 18:51:28 · 442 阅读 · 0 评论 -
2015网络赛&HDU5444 Elven Postman - 排序二叉树
题目意思: 给你一组排序二叉树,让你输出节点的方向,小的是E,大的是WCODE#include#include#include#include#includeusing namespace std;struct node{ int x; struct node *l, *r;};char mp[1010][1010];node *head;voi原创 2015-09-17 21:29:48 · 434 阅读 · 0 评论 -
HDU-2544-最短路-模板
//Dijkstra-感觉和prim很像,就是很像#include#include#include#define MAX 0x3f3f3fint map[150][150];int dis[150];int n;int bj[150];void dijkstra(){ memset(bj,0,sizeof(bj)); memset(dis,0,sizeof(d原创 2015-08-03 15:48:51 · 608 阅读 · 0 评论 -
2015-多校5-MZL's chemistry
Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/65536 K (Java/Others)Total Submission(s): 0 Accepted Submission(s): 0Problem Description MZL define F(X) as the firs转载 2015-08-04 16:51:19 · 564 阅读 · 0 评论 -
BC-52-1001
思路很简单:代码:#include#include#includeint main(){ int x, y, w, n; while(~scanf("%d%d%d%d",&x,&y,&w,&n)) { int key = x/w+1;///一次几个 int d = n/key;///第几次 int dx =原创 2015-08-22 20:09:25 · 481 阅读 · 0 评论 -
SDKD-训练题-HDU-4788-Hard Disk Drive-模拟
题意: 实际内存和标号内存是有区别的,现在问你差别多大思路: 模拟,用POW足以解决CODE#include#include#include#include#include#includeusing namespace std;char b[9][5]={"B]","KB]","MB]","GB]","TB]","PB]","EB]","ZB]","YB原创 2015-08-24 19:11:37 · 577 阅读 · 0 评论 -
SDKD-训练题-HDU-4786-Fibonacci Tree
题意:题目的意思是给你一些白色边和黑色边,现在问你能否用两色边构造出一颗生成树,且树中白色边的数量为一个Fibonacci数。思路: 构造最大生成树和最小生成树; 先去判断是否为联通图,不联通的就输出NO 计算里面白边的值,看在这个范围内有没有Fibonacci的数CODE#include#include#include#include#incl原创 2015-08-24 20:46:54 · 613 阅读 · 0 评论 -
多校-7-1005- The shortest problem
Problem DescriptionIn this problem, we should solve an interesting game. At first, we have an integer n, then we begin to make some funny change. We sum up every digit of the n, then insert it to原创 2015-08-11 16:11:13 · 458 阅读 · 0 评论 -
多校-1008-Clock
Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/65536 K (Java/Others)Total Submission(s): 377 Accepted Submission(s): 200Problem DescriptionGive a time.(hh:mm:ss),you should原创 2015-08-13 16:44:43 · 493 阅读 · 0 评论 -
hdu-2147kiki's game-博弈
Problem DescriptionRecently kiki has nothing to do. While she is bored, an idea appears in his mind, she just playes the checkerboard game.The size of the chesserboard is n*m.First of all, a coin转载 2015-08-01 14:20:40 · 721 阅读 · 0 评论 -
2015多校-MZL's xor
Problem DescriptionMZL loves xor very much.Now he gets an array A.The length of A is n.He wants to know the xor of all (Ai+Aj)(1≤i,j≤n)The xor of an array B is defined as B1 xor B2...xor Bn原创 2015-08-04 16:41:20 · 862 阅读 · 0 评论 -
2015-多校-6-1011-Key Set-快次幂
Problem Descriptionsoda has a set $S$ with $n$ integers $\{1, 2, \dots, n\}$. A set is called key set if the sum of integers in the set is an even number. He wants to know how many nonempty subset转载 2015-08-06 17:13:01 · 813 阅读 · 0 评论 -
HDU 2473-Junk-Mail Filter-并查集删除
#include#include#includeint ls[2000000],_hash[2000000], d[2000000];int find1(int x){ return ls[x] == x ? x : ls[x]=(find1(ls[x]));}void add(int x, int y){ int xx = find1(x); int y原创 2015-08-15 18:37:58 · 471 阅读 · 0 评论 -
Reorder the Books-HDU-5500-BC59div2
题目意思: 很明白CODE#include #include #include #include #include using namespace std;int a[30];bool f[30];int main(){ int ls[30]; int t; scanf("%d",&t); while(t--) {原创 2015-10-11 11:31:08 · 510 阅读 · 0 评论