08 2018 档案
摘要:1 头文件 #include<vector> 2 定义 vector<int>vec; //定义一个int型向量 向量的意思就是一开始没有长度限制 vector<int>vec(10); //初始大小为10,这样就可以用数组的方式访问或者修改里面的值了。 vector<int>vec(10,1);
阅读全文
摘要:string基操: #include<string> string a; cin>>a; 长度的获取: a.size(); 获得第一个字符: string:const_iterator it=s.begin(); count<<*it<<endl; 获得最后一个字符: string:const_it
阅读全文
摘要:1267 4个数和为0 基准时间限制:1 秒 空间限制:131072 KB 分值: 20 难度:3级算法题 收藏 关注 1267 4个数和为0 基准时间限制:1 秒 空间限制:131072 KB 分值: 20 难度:3级算法题 1267 4个数和为0 基准时间限制:1 秒 空间限制:131072 K
阅读全文
摘要:http://acm.sdibt.edu.cn/vjudge/contest/view.action?cid=1977#problem/A 广搜: e2 e4a1 b2b2 c3a1 h8a1 h7h8 a1b1 c3f6 f6 在一个8*8的棋盘中,a1代表第零行的第一个元素,每个棋子只能像象棋中
阅读全文
摘要:POJ 3061: For each the case the program has to print the result on separate line of the output file.if no answer, print 0. Sample Input Sample Output
阅读全文
摘要:三大博弈(+斐波那契博弈) 巴什博弈: 只有一堆n个物品,两个人轮流从这堆物品中取物, 规定每次至少取一个,最多取m个。最后取光者得胜。如果n=m+1,那么由于一次最多只能取m个,所以,无论先取者拿走多少个,后取者都能够一次拿走剩余的物品,后者取胜。 只要保持给对手留下(m+1)的倍数,就能最后获胜
阅读全文
摘要:You have a fraction . You need to find the first occurrence of digit c into decimal notation of the fraction after decimal point. The first contains t
阅读全文
摘要:Katya studies in a fifth grade. Recently her class studied right triangles and the Pythagorean theorem. It appeared, that there are triples of positiv
阅读全文
摘要:You are given two strings s and t, both consisting only of lowercase Latin letters.The substring s[l..r]is the string which is obtained by taking char
阅读全文
摘要:Natasha is planning an expedition to Mars for n people. One of the important tasks is to provide food for each participant. The warehouse has m daily
阅读全文
摘要:codeforces 910c 转自两位大佬:http://www.cnblogs.com/wkfvawl/p/9387634.html https://i.cnblogs.com/EditPosts.aspx?opt=1 You are given an array a consisting of
阅读全文
摘要:codeforces 1003d n个硬币,q次询问。第二行给你n个硬币的面值(保证都是2的次幂!)。每次询问组成b块钱,最少需要多少个硬币? Example Input 5 42 4 8 2 4851410 Input Output 反向迭代器的rbegin和rend的位置 和正向迭代器的begi
阅读全文
摘要:1.使用string.h中的strrev函数 2.使用algorithm中的reverse函数 1.strrev函数只对字符数组有效,对string类型是无效的。 2.reverse函数是反转容器中的内容,对字符数组无效。
阅读全文

浙公网安备 33010602011771号