上一页 1 ··· 16 17 18 19 20 21 22 23 24 ··· 41 下一页
题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=5233 题意:有n颗树,第 i 棵树的高度为 h[i],树上有鸟,现在这个人要打m次枪,每次打的高度是 q[i], 求每次 打枪能打下鸟的编号,否则输出-1 ; STL中的map和vector: #inc Read More
posted @ 2016-03-06 20:53 西瓜不懂柠檬的酸 Views(118) Comments(0) Diggs(0)
题目链接:http://codeforces.com/contest/567/problem/C 题意就是有n个数现在要让 ai aj ak 构成公比为K的等比数列(i < j < k);求有多少种组合方法; 我们可以对 a[i] 找 a[i]/k 和 a[i]*k ,设a[i]前面有 x个a[i] Read More
posted @ 2016-01-28 21:11 西瓜不懂柠檬的酸 Views(336) Comments(0) Diggs(0)
题目链接:http://codeforces.com/contest/558/problem/D 题意就是有一个二叉树高度为 h ,人站在根节点上,现在要走出去,出口在叶子节点上,有 q 条信息,每条信息包含了在第 x 层的节点 L 到 R 范围内的叶子节点中是否存在出口,ans=1代表包含,ans Read More
posted @ 2016-01-27 21:24 西瓜不懂柠檬的酸 Views(277) Comments(0) Diggs(0)
题目链接:http://codeforces.com/problemset/problem/558/C题意:有n个数,每个数都可以进行两个操作 *2 或者 /2,求最小的操作次数和,使得所有的数都相等;计算一下时间复杂度可以知道每个数所能达到数的时间复杂度是log(1e5)最终的时间复杂度也就是 n... Read More
posted @ 2016-01-27 10:26 西瓜不懂柠檬的酸 Views(535) Comments(0) Diggs(0)
题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=2077#include #include #include #include #define N 25int main(){ int a[N]={0, 2};///汉诺塔三的规律,把最左边的移动到最... Read More
posted @ 2016-01-20 09:42 西瓜不懂柠檬的酸 Views(233) Comments(0) Diggs(0)
题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=2527 用优先队列模拟 #include<iostream> #include<stdio.h> #include<cstring> #include<algorithm> #include<queue> Read More
posted @ 2015-12-29 13:20 西瓜不懂柠檬的酸 Views(181) Comments(0) Diggs(0)
题目链接:http://codeforces.com/problemset/problem/550/C 题意是给你一个不操过100位的数,问删除m位之后,问剩下的数不改变顺序能被8整除的数存在不存在; 能被8整除的数后三位一定能被8整除 #include<cstdio> #include<iostr Read More
posted @ 2015-12-15 14:49 西瓜不懂柠檬的酸 Views(267) Comments(0) Diggs(0)
比赛链接:http://codeforces.com/problemset/problem/550/B给你n个数,选出来只是2个然后求他们的和在L和R的区间内,并且选出来的数中最大值和最小值的差不得小于x,求共有多少种选法下面是dfs搜出来的;#include#include#include#inc... Read More
posted @ 2015-12-11 18:01 西瓜不懂柠檬的酸 Views(355) Comments(0) Diggs(0)
市面上最常见的魔方,是三阶魔方,英文名为Rubik's Cube,以魔方的发明者鲁比克教授的名字命名。另外,二阶魔方叫Pocket Cube,它只有2*2*2个角块,通常也就比较小;四阶魔方叫Revenge Cube,这是因为就算你好不容易复原了三阶魔方,四阶魔方也会向你“复仇”;而五阶魔方叫Pro Read More
posted @ 2015-12-09 16:31 西瓜不懂柠檬的酸 Views(254) Comments(0) Diggs(0)
题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=1285拓扑序就是求一个序列 数 a 出现在数 b 前面,最终输出满足条件的序列即可;过程就是每次选取入度为0的数每次把它计入拓扑序列,并把与该点相连的所有边删除即可;由于拓扑序不是唯一的本题要求序号小的放... Read More
posted @ 2015-12-07 15:57 西瓜不懂柠檬的酸 Views(140) Comments(0) Diggs(0)
上一页 1 ··· 16 17 18 19 20 21 22 23 24 ··· 41 下一页
levels of contents