
递归
文章平均质量分 74
傲慢的么么forever
待到学有所成时,我会找到人生的意义。
展开
-
蓝桥杯 算法训练 2的次幂表示
算法训练 2的次幂表示 时间限制:1.0s 内存限制:512.0MB 问题描述 任何一个正整数都可以用2进制表示,例如:137的2进制表示为10001001。 将这种2进制表示写成2的次幂的和的形式,令次幂高的排在前面,可得到如下表达式:137=2^7+2^3+2^0 现在约定幂次用括号来表示,即a^b表示为a(b) 此时,1原创 2015-03-11 18:36:29 · 540 阅读 · 0 评论 -
POJ 1321 棋盘问题
棋盘问题Time Limit: 1000MS Memory Limit: 10000KTotal Submissions: 25790 Accepted: 12756Description在一个给定形状的棋盘(形状可能是不规则的)上面摆放棋子,棋子没有区别。要求摆放时任意的两个棋子不能放在棋盘中的同一行或者同一列,请编程求解对于给定形状和大小的棋盘,摆放k个棋子的所有可行的摆放原创 2015-05-06 21:09:58 · 439 阅读 · 0 评论 -
POJ 1562 Oil Deposits
Oil DepositsTime Limit: 1000MS Memory Limit: 10000KTotal Submissions: 13709 Accepted: 7473DescriptionThe GeoSurvComp geologic survey company is responsible for detecting underground oil depo原创 2015-05-07 09:46:43 · 484 阅读 · 0 评论 -
POJ 2531 Network Saboteur
Network SaboteurTime Limit: 2000MS Memory Limit: 65536KTotal Submissions: 9706 Accepted: 4633DescriptionA university network is composed of N computers. System administrators gathered inform原创 2015-05-07 17:40:15 · 569 阅读 · 0 评论 -
Aoj 0525 Osenbei
pilot系列之最基础的穷竭搜索(初级篇)C题意:药药!切克闹! 煎饼果子来一套!有一个烤饼器可以烤r行c列的煎饼,煎饼可以正面朝上(用1表示)也可以背面朝上(用0表示)。一次可将同一行或同一列的煎饼全部翻转。现在需要把尽可能多的煎饼翻成正面朝上,问最多能使多少煎饼正面朝上?输入:多组输入,每组第一行为二整数r, c (1 ≤ r ≤ 10, 1 ≤ c ≤ 10 000),剩下r行c列表原创 2015-05-22 10:16:50 · 764 阅读 · 0 评论 -
POJ 3050 Hopscotch
HopscotchTime Limit: 1000MS Memory Limit: 65536KTotal Submissions: 2419 Accepted: 1728DescriptionThe cows play the child's game of hopscotch in a non-traditional way. Instead of a linear set原创 2015-05-19 12:27:25 · 446 阅读 · 0 评论 -
uva 10006 10006 - Carmichael Numbers
Carmichael Numbers An important topic nowadays in computer science is cryptography. Some people even think that cryptography is the only important field in computer science, and that life would not原创 2015-07-28 17:23:03 · 470 阅读 · 0 评论