摘要: Problem DescriptionMirko doesn’t like Latin homeworks so he made a bet with Slavko. Loser will be writing homeworks for both of them the entire month. Mirko wants to win so he designed this problem they could have something to bet on.At his desk he found a cube, with numbers 1 to 6 on its faces. Cub 阅读全文
posted @ 2013-08-07 11:24 forevermemory 阅读(193) 评论(0) 推荐(0) 编辑
摘要: Problem Description地理学家们经常要对一段河流进行测量分析。他们从上游开始向下游方向等距离地选择了n(int dp[30005][101];int a[30005];int main(){ int i,n,test,j,k,x,ma; scanf("%d",&test); while(test--) { scanf("%d%d",&n,&k); for(i=0;i=0&&xma) ma=dp[i][j]; } } printf("%d\n",ma); } retu... 阅读全文
posted @ 2013-08-07 11:05 forevermemory 阅读(198) 评论(0) 推荐(0) 编辑
摘要: Problem Description在N*N的方格棋盘放置了N个皇后,使得它们不相互攻击(即任意2个皇后不允许处在同一排,同一列,也不允许处在与棋盘边框成45角的斜线上。你的任务是,对于给定的N,求出有多少种合法的放置方法。Input共有若干行,每行一个正整数N#include#includeint n;int cnt;int arr[15];bool is(int s){ int i; for(i=0;i=n) { cnt++; return; } for(i=0;i<n;i++) { arr[k]=i; ... 阅读全文
posted @ 2013-08-07 09:16 forevermemory 阅读(187) 评论(1) 推荐(0) 编辑