摘要:
题目链接:http://acm.zju.edu.cn/onlinejudge/showProblem.do?problemId=1368题目大意:计算从S到T中所有的数,其中0,1,2,3,4,5,6,7,8,9的个数,例如从1024到1032有1024 1025 1026 1027 1028 1029 1030 1031 1032,其中10个0,10个1,7个2,3个3等等Sample Input1 1044 497346 5421199 17481496 14031004 5031714 1901317 8541976 4941001 19600 0Sample Output1 2 1 1 阅读全文
posted @ 2013-10-02 21:37
贾树丙
阅读(246)
评论(0)
推荐(0)
摘要:
题目链接:http://acm.zju.edu.cn/onlinejudge/showProblem.do?problemId=1411题目大意:连连看,给出每次连线的两个坐标,求能消去多少方块,拐弯最多2次Sample Input3 41 1 2 23 3 4 42 2 1 161 1 1 21 3 1 42 1 2 22 3 2 43 1 3 23 3 3 40 0Sample Output12分析:连线可以从外围绕过去,用BFS求出两个坐标能够到达的最少拐弯次数。注意是最少拐弯次数,而不是最短距离这道题目坑死我了,倒不是因为它的算法难,是一些小知识点代码如下: 1 # include 2 阅读全文
posted @ 2013-10-02 09:54
贾树丙
阅读(545)
评论(0)
推荐(0)

浙公网安备 33010602011771号