上一页 1 ··· 7 8 9 10 11 12 13 14 15 ··· 30 下一页
摘要: STL: 队列中pop完成的不是取出最顶端的元素,而是取出最低端的元素.也就是说最初放入的元素能够最先被取出(这种行为被叫做FIFO:First In First Out,即先进先出). queue:front 是用来访问最底端数据的函数. 1 #include <queue> 2 #include 阅读全文
posted @ 2016-02-27 12:09 Vmetrio 阅读(209) 评论(0) 推荐(0)
摘要: STL: pop:完成的仅仅是移除最顶端的数据.如果访问最顶端的数据,需要使用top函数(这个操作通常也被称为peek). 1 #include <stack> 2 #include <cstdio> 3 uisng namespace std; 4 5 int main() 6 { 7 stack 阅读全文
posted @ 2016-02-27 12:05 Vmetrio 阅读(161) 评论(0) 推荐(0)
摘要: 问题:将写有数字的N个纸片放入口袋中,你可以从口袋中抽取4次纸片,每次记下纸片上的数字后都将其放回口袋中.如果这4个数字的和是M,就是你赢,否则就是你的朋友赢. 很容易就可以写出下边的代码: 1 for(int a=0; a<n; a++){ 2 for(int b=0; b<n; b++){ 3 阅读全文
posted @ 2016-02-26 21:02 Vmetrio 阅读(902) 评论(0) 推荐(0)
摘要: 题目描述 You have just moved from Waterloo to a big city. The people here speak an incomprehensible dialect of a foreign language. Fortunately, you have a 阅读全文
posted @ 2016-02-16 17:52 Vmetrio 阅读(235) 评论(0) 推荐(0)
摘要: 来自:http://blog.csdn.net/tigerjibo/article/details/6442151 sscanf 名称: sscanf() - 从一个字符串中读进与指定格式相符的数据. 函数原型: int sscanf( const char *, const char *, ... 阅读全文
posted @ 2016-02-16 17:44 Vmetrio 阅读(232) 评论(0) 推荐(0)
摘要: 题目描述 The binary weight of a positive integer is the number of 1's in its binary representation.for example,the decmial number 1 has a binary weight of 阅读全文
posted @ 2016-02-09 11:44 Vmetrio 阅读(271) 评论(0) 推荐(0)
摘要: 学习链接:http://www.ihypo.net/1554.htmlhttps://www.slyar.com/blog/depth-first-search-even-odd-pruning.htmlhttp://blog.csdn.net/chyshnu/article/details/617... 阅读全文
posted @ 2016-01-04 15:57 Vmetrio 阅读(280) 评论(0) 推荐(0)
摘要: Description在一个给定形状的棋盘(形状可能是不规则的)上面摆放棋子,棋子没有区别。要求摆放时任意的两个棋子不能放在棋盘中的同一行或者同一列,请编程求解对于给定形状和大小的棋盘,摆放k个棋子的所有可行的摆放方案C。Input输入含有多组测试数据。每组数据的第一行是两个正整数,n k,用一个空... 阅读全文
posted @ 2015-12-31 19:45 Vmetrio 阅读(114) 评论(0) 推荐(0)
摘要: 题目描述给定一个正整数k(3≤k≤15),把所有k的方幂及所有有限个互不相等的k的方幂之和构成一个递增的序列,例如,当k=3时,这个序列是:1,3,4,9,10,12,13,…(该序列实际上就是:3^0,3^1,3^0+3^1,3^2,3^0+3^2,3^1+3^2,3^0+3^1+3^2,…)请你... 阅读全文
posted @ 2015-12-31 15:14 Vmetrio 阅读(185) 评论(0) 推荐(0)
摘要: 题目描述Jam是个喜欢标新立异的科学怪人。他不使用阿拉伯数字计数,而是使用小写英文字母计数,他觉得这样做,会使世界更加丰富多彩。在他的计数法中,每个数字的位数都是相同的(使用相同个数的字母),英文字母按原先的顺序,排在前面的字母小于排在它后面的字母。我们把这样的“数字”称为Jam数字。在Jam数字中... 阅读全文
posted @ 2015-12-30 10:39 Vmetrio 阅读(294) 评论(0) 推荐(0)
上一页 1 ··· 7 8 9 10 11 12 13 14 15 ··· 30 下一页