- 博客(5)
- 收藏
- 关注
原创 Leetcode 最短回文串
题目链接解法一:马拉车算法只是在马发车算法基础上改动了最后的处理方式,因为这道题限制在字符串前面添加字符,所以必须回文子串的起始位置在s字符串的开头才能。class Solution {public: string shortestPalindrome(string s) { //const int M=INT_MAX; int n=s.length(); if(n<=1){ return s;
2020-08-29 12:15:19 263
原创 POJ 3134
DescriptionStarting with x and repeatedly multiplying by x, we can compute x31 with thirty multiplications:x2 = x × x, x3 = x2 × x, x4 = x3 × x, …, x31 = x30 × x.The operation of squaring can be appreciably shorten the sequence of multiplications. The f
2020-08-28 20:30:05 219
原创 poj 1011 一起成为剪枝er吧
DescriptionGeorge took sticks of the same length and cut them randomly until all parts became at most 50 units long. Now he wants to return sticks to the original state, but he forgot how many sticks he had originally and how long they were originally. Pl
2020-08-28 12:14:41 149
原创 POJ 2441 状态压缩+动态规划(好题)
DescriptionFarmer Johnson’s Bulls love playing basketball very much. But none of them would like to play basketball with the other bulls because they believe that the others are all very weak. Farmer Johnson has N cows (we number the cows from 1 to N) and
2020-08-08 12:19:18 255
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人