摘要: #include #include #include using namespace std; int f(int x,int n) { int now=1; while(n) { if(n&1) { now=now*x; } x=x*x; n>>=1; } ... 阅读全文
posted @ 2017-04-07 21:26 zzzzx 阅读(122) 评论(0) 推荐(0) 编辑
摘要: - 迷 宫 (maze.cpp/c/pas) Description Karles 和朋友到迷宫玩耍,没想到遇上了 10000000 年一次的大洪水,好在 Karles 是一个喜 欢思考的人,他发现迷宫的地形和洪水有如下性质: ①迷宫可以被看做是一个 N*M 的矩形方阵,其中左上角坐标为(1,1), 阅读全文
posted @ 2017-04-07 19:34 zzzzx 阅读(242) 评论(0) 推荐(0) 编辑
摘要: Xxy 的车厢调度(train.cpp/c/pas)Description有 一 个 火 车 站 , 铁 路 如 图 所 示 ,每辆火车从 A 驶入,再从 B 方向驶出,同时它的车厢可以重新组合。假设从 A 方向驶来的火车有 n 节(n<=1000) ,分别按照顺序编号为 1,2,3,…,n。假定在 阅读全文
posted @ 2017-04-07 19:11 zzzzx 阅读(262) 评论(0) 推荐(0) 编辑