Difference Between Primes
Time Limit:1000MS Memory Limit:32768KB 64bit IO Format:%I64d & %I64u
Description
All you know Goldbach conjecture.That is to say, Every even integer greate...
分类:
其他好文 时间:
2014-08-09 18:54:18
阅读次数:
272
#include#include#includeusing namespace std;int main(){ ///map插入 map mp; /// mp["a"]=1; mp["b"]=2; mp["c"]=3; map::iterator it; for(it=mp.begin(); it!...
分类:
其他好文 时间:
2014-08-09 18:36:38
阅读次数:
148
很简单的一个,就是总超时。问题出在我使用的短平快,简单直接的方式已经不灵了。 这种情况我总结以下原因: 1.尽量用STL模板容器,qsort()等内置,他们优化得很好 2.不用的话需要了解哈希算法。 本题用了快排与哈希,自己写也行(麻烦),不写的话用qsort与STL map,否则超时。...
分类:
其他好文 时间:
2014-08-09 18:16:48
阅读次数:
229
最近闲来无事,整理了一下spring springMVC mybatis 集成,关于这个话题在园子里已经有很多人写过了,我主要是想提供一个完整的demo,涵盖crud,事物控制等。 整个demo分三个层次: 一、简单模式:整个框架的参数传递不使用实体对象,统一用Map来存储变量,对myb...
分类:
编程语言 时间:
2014-08-09 13:22:37
阅读次数:
371
对STL的优先队列,map,set的小总结,望指正。...
分类:
其他好文 时间:
2014-08-09 11:44:57
阅读次数:
269
题意:不解释。
策略:如题;
这道题可以用深搜也可以用广搜,我以前写的是用的深搜,最近在学广搜,就拿这道题来练练手。
代码:
#include
#include
#include
using std::queue;
bool vis[20][20];
const int dir[4][2] = {1, 0, -1, 0, 0, 1, 0, -1};//四个方向
int map[9][9]...
分类:
其他好文 时间:
2014-08-09 11:38:27
阅读次数:
155
// 简单 bfs#include #includeusing namespace std;char map[110][110];int flag[110][110];int qu[11000][2],qe,qs,m,n;int add[8][2]={-1,-1, -1,0, -1,1, 0,-1,...
分类:
其他好文 时间:
2014-08-09 11:32:47
阅读次数:
227
# include # include using namespace std;int main(){ int n,m,i,sum,cot,flag,j; int map[80040]; int a[40010]; int ans1; int ans2; while(~scanf("%d%d",&n...
分类:
其他好文 时间:
2014-08-09 11:12:47
阅读次数:
245
Here I share with you a demo for python map, reduce and filter functional programming that
owned by me(Xiaoqiang).
I assume there are two DB tables, that `file_logs` and `expanded_attrs` which re...
分类:
编程语言 时间:
2014-08-09 04:57:17
阅读次数:
525
1.聚合:最终为大家共享组合:最终为一体2.如何编写可移植的php代码:将所有设置和PHP常量放在一个文件中,这样可以从如何函数或类使用它们。考虑使用XML文件或是将这些信息存到数据库,注意parse_ini_file函数关闭magic_quotesif(get_magic_quotes_gpc()){$_GET=array_map(‘st..
分类:
Web程序 时间:
2014-08-09 02:46:47
阅读次数:
375