码迷,mamicode.com
首页 > 2015年08月15日 > 全部分享
hdu5375 Gray code
Problem Description The reflected binary code, also known as Gray code after Frank Gray, is a binary numeral system where two successive values differ in only onebit (binary digit). The reflected b...
分类:其他好文   时间:2015-08-15 18:26:59    阅读次数:127
poj3061(Subsequence)尺取法
Description A sequence of N positive integers (10 < N < 100 000), each of them less than or equal 10000, and a positive integer S (S < 100 000 000) are given. Write a program to find the minimal ...
分类:其他好文   时间:2015-08-15 18:27:35    阅读次数:153
编程马拉松:电话号码
题目描述 上图是一个电话的九宫格,如你所见一个数字对应一些字母,因此在国外企业喜欢把电话号码设计成与自己公司名字相对应。例如公司的Help Desk号码是4357,因为4对应H、3对应E、5对应L、7对应P,因此4357就是HELP。同理,TUT-GLOP就代表888-4567、310-GINO代表310-4466。 NowCoder刚进入外企,并不习惯这样的命名方式,现在给你一串电话号码...
分类:其他好文   时间:2015-08-15 18:26:38    阅读次数:190
C语言各类字符串函数的实现
C语言各类字符串函数的实现开学就要开始找工作了,我觉得这些函数被问到的几率还是很大的,所以在这里与大家分享strlen函数原型:#include unsigned int strlen (char *s);功能:计算指定的字符串s 的长度,不包括结束字符”\0”。我的实现:/****************************************************...
分类:编程语言   时间:2015-08-15 18:27:06    阅读次数:148
贪心算法之ian Ji -- The Horse Racing
Tian Ji -- The Horse Racing Description Here is a famousstory in Chinese history.  That was about2300 years ago. General Tian Ji was a high official in the country Qi. He likesto play horse racing ...
分类:编程语言   时间:2015-08-15 18:26:06    阅读次数:165
逆元小结
一、若a与n互素,那么可以用扩展欧几里德和欧拉函数求出a对于n的逆元。 ax≡1(mod n),x为a对于n的逆元。 用欧几里德求逆元x: //a与n互素,逆元才有解 #include #include using namespace std; typedef long long LL; void exgcd(LL a,LL b,LL &d,LL &x,LL &y) { if(!b)...
分类:其他好文   时间:2015-08-15 18:26:34    阅读次数:97
Android基础入门教程——4.2.2 Service进阶
Android基础入门教程——4.2.2 Service进阶 本节引言 1.IntentService的使用 2.Activity与Service通信 3.一个简单前台服务的实现 4.简单定时后台线程的实现 本节小结:...
分类:移动开发   时间:2015-08-15 18:26:01    阅读次数:141
hdu2814
链接:点击打开链接 题意:求出F(a^b)^(F(a^b)^(n-1))%c(F为斐波那契数的值) 代码:#include #include #include #include using namespace std; unsigned long long f[20005]; //注意要使用无符号形 unsigned long long phi(u...
分类:其他好文   时间:2015-08-15 18:24:34    阅读次数:102
VS快捷键
VS快捷键...
分类:其他好文   时间:2015-08-15 18:25:12    阅读次数:89
关于java环境配置(path和classpath的意义与比较)
java环境配置(我的jdk的安装目录为:C:\Program Files\Java\jdk1.7.0_79): 第一步:我们需要将jdk目录下bin目录中的所有exe文件的路径加载到path中,这样我们才可以在任意磁盘目录下使用java.exe和javac.exe工具编译运行java文件。 第一步的前期工作:为了更加方便对bin目录的加载,我们自己定义一个名为JAVA_HOM...
分类:编程语言   时间:2015-08-15 18:24:40    阅读次数:125
sscanf,snprintf,sprintf小结
一、sprintf sprint函数原型为 int sprintf(char *str, const char *format, ...)。作用是格式化字符串,具体功能如下所示: (1)将数字变量转换为字符串。 (2)得到整型变量的16进制和8进制字符串。 (3)连接多个字符串。 举例如下 char str[256] = { 0 }; int data = 1024; //将dat...
分类:其他好文   时间:2015-08-15 18:25:51    阅读次数:151
反转链表
题目 定义一个函数,输入一个链表的头结点,反转该链表并输出反转后链表的头结点.ListNode* ReverseList(ListNode* pHead) { if (pHead == NULL) return NULL; ListNode* pPrev = NULL; ListNode* pNode = pHead; while (...
分类:其他好文   时间:2015-08-15 18:23:22    阅读次数:101
poj3320(Jessica's Reading Problem)尺取法
Description Jessica's a very lovely girl wooed by lots of boys. Recently she has a problem. The final exam is coming, yet she has spent little time on it. If she wants to pass it, she has to mast...
分类:其他好文   时间:2015-08-15 18:26:09    阅读次数:115
Python 之 glob读取路径下所有文件夹或文件方法
在python中,glob模块是用来查找匹配的文件的     在查找的条件中,需要用到Unix shell中的匹配规则:        *    :   匹配所所有        ?    :   匹配一个字符        *.*  :   匹配如:[hello.txt,cat.xls,xxx234s.doc]        ?.*  :   匹配如:[1.txt,h.py]    ...
分类:编程语言   时间:2015-08-15 18:22:50    阅读次数:424
结构型模式之代理模式
代理模式(Proxy Pattern),也叫委托模式。英文定义为:Provide a surrogate or placeholder for another object to control access to it。中文解释为:为其他对象提供一种代理以控制对这个对象的访问。       代理模式的代码示例如下: /** * 抽象主题Subject类 * @author LYY...
分类:其他好文   时间:2015-08-15 18:22:58    阅读次数:126
struts2的工作流程和运行原理
先要参考srtuts的官方给出的图: 工作原理:                  1.(ActionContextCleanUp )首先客户端会发送一个请求,然后我们在web.xml配置中有一个strurts2的过滤器,在进入过滤器时,有这个ActionContextCleanUp filter进行处理,(因为struts2在开发中,容易引起众多类集合,而这些类集合并不能在使用完后...
分类:其他好文   时间:2015-08-15 18:23:09    阅读次数:143
POJ - 1679 - The Unique MST (次小生成树)
题目传送:The Unique MSTAC代码:#include #include #include #include #include #include #include #include #include #include #include...
分类:其他好文   时间:2015-08-15 18:23:26    阅读次数:114
1738条   上一页 1 ... 28 29 30 31 32 33 34 ... 103 下一页
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!