上一页 1 ··· 5 6 7 8 9 10 11 下一页
摘要: Alice bought a lot of pairs of socks yesterday. But when she went home, she found that she has lost one of them. Each sock has a name which contains e 阅读全文
posted @ 2018-05-05 21:42 myyismyy 阅读(254) 评论(0) 推荐(0)
摘要: Problem Description Jack and Jill have decided to sell some of their Compact Discs, while they still have some value. They have decided to sell one of 阅读全文
posted @ 2018-05-05 21:15 myyismyy 阅读(309) 评论(0) 推荐(0)
摘要: 虽然不理解,死记硬背吧 阅读全文
posted @ 2018-05-04 17:45 myyismyy 阅读(165) 评论(0) 推荐(0)
摘要: Problem Description 给定K个整数的序列{ N1, N2, ..., NK },其任意连续子序列可表示为{ Ni, Ni+1, ..., Nj },其中 1 <= i <= j <= K。最大连续子序列是所有连续子序列中元素和最大的一个, 例如给定序列{ -2, 11, -4, 1 阅读全文
posted @ 2018-05-03 19:46 myyismyy 阅读(246) 评论(0) 推荐(0)
摘要: ForwardIter lower_bound(ForwardIter first, ForwardIter last,const _Tp& val)算法返回一个非递减序列[first, last)中的第一个大于等于值val的位置。 ForwardIter upper_bound(ForwardIt 阅读全文
posted @ 2018-05-02 20:54 myyismyy 阅读(145) 评论(0) 推荐(0)
摘要: int int Scan() { int res = 0, ch, flag = 0; if((ch = getchar()) == '-') //判断正负 flag = 1; else if(ch >= '0' && ch <= '9') //得到完整的数 res = ch - '0'; whil 阅读全文
posted @ 2018-05-02 13:36 myyismyy 阅读(138) 评论(0) 推荐(0)
摘要: 杨老师给同学们玩个游戏,要求使用乘法和减法来表示一个数,他给大家9张卡片,然后报出一个数字,要求大家用表达式的形式来表示出这个数100 可以表示为这样的形式:100 = 129*67-8543 , 还可以表示为:100 = 13*489-6257注意特征:表达式中,数字1~9分别出现且只出现一次(不 阅读全文
posted @ 2018-05-02 13:20 myyismyy 阅读(179) 评论(0) 推荐(0)
摘要: #include #include #include //sort函数、交并补函数 #include //求交并补使用到的迭代器 using namespace std; //打印容器vector void print_vector(vector v){ if(v.size()>0){ cout unique_element_in_vector(vector v... 阅读全文
posted @ 2018-04-23 20:33 myyismyy 阅读(7522) 评论(0) 推荐(0)
摘要: 典型的用空间换时间的方法 阅读全文
posted @ 2018-04-21 23:18 myyismyy 阅读(513) 评论(1) 推荐(1)
摘要: 第一种:使用string.h中的strrev函数 第二种:使用algorithm中的reverse函数 第三种:自己编写 阅读全文
posted @ 2018-04-04 16:56 myyismyy 阅读(7591) 评论(0) 推荐(0)
上一页 1 ··· 5 6 7 8 9 10 11 下一页