2012年8月20日

棋盘覆盖问题

摘要: 地址:http://acm.hunnu.edu.cn/online/?action=problem&id=10432&type=show题目在线:棋盘覆盖问题Time Limit: 1000ms, Special Time Limit:2500ms, Memory Limit:32768KBTotal submit users: 62, Accepted users: 26Problem 10432 : No special judgementProblem description在一个2k x 2k ( 即:2^k x 2^k )个方格组成的棋盘中,恰有一个方格与其他方格不同 阅读全文

posted @ 2012-08-20 21:07 mycapple 阅读(9116) 评论(1) 推荐(2) 编辑

NK 1437 校长杯

摘要: 地址:http://acm.nankai.edu.cn/p1437.html思路:http://wenku.baidu.com/view/a081ee49e45c3b3567ec8bf4.html 不太懂。。。题目: 1437: 校长杯Time Limit: 1500 ms Memory Limit: 32000 kB Judge type: Multi-cases Special JudgeTotal Submit : 108(51 users)Accepted Submit : 65(45 users)Page View : 3964Font Style: Aa Aa Aa 在南开大学.. 阅读全文

posted @ 2012-08-20 20:27 mycapple 阅读(252) 评论(0) 推荐(0) 编辑

HDU 1372 Knight Moves

摘要: 地址:http://acm.hdu.edu.cn/showproblem.php?pid=1372思路:求“马”从一点到另一点的最短距离,马走日,BFS即可分析:广度优先搜索题题意如图所示:一个棋子(骑士)可以有八个方向走,广搜确定最小的走的步数。代码如下: 1 #include <iostream> 2 #include <stdio.h> 3 #include <string.h> 4 #include <queue> 5 using namespace std; 6 int c[9][9]; 7 int dir[8][2] = {{-2,- 阅读全文

posted @ 2012-08-20 20:01 mycapple 阅读(506) 评论(0) 推荐(0) 编辑

NYOJ 283 对称排序

摘要: 地址:http://acm.nyist.net/JudgeOnline/problem.php?pid=283题目分析:意思是你已经写好了一个程序,可惜你的程序输出方式老板不喜欢!However, your boss does not like the way the output looks, and instead wants the output to appear more symmetric, with the shorter strings at the top and bottom and the longer strings in the middle.老板希望你能“symme 阅读全文

posted @ 2012-08-20 12:49 mycapple 阅读(637) 评论(0) 推荐(0) 编辑

NYOJ 514 1的个数

摘要: 地址:http://acm.nyist.net/JudgeOnline/problem.php?pid=514思路1:有篇博文写的是统计二进制中1的个数和,这篇是统计区间内十进制的1的个数和。先讨论下1到n间的1的个数和。给你一个数如:384,求1~384的1的个数之和。那么我只需求出1~300中1的个数和+1~80中1的个数和+1~4中1的个数和。1~4的1的个数为1,1~80中1的个数为101(十位数)+8*100(个位数)----十位数有10,11,12,13....19(共10个数--其中11后面的1作为个位数看待),个位数为1,11,21,31...71,共有8个1,同理可得1~30 阅读全文

posted @ 2012-08-20 08:49 mycapple 阅读(558) 评论(0) 推荐(0) 编辑

导航