- 博客(9)
- 收藏
- 关注
原创 二分查找经典写法
二分查找 public static int binSearch(int srcArray[], int key) { int mid; int start = 0; int end = srcArray.length - 1; while (start <= end) { mid = (end...
2018-03-07 00:07:35
604
1
原创 poj3083 Children of the Candy Corn
Children of the Candy Corn Time Limit: 1000MS Memory Limit: 65536K Total Submissions: 11244 Accepted: 4856 Description The cornfield maze is a popular Halloween treat
2015-08-25 16:41:34
299
原创 逆序数还原
逆序数还原 有一段时间Eric对逆序数充满了兴趣,于是他开始求解许多数列的逆序数(对于由1...n构成的一种排列数组a,逆序数即为满足iaj的数字对数),但是某天他发现自己遗失了原来的数列,只留下之前计算过程中留下的各个数字对应的逆序数,现在请你帮他还原出原序列。 Input 数据有多组,请处理到文件结尾。 每组数据第一行为一个整数N(1
2015-08-24 20:24:53
580
原创 Codeforces 453A Little Pony and Expected Maximum
A. Little Pony and Expected Maximum time limit per test 1 second memory limit per test 256 megabytes input standard input output standard output Twilight Sparkle was pla
2015-08-24 17:19:48
401
转载 codeforces#FF DIV2C题DZY Loves Sequences(DP)
C. DZY Loves Sequences time limit per test 1 second memory limit per test 256 megabytes input standard input output standard output DZY has a sequence a, consisting
2015-08-15 21:33:11
287
原创 离散事件模拟-银行管理
离散事件模拟-银行管理 Time Limit: 1000ms Memory limit: 65536K 有疑问?点这里^_^ 题目描述 现在银行已经很普遍,每个人总会去银行办理业务,一个好的银行是要考虑 平均逗留时间的,即: 在一定时间段内所有办理业务的人员逗留的时间的和/ 总的人数。逗留时间定义为 人员离开的时间减去人员来的时间。银行只有
2015-08-06 21:23:17
769
转载 并查集 ---压缩路径
使用并查集查找时,如果查找次数很多,那么使用朴素版的查找方式肯定要超时。比如,有一百万个元素,每次都从第一百万个开始找,这样一次运算就是10^6,如果程序要求查找个一千万次,这样下来就是10^13,肯定要出问题的。 这是朴素查找的代码,适合数据量不大的情况: int findx(int x) { int r=x; while(parent[r] !=r)
2015-08-06 20:28:22
626
原创 poj的第一个题
Tiling Time Limit: 1000MS Memory Limit: 65536K Total Submissions: 8177 Accepted: 3960 Description In how many ways can you tile a 2xn rectangle by 2x1 or 2x2 tiles?
2015-07-30 15:18:15
355
转载 第一次写那么长的代码
二元多项式 Time Limit: 1000ms Memory limit: 65536K 有疑问?点这里^_^ 题目描述 给你多个二元多项式和一个操作符,让你输出操作符操作这些二元多项式之后的结果。 输入 首先输入二元多项式的个数n和操作符号(‘+’,‘*’); 后面n行输入每一个多项式。 多组输入,当n=0的时候结束输入。 (n 输出
2015-07-30 15:14:37
640
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人
RSS订阅