摘要: UVA.129 Krypton Factor (搜索+暴力)题意分析搜索的策略是:优先找长串,若长串不合法,则回溯,继续找到合法串,直到找到所求合法串的编号,输出即可。 注意的地方就是合法串的判断,根据后缀的规则来判断,枚举后缀长度[1,len/2],后缀中是否有重复子串,若是的话表... 阅读全文
posted @ 2017-04-18 22:59 pengwill 阅读(152) 评论(0) 推荐(0) 编辑
摘要: UVA.10986 Fractions Again (经典暴力)题意分析同样只枚举1个,根据条件算出另外一个。代码总览#include #include #include #include #include #include #include #include #include #i... 阅读全文
posted @ 2017-04-18 22:52 pengwill 阅读(85) 评论(0) 推荐(0) 编辑
摘要: UVA.10305 Maximum Product (暴力)题意分析直接枚举起点和重点,然后算出来存到数组里面,sort然后取最大值即可。代码总览#include #include #include #include #include #include #include #inclu... 阅读全文
posted @ 2017-04-18 22:47 pengwill 阅读(88) 评论(0) 推荐(0) 编辑
摘要: UVA.725 Division (暴力)题意分析找出abcdefghij分别是0-9(不得有重复),使得式子abcde/fghij = n。 如果分别枚举每个数字,就会有10^10,肯定爆炸,由于分数值已知,其实发现可以通过枚举分母,来计算出分子,然后再看看这些数字是否符合题意即可... 阅读全文
posted @ 2017-04-18 22:45 pengwill 阅读(117) 评论(0) 推荐(0) 编辑