#includeusing namespace std;int main(){ int num=0; for(int i=0;i<4000;i++){ int j=i; while(j){ if(j%10==1) { num++; break; } else j=j...
分类:
其他好文 时间:
2014-11-21 01:20:02
阅读次数:
221
Run AwayTime Limit:3000MSMemory Limit:65536KTotal Submissions:6482Accepted:1993DescriptionOne of the traps we will encounter in the Pyramid is located...
分类:
其他好文 时间:
2014-11-21 01:19:51
阅读次数:
287
题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=2035解题思路:这一题数据不大,可以用同余来做,也可以用快速幂来做反思:定义成#includeint quick_mod(int a,int b,int m){ int ans=1; w...
分类:
其他好文 时间:
2014-11-21 01:19:47
阅读次数:
216
题目大意: 输入一个矩阵,再输入其中一个“X”的位置(从1开始)。从该位置向八个方向扩展,如果是“X”就可以并在一起。问最后得到的模块的周长是多少。解题思路: 按照广搜的思路来做。用一个二维的数组标记每一个点,-1代表着该点不能被搜索了(可能原本就是“.”,也可以该点已经出队列了);0代表着该点.....
分类:
其他好文 时间:
2014-11-21 01:18:57
阅读次数:
224
Given a set of distinct integers,S, return all possible subsets.Note:Elements in a subset must be in non-descending order.The solution set must not co...
分类:
其他好文 时间:
2014-11-21 01:17:47
阅读次数:
293
Given a linked list, determine if it has a cycle in it.Follow up:Can you solve it without using extra space?这道题用来判断链表中是否有循环,最开始我想的是遍历链表,同时用一个list保存遍历过...
分类:
其他好文 时间:
2014-11-21 01:18:32
阅读次数:
203
将一个单词按照这种方式分:Below is one possible representation ofs1="great": great / \ gr eat / \ / \g r e at / \ a tTo s...
分类:
其他好文 时间:
2014-11-21 01:17:32
阅读次数:
249
Given a collection of numbers, return all possible permutations. For example,[1,2,3] have the following permutations:[1,2,3], [1,3,2], [2,1,3], [2,3,1...
分类:
其他好文 时间:
2014-11-21 01:19:50
阅读次数:
189
在Android中,某些事件触发,Activity会重新调用onCreate方法对Activity重新初始化,这样不仅效率低,而且会造成数据丢失,通过重写onConfigurationChanged方法,并在AndroidManifest.xml中对Activity声明configChanges,这...
分类:
其他好文 时间:
2014-11-21 01:18:40
阅读次数:
209
原文链接在这篇文章中, 我将向大家介绍一种我认为比较合理的 Redis 源码阅读顺序, 希望可以给对 Redis 有兴趣并打算阅读 Redis 源码的朋友带来一点帮助。第 1 步:阅读数据结构实现刚开始阅读 Redis 源码的时候, 最好从数据结构的相关文件开始读起, 因为这些文件和 Redis 中...
分类:
其他好文 时间:
2014-11-21 01:18:12
阅读次数:
340
2DToolkit是一组与Unity环境无缝集成的工具,提供高效的2D精灵和文本系统。本篇文章为翻译的官方教程手册中的: Whack a Mode,第二部分:创建游戏对象之摄像机。
分类:
其他好文 时间:
2014-11-21 01:17:12
阅读次数:
276
虚拟机tomcat外部实体主机无法访问问题本地虚拟机启动后虚拟机内可以打开tomcat界面。返回到里头却无法访问。解决方案:1. 禁用防火墙(永久): chkconfig iptables off2. 停止防火墙(重启就会失效):service iptables stop在防火墙开启的情况下在ipt...
分类:
其他好文 时间:
2014-11-21 01:17:40
阅读次数:
355
/* 第20章 priority_queue优先队列容器 20.1 priority_queue技术原理 20.2 priority_queue应用基础 20.3 本章小结*/// 第20章 priority_queue优先队列容器// 20.1 priority_queue技术...
分类:
其他好文 时间:
2014-11-21 01:16:07
阅读次数:
178
set clock timezone 0set vrouter trust-vr sharableset vrouter "untrust-vr"exitset vrouter "trust-vr"unset auto-route-exportexitset service "RDP-8888" p...
分类:
其他好文 时间:
2014-11-21 01:16:46
阅读次数:
376
perl出现"Can't locate getopts.pl"的解决方法。这个错误是因为perl从5.16开始,移除了getopts.pl (http://search.cpan.org/~rjbs/perl-5.16.0/pod/perldelta.pod#Removed_Modules_and_...
分类:
其他好文 时间:
2014-11-21 01:15:04
阅读次数:
2194
因为在编程中,使用{}()[]等都是成对出现的,因此可以使用栈来进行一些匹配判断。原理:读取一段字符串,如果遇到{([这些开放字符,就将其压入栈中,如果读到})]这些封闭字符,就与当前栈顶的符号进行比较,如果栈顶的符号正好是其对应的开放符号,将栈顶元素弹出,继续读取。否则,出现警告。但是如果弹出栈顶...
分类:
其他好文 时间:
2014-11-21 01:15:15
阅读次数:
324
/* 第17章 string基本字符序列容器 17.1 string技术原理 17.2 string应用基础 17.3 本章小结*/// 第17章 string基本字符序列容器// 17.1 string技术原理 ---------------------------------...
分类:
其他好文 时间:
2014-11-21 01:15:11
阅读次数:
309