随笔分类 - ACM~~ 动态规划
摘要:此题主要考查的是求最长公共子序列设A[i]:A[j] = a:b = ac:bc B[ii]:B[jj] = c:d = ac:ad ,如果A[i]:A[j] = B[ii]:B[jj]则bc= ad,所以A乘以B的倍数,B乘以A的倍数,则A与B所求的序列必然是一样的,即求A与B的最长公共子序列 1 #include 2 #include 3 #include 4 5 using namespace std; 6 7 class AstronomicalRecordsEasy{ 8 public: 9 int minimalPlanets(vector A, vecto...
        阅读全文
                
摘要:1017. StaircasesTime limit: 1.0 secondMemory limit: 64 MBOne curious child has a set ofNlittle bricks (5 ≤N≤ 500). From these bricks he builds different staircases. Staircase consists of steps of different sizes in a strictly descending order. It is not allowed for staircase to have steps equal size
        阅读全文
                
摘要:1009. K-based NumbersTime Limit: 1.0 secondMemory Limit: 64 MBLet’s consider K-based numbers, containing exactly N digits. We define a number to be valid if its K-based notation doesn’t contain two successive zeros. For example:1010230 is a valid 7-digit number;1000198 is not a valid number;0001235 
        阅读全文
                

 
         浙公网安备 33010602011771号
浙公网安备 33010602011771号