首页 > 其他
并发服务器的设计
/* tcp_server.c */ #include #include #include #include #define portnum 3333 int main() { int sockfd,newfd; struct sockaddr_in server_addr; struct sockaddr_in client_addr; char buffer[128]; ...
分类:其他   时间:2015-05-09 10:19:08    收藏:0  评论:0  赞:0  阅读:227
Uva 10815 Andy's First Dictionary
Andy's First Dictionary Time Limit: 3000MS   Memory Limit: Unknown   64bit IO Format: %lld & %llu Submit Status Description Problem B: Andy's First Dictio...
分类:其他   时间:2015-05-09 10:18:48    收藏:0  评论:0  赞:0  阅读:189
poj 1611 The Suspects(并查集)
The Suspects Time Limit: 1000MS   Memory Limit: 20000K Total Submissions: 24970   Accepted: 12250 Description Severe acute respiratory syndrome (SARS), an atypical pneumoni...
分类:其他   时间:2015-05-09 10:18:28    收藏:0  评论:0  赞:0  阅读:191
UVa10900 - So you want to be a 2n-aire? (期望)
我们不妨设a[i]表示正确做完第i道题的收益的期望,显然我们最后要求的就是a[0]咯,但这个先放一放,我们先讨论一下在做第i+1个题目前我们是选择答题呢还是选择放弃呢。     首先,我们可以直观的想到,如果做完i题就退出的话,就可以得到2^i这么多钱。不妨假设答对第i+1个题的概率为p,那么我们自然会想到用p乘以“某个值”表示答题所获得的收益的期望,如果p乘以这个值大于2^i的话,我们肯定...
分类:其他   时间:2015-05-09 10:18:08    收藏:0  评论:0  赞:0  阅读:269
POJ 2151 Check the difficulty of problems
题目链接:POJ 2151 Check the difficulty of problems 题面: Check the difficulty of problems Time Limit: 2000MS   Memory Limit: 65536K Total Submissions: 5519   Accepted: 2431 ...
分类:其他   时间:2015-05-09 10:17:58    收藏:0  评论:0  赞:0  阅读:175
UVa694 - The Collatz Sequence(模拟)
Step1: 任选一个正整数A作为这个数列的第一项。 Step2: 如果A=1则停止。 Step3: 如果A为偶数,则A=A/2然后重新回到Step2。 Step4: 如果A为奇数,则A=3*A+1然后重新回到Step2。 这个演算法已经被证明当首项小于等于109时这个数列最终都会在Step2停止,但是有些A值在这个数列中会超出许多电脑的整数上限。在这个问题中我们想??要计算这个数...
分类:其他   时间:2015-05-09 10:17:38    收藏:0  评论:0  赞:0  阅读:216
NS2网络仿真的过程
NS2网络仿真的过程可以总结为: 1、初始化     创建ns simulator     创建.tr文件(记录仿真结果)     创建.nam文件(记录仿真过程)     设置结束函数     设置仿真中所需的参数 2、创建仿真拓扑     创建节点     创建并设置链路     设置链路各链路在nam中的排列方式 3、创建流量     探测流量:向网络中添加的额外流量...
分类:其他   时间:2015-05-09 10:17:29    收藏:0  评论:0  赞:0  阅读:181
错误使用strlen() 出现的结果……
既然下定决心,就要持之以恒!C Primer Plus 这仅仅只是开始……2015.5.9...
分类:其他   时间:2015-05-09 10:17:18    收藏:0  评论:0  赞:0  阅读:187
解题报告 之 SOJ1678 Mountains
SOJ1678, Mountains,数论,递推,二分 A mountain consists of one or more hills, each of which consists of upwards, which we denote with `/', and downwards, which we denote with '\'. We call upwards and downwards together as wards. Let /n be an upward of length n, an...
分类:其他   时间:2015-05-09 10:17:08    收藏:0  评论:0  赞:0  阅读:141
解题报告 之 SOJ2714 Mountains(II)
SOJ1678, Mountains,数论,递推,二分 A mountain consists of one or more hills, each of which consists of upwards, which we denote with `/', and downwards, which we denote with '\'. We call upwards and downwards together as wards. Let /n be an upward of length n, an...
分类:其他   时间:2015-05-09 10:16:58    收藏:0  评论:0  赞:0  阅读:178
解题报告 之 SOJ2668 C(n,k)
SOJ2668 ,C(n,k),素数的性质,数论 组合数奇偶性 求组合数 C ( n , k) 的奇偶性...
分类:其他   时间:2015-05-09 10:16:48    收藏:0  评论:0  赞:0  阅读:192
解题报告 之 SOJ2666 分解 n!
SOJ2666 分解 n!,数论,素数,ACM 给你一个数 n (1 < n <= 1000000) ,求 n! (n的阶乘)的质因数分解形式,质因数分解形式为 n=p1^m1*p2^m2*p3^m3…… * 这里 p1 < p2 < p3 < …… 为质数 * 如果 mi = 1, 则 ^ mi 就不需要输出...
分类:其他   时间:2015-05-09 10:16:38    收藏:0  评论:0  赞:0  阅读:240
AFN使用介绍
前三节,我详细的介绍了ASI的概念及基本使用。如果想了解的,请点击这里。由于AFN与ASI有很多相似的地方,所以我打算用一节的篇幅来介绍AFN。下载地址: https://github.com/AFNetworking/AFNetworking AFN即AFNetworiking,AFN的主要结构如下: 1 : AFHTTPClient  提供了一个方便的网络交互接口,包括默认头,身份验证,...
分类:其他   时间:2015-05-09 10:16:18    收藏:0  评论:0  赞:0  阅读:479
shiro的一点记录(二)
这次主要写shiro的exception定制,RememberMe和SSL。  Exception页面定制 不知道这个属不属于shiro自身的范畴,反正这里用到了,就写上吧,主要是这些Exception都是shiro里面的,所以就在这里写上吧。根据资料显示,要定制错误页面,需要在springMVC配置文件里面配置相应的控制器异常处理。例如: 不知道咋回事,...
分类:其他   时间:2015-05-09 10:16:08    收藏:0  评论:0  赞:0  阅读:151
LeetCode Implement Trie (Prefix Tree)
题目 思路 直接前缀树。代码struct TrieNode { char c; struct TrieNode * son[27]; // sons for "abcdefghijklmnopqrstuvwxyz\0" };struct TrieNode * trieCreate() { struct TrieNode * trieNode = (struct Trie...
分类:其他   时间:2015-05-09 10:15:39    收藏:0  评论:0  赞:0  阅读:216
获取文章中的关键字
最近,在做关于搜索方面的程序,查阅了许多了资料,写下了下面的代码,已作为后备 首先所需要的jar包:lucene-core-3.6.2.jar,lucene-memory-3.6.2.jar,lucene-highlighter-3.6.2.jar,lucene-analyzers-3.6.2.jarIKAnalyzer2012.jar 下载地址:http://download....
分类:其他   时间:2015-05-09 10:15:18    收藏:0  评论:0  赞:0  阅读:314
Generate Parentheses——解题报告
【题目】     Given n pairs of parentheses, write a function to generate all combinations of well-formed parentheses. For example, given n = 3, a solution set is: "((()))", "(()())", "(())()", "()((...
分类:其他   时间:2015-05-09 10:15:08    收藏:0  评论:0  赞:0  阅读:174
Struts2入门篇-- 用户登录
?? 众所周知,Struts2是一款优秀的Java MVC框架,由控制器决定展现那个视图给用户。从开发者角度来认识一个框架,第一步是能快速搭建一个基于该框架的应用或demo,在会使用的基础上进一步了解其实现原理更有助于运用。 关于Struts2实现原理,以后会详细阐述,我们先来做一个小小实验,也就是在Web 应用中最常见的用户登录。 1. 配置Web.xml 在Web.xml中加上如下内容...
分类:其他   时间:2015-05-09 10:14:58    收藏:0  评论:0  赞:0  阅读:198
最大递减数
#include "Degressive.h" #include #include //给出一个非负整数,找到这个非负整数中包含的最大递减数。一个数字的递减数是指相邻的数位从大到小排列的数字。 //如: 95345323,递减数有:953,95,53,53,532,32, 那么最大的递减数为953。 //如果输入的数字为负数,返回-1。 int getMax...
分类:其他   时间:2015-05-09 10:14:48    收藏:0  评论:0  赞:0  阅读:320
poj 杂题 - 2231 Moo Volume
一开始以为是long long输入,后来发现用int就行,,,反正也是一个挺简单的题目,直接贴代码了。 #include #include int cows[10005]={0}; int main(){ int n,i,j; long long res = 0,temp; scanf("%d",&n); for(i=1;i<=n;i++) { scanf("%d",&cows[i...
分类:其他   时间:2015-05-09 10:14:28    收藏:0  评论:0  赞:0  阅读:117
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!