C++迭代器说明与难点分析...
分类:
其他 时间:
2015-03-24 23:13:57
收藏:
0 评论:
0 赞:
0 阅读:
432
[__NSCFNumber length]: unrecognized selector sent to instance 0x1657c5c0
2014-09-24 14:47:39.170 StarShow[1948:60b] *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason:...
分类:
其他 时间:
2015-03-24 23:13:47
收藏:
0 评论:
0 赞:
0 阅读:
387
题意:
1代表放入;
2代表拿出;
问可能是哪种数据结构;
思路:
将题目提供的三种数据结构拿进去模拟一下就行了;
#include
#include
#include
#include
#include
using namespace std;
queue q;
stack s;
priority_queue pq;
int main() {
int n;
in...
分类:
其他 时间:
2015-03-24 23:13:37
收藏:
0 评论:
0 赞:
0 阅读:
380
这个题目的困难之处在于处理间接持股的情况可能有多层,开始的时候我也没想清楚怎么处理这种情况后面参考了别人的想法才写出来的。其实对于间接持股的情况,我们可以在每次遇到直接控制情况时,用dfs将其转化为直接持股的情况,当然如果在dfs过程中遇到股份大于百分之五十的情况时还要继续dfs跟新下去。代码如下:/*
ID:15674811
LANG:C++
PROG:concom
*/#include<iost...
分类:
其他 时间:
2015-03-24 23:13:17
收藏:
0 评论:
0 赞:
0 阅读:
366
题目描述:
输入字符串s和字符c,要求去掉s中所有的c字符,并输出结果。
输入:
测试数据有多组,每组输入字符串s和字符c。
输出:
对于每组输入,输出去除c字符后的结果。
样例输入:
heallo
a
样例输出:
hello
第一种方法:
#include
#include
using namespace std;
int main...
分类:
其他 时间:
2015-03-24 23:13:07
收藏:
0 评论:
0 赞:
0 阅读:
292
#include
#include
#include
#include
#include
using namespace std ;
const int maxn = 130;
const int inf = 0x7fffffff;
int N;
int dx[4] = {-1,0,1,0};
int dy[4] = {0,1,0,-1};
int line[maxn][m...
分类:
其他 时间:
2015-03-24 23:12:58
收藏:
0 评论:
0 赞:
0 阅读:
312
完全背包的简单变形,秒杀。代码如下:/*
ID:15674811
LANG:C++
PROG:money
*/#include
#include
#include
#include
#include
#include
using namespace std;int main()
{
o...
分类:
其他 时间:
2015-03-24 23:12:47
收藏:
0 评论:
0 赞:
0 阅读:
293
题意: n个雷,分别在a[1]...a[n] ,走一步概率为 p ,走两步概率为 1-p ,一开始在 1 号位置,问安全到达终点的概率。
思路:
将整个过程划分成阶段处理:
1 ~ a[1]
a[1]+1 ~ a[2]
…………
a[n-1]+1 ~ a[n]
那么只要求出每次踩到雷的概率,求反面,再把所有阶段结果连乘就可以了。
ans[i]表示踩中i的概率,那么可推倒出 ans[...
分类:
其他 时间:
2015-03-24 23:12:28
收藏:
0 评论:
0 赞:
0 阅读:
367
uva 620 Cellular StructureA chain of connected cells of two types A and B composes a cellular structure of some microorganisms of species APUDOTDLS.If no mutation had happened during growth of an organ...
分类:
其他 时间:
2015-03-24 23:12:17
收藏:
0 评论:
0 赞:
0 阅读:
301
Description小 X 自幼就很喜欢数。但奇怪的是,他十分讨厌完全平方数。他觉得这些
数看起来很令人难受。由此,他也讨厌所有是完全平方数的正整数倍的数。然而
这丝毫不影响他对其他数的热爱。
这天是小X的生日,小 W 想送一个数给他作为生日礼物。当然他不能送一
个小X讨厌的数。他列出了所有小X不讨厌的数,然后选取了第 K个数送给了
小X。小X很开心地收下了。
然而现在小 W 却记不起...
分类:
其他 时间:
2015-03-24 23:11:48
收藏:
0 评论:
0 赞:
0 阅读:
626
//---------------------------15/03/24----------------------------
//hashtable
{
/*
概述:
sgi采用的是开链法完成hashtable的,也就是用链表来存储映射到相同位置的元素。
*/
//node...
分类:
其他 时间:
2015-03-24 23:11:38
收藏:
0 评论:
0 赞:
0 阅读:
268
题意:
k个数组,每个数字k个值;
如果每个数组取一个值相加,那么总共有k^k种结果,取前k小的值,输出;
思路:
首先我们两个数组,两个数组找出前k小的和了,在加入第三个,这样一直两两算;
因为两个数组取出前k小的和了;那么加入第三个数组后,那么新的前k小肯定是第三个数组的值和那之前前k的值的和;
而求两个数组,和的前k小,我们可以用优先队列,加上一个动态规划;
只有AB两...
分类:
其他 时间:
2015-03-24 23:11:27
收藏:
0 评论:
0 赞:
0 阅读:
344
描述
有N个位置,M个操作。操作有两种,每次操作如果是1 a b c的形式表示在第a个位置到第b个位置,每个位置加入一个数c
如果是2 a b c形式,表示询问从第a个位置到第b个位置,第C大的数是多少。
分析
今天终于看懂了一个整体二分的题目. 发现这真是一种很BT的做法.二分答案区间(L, R), 判断中间值M = L+(R-L)/2. 每次清空线段树(直接在根节点...
分类:
其他 时间:
2015-03-24 23:11:17
收藏:
0 评论:
0 赞:
0 阅读:
469
在esxi5(版本是5.0)的机器上加了1块500G西数企业级硬盘,原来在Win2008下使用过。
添加存储时,报错误:
esxi在x.x.x.x上调用对象 “ha-datastoresystem”的“HostDatastoreSystem.QueryVmfsDatastoreCreateOptions”
到 配置->安全配置文件里 启用ssh服务。
结果fdisk -l命令不能用,提示:...
分类:
其他 时间:
2015-03-24 23:10:47
收藏:
0 评论:
0 赞:
0 阅读:
417
题目大意:。。。不是很好叙述自己看吧。注意要剪掉初始就能到达所有终点的点的数量
http://blog.163.com/c_sunshine/blog/static/2439650542015028013488/
OTZ 这做法实在是太优雅了!
#include
#include
#include
#include
#define M 100100
using namespace...
分类:
其他 时间:
2015-03-24 23:10:37
收藏:
0 评论:
0 赞:
0 阅读:
390
There are n walruses standing in a queue in an airport. They are numbered starting from the queue’s tail: the 1-st walrus stands at the end of the queue and the n-th walrus stands at the beginning of t...
分类:
其他 时间:
2015-03-24 23:10:28
收藏:
0 评论:
0 赞:
0 阅读:
326
介绍俄罗斯方块(Tetris, 俄文:Тетрис)是一款电视游戏机和掌上游戏机游戏,它由俄罗斯人阿列克谢·帕基特诺夫发明,故得此名。俄罗斯方块的基本规则是移动、旋转和摆放游戏自动输出的各种方块,使之排列成完整的一行或多行并且消除得分。由于上手简单、老少皆宜,从而家喻户晓,风靡世界。源码#include
#include
#include <stdlib.h...
分类:
其他 时间:
2015-03-24 23:10:18
收藏:
0 评论:
0 赞:
2 阅读:
759
题目大意:给定一个无向图,求能否找到一个点和边的匹配,使匹配数为点数。
我又一次被并查集虐傻了。。。。
http://blog.csdn.net/popoqqq/article/details/41544997
很好奇自信Dinic的话O(40W*√10W)的复杂度会不会T
估计会。。。
#include
#include
#include
#include
#define ...
分类:
其他 时间:
2015-03-24 23:10:07
收藏:
0 评论:
0 赞:
0 阅读:
350
1639. Chocolate 2
Time limit: 1.0 second
Memory limit: 64 MB
Little Boy is mad at Karlsson, who ate all the sweets in the flat and even went to the neighbours to eat their sweets too. Now L...
分类:
其他 时间:
2015-03-24 23:09:47
收藏:
0 评论:
0 赞:
0 阅读:
366
2333、...
分类:
其他 时间:
2015-03-24 23:09:27
收藏:
0 评论:
0 赞:
0 阅读:
349