恒邪

上一页 1 2 3 4 5 6 ··· 13 下一页

2014年4月29日 #

组合数学笔记

摘要: 组合数学、-排列组合数----sum求sum=sum*(m--)/i;----二维数组递推(打表)---原始公式(单个)数字太大,用分子分母约分-全排列模板-----生成全排列函数prev_permutation和next_permutation区别http://www.cnblogs.com/zh... 阅读全文

posted @ 2014-04-29 10:27 恒邪 阅读(183) 评论(0) 推荐(0) 编辑

2014年4月28日 #

[ACM] poj 2456 Aggressive cows (二分查找)

摘要: Aggressive cowsTime Limit: 1000MSMemory Limit: 65536KTotal Submissions: 5436Accepted: 2720DescriptionFarmer John has built a new long barn, with N (2 #include #include using namespace std;const int maxn=100002;const int inf=0x7fffffff;int x[maxn];int n,c;bool ok(int m){ int last=0; for(int i=1... 阅读全文

posted @ 2014-04-28 20:47 恒邪 阅读(190) 评论(0) 推荐(0) 编辑

[ACM] poj 1064 Cable master (二分查找)

摘要: Cable masterTime Limit: 1000MSMemory Limit: 10000KTotal Submissions: 21071Accepted: 4542DescriptionInhabitants of the Wonderland have decided to hold a regional programming contest. The Judging Committee has volunteered and has promised to organize the most honest contest ever. It was decided to con 阅读全文

posted @ 2014-04-28 19:31 恒邪 阅读(169) 评论(0) 推荐(0) 编辑

[ACM] hdu 1025 Constructing Roads In JGShining's Kingdom (最长递增子序列,lower_bound使用)

摘要: Constructing Roads In JGShining's KingdomTime Limit: 2000/1000 MS (Java/Others)Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 14635Accepted Submission(s): 4158Problem DescriptionJGShining's kingdom consists of 2n(n is no more than 500,000) small cities which are located in two 阅读全文

posted @ 2014-04-28 16:36 恒邪 阅读(155) 评论(0) 推荐(0) 编辑

[2012山东ACM省赛] Pick apples (贪心,完全背包,枚举)

摘要: Pick applesTime Limit: 1000MS Memory limit: 165536K题目描述Once ago, there is a mystery yard which only produces three kinds of apples. The number of each kind is infinite. A girl carrying a big bag comes into the yard. She is so surprised because she has never seen so many apples before. Each kind of a 阅读全文

posted @ 2014-04-28 14:13 恒邪 阅读(203) 评论(0) 推荐(0) 编辑

Mine Number(搜索,暴力) ACM省赛第三届 G

摘要: Mine NumberTime Limit: 1000ms Memory limit: 65536K有疑问?点这里^_^题目描述Every one once played the game called Mine Sweeping, here I change the rule. You are g... 阅读全文

posted @ 2014-04-28 11:07 恒邪 阅读(265) 评论(0) 推荐(0) 编辑

2014年4月27日 #

sscanf函数用法详解

摘要: sscanf() - 从一个字符串中读进与指定格式相符的数据. 函数原型: Int sscanf( string str, string fmt, mixed var1, mixed var2 ... ); int scanf( const char *format [,argument]... ); 说明: sscanf与scanf类似,都是用于输入的,只是后者以屏幕(stdin)为输入源,前者以固定字符串为输入源。 其中的format可以是一个或多个 {%[*] [width] [{h | l | I64 | L}]type | ' ' | '\t' | & 阅读全文

posted @ 2014-04-27 19:30 恒邪 阅读(170) 评论(0) 推荐(0) 编辑

2014年4月26日 #

[数据结构] 迷宫问题(栈和队列,深搜和广搜)

摘要: 代码:#include #include #include #include #include using namespace std;int dx[4]={0,-1,1,0};//方向int dy[4]={-1,0,0,1};bool vis[6][6];int total=0;//多少可到达路径int sx=1,sy=1;//入口出口坐标int ex=4,ey=4;int num[10][10];//广搜时记录到达当前点的最少步数struct P{ int x,y;}point[40];//用来记录可到达路径struct PP{ int fx,fy;}path[10][10];... 阅读全文

posted @ 2014-04-26 12:55 恒邪 阅读(412) 评论(0) 推荐(0) 编辑

[数据结构] N皇后问题

摘要: 代码:#include #include #include using namespace std;const int N=100;int c[N];//皇后第i行放在第几列上int n,total;int cc;//方法数void dfs(int cur){ if(cur>n) { cout>n; if(n<=0) { cout<<"输入不合法,程序退出!"<<endl; break; } cc=1; total=0; dfs(1); ... 阅读全文

posted @ 2014-04-26 12:52 恒邪 阅读(302) 评论(0) 推荐(0) 编辑

2014年4月24日 #

[2011山东ACM省赛] Sequence (动态规划)

摘要: SequenceTime Limit: 1000ms Memory limit: 65536K有疑问?点这里^_^题目描述Given an integer number sequence A of length N (1#include #include using namespace std;const int maxn=1010;int num[maxn];long long sum[maxn];long long dp[maxn];int min(int a,int b){ return a>b?b:a;}int main(){ int t;cin>>t; int n, 阅读全文

posted @ 2014-04-24 17:12 恒邪 阅读(163) 评论(0) 推荐(0) 编辑

上一页 1 2 3 4 5 6 ··· 13 下一页

导航