上一页 1 2 3 4 5 6 ··· 24 下一页
摘要: 代码:#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 同学少年 阅读(687) 评论(0) 推荐(0) 编辑
摘要: 代码:#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 同学少年 阅读(176) 评论(0) 推荐(0) 编辑
摘要: 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 同学少年 阅读(189) 评论(0) 推荐(0) 编辑
摘要: #include #include using namespace std;#define mod 100007int mi(int d,int n)//快速幂运算 思想 2的4次方可以 2的平方乘以2的平凡{ int ans=1; while(n) { if(n%2==1) ans=ans*d%mod;//这条语句肯定执行的 d=d*d%mod; n/=2; } return ans;}int main(){ cout<<mi(2,5)<<endl; return 0;} 阅读全文
posted @ 2014-04-24 17:10 同学少年 阅读(257) 评论(0) 推荐(0) 编辑
摘要: 括号匹配Time Limit : 2000/1000ms (Java/Other)Memory Limit : 32768/32768K (Java/Other)Total Submission(s) : 110Accepted Submission(s) : 46Font:Times New Roman|Verdana|GeorgiaFont Size:←→Problem Description描述 给你一个字符串,里面只包含"(",")","[","]"四种符号,请问你需要至少添加多少个括号才能使这些括号匹配起 阅读全文
posted @ 2014-04-22 20:44 同学少年 阅读(173) 评论(0) 推荐(0) 编辑
摘要: Brackets SequenceTime Limit: 1000MSMemory Limit: 65536KTotal Submissions: 23884Accepted: 6727Special JudgeDescriptionLet us define a regular brackets sequence in the following way:1. Empty sequence is a regular sequence. 2. If S is a regular sequence, then (S) and [S] are both regular sequences. 3. 阅读全文
posted @ 2014-04-22 20:39 同学少年 阅读(166) 评论(0) 推荐(0) 编辑
摘要: 时间过得真快,转眼间现在马上就到了毕业的时候了。大学四年的生活就这样在漫不经心中度过,在这四年里我留下了许多值得回忆的东西。参加acm的经历和体会和其他美好的经历一样,永远值得我回忆和珍惜。一个偶然,我报考了兰州大学计算机科学与技术系;又一个偶然,我开始了解acm,开始慢慢喜欢上acm。我相信这都不是偶然,或许是我们所说的缘分。2003年我从一个小县城来到兰州大学,那时我计算机几乎没有任何了解,也从来没有接触过计算机。现在我还清楚的记得大一时的上机课,我在internet explore的地址栏里面练习了三个小时的打字,为知道了如何实现大小写字母的转换而欣喜。回想起那时的自己真的感到很幼稚,但 阅读全文
posted @ 2014-04-22 12:06 同学少年 阅读(2384) 评论(0) 推荐(2) 编辑
摘要: CoinsTime Limit: 2000/1000 MS (Java/Others)Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 6347Accepted Submission(s): 2589Problem DescriptionWhuacmers use coins.They have coins of value A1,A2,A3...An Silverland dollar. One day Hibix opened purse and found there were some coins. He dec 阅读全文
posted @ 2014-04-22 11:28 同学少年 阅读(200) 评论(0) 推荐(0) 编辑
摘要: Problem Description急!灾区的食物依然短缺!为了挽救灾区同胞的生命,心系灾区同胞的你准备自己采购一些粮食支援灾区,现在假设你一共有资金n元,而市场有m种大米,每种大米都是袋装产品,其价格不等,并且只能整袋购买。请问:你用有限的资金最多能采购多少公斤粮食呢?后记:人生是一个充满了变数的生命过程,天灾、人祸、病痛是我们生命历程中不可预知的威胁。月有阴晴圆缺,人有旦夕祸福,未来对于我们而言是一个未知数。那么,我们要做的就应该是珍惜现在,感恩生活——感谢父母,他们给予我们生命,抚养我们成人;感谢老师,他们授给我们知识,教我们做人感谢朋友,他们让我们感受到世界的温暖;感谢对手,他们令我 阅读全文
posted @ 2014-04-22 11:24 同学少年 阅读(131) 评论(0) 推荐(0) 编辑
摘要: LeyniTime Limit: 3000 MSMemory Limit: 65536 KTotal Submit: 247(56 users)Total Accepted: 78(53 users)Rating:Special Judge:NoDescriptionLeyni被人掳走,身在水深火热之中...小奈叶为了拯救Leyni,独自一人前往森林深处从静竹手中夺回昏迷中的Leyni。历经千辛万苦,小奈叶救出了Leyni,但是静竹为此极为恼怒,决定对他们发起最强烈的进攻。不过小奈叶有一个叫做能量保护圈的道具,可以保护他们。这个保护圈由n个小的小护盾围成一圈,从1到n编号。当某一块小护盾受到攻 阅读全文
posted @ 2014-04-22 10:08 同学少年 阅读(175) 评论(0) 推荐(0) 编辑
上一页 1 2 3 4 5 6 ··· 24 下一页