题目链接:http://lightoj.com/volume_showproblem.php? problem=1043 题意:一个三角形ABC,DE//BC.已知三角形ADE和四边形BDEC的面积的比,求AD的长度. 解法:二分AD边就可以 代码: #include <stdio.h> #include <ctime> #include <math.h> #include <limits.h> #include <complex> #inclu…
1043 - Triangle Partitioning PDF (English) Statistics Forum Time Limit: 0.5 second(s) Memory Limit: 32 MB See the picture below. You are given AB, AC and BC. DE is parallel to BC. You are also given the area ratio between ADE and BDEC. You have to fi…
1043 - Triangle Partitioning   PDF (English) Statistics Forum Time Limit: 0.5 second(s) Memory Limit: 32 MB See the picture below. You are given AB, AC and BC. DE is parallel to BC. You are also given the area ratio between ADE and BDEC. You have to…
题目链接: Lightoj  1044 - Palindrome Partitioning 题目描述: 给一个字符串,问至少分割多少次?分割出来的子串都是回文串. 解题思路: 先把给定串的所有子串是不是回文串处理出来,然后用dp[i] 表示 从起点到串i的位置的最少分割次数,然后结合处理出来的回文串转移一下即可! 还是好蠢哦!自己竟然感觉是一个区间DP,但是n又那么大,完全不是区间DP的作风啊! #include <cmath> #include <cstdio> #include…
Conquering Keokradong Time Limit:1000MS     Memory Limit:32768KB     64bit IO Format:%lld & %llu Submit Status Practice LightOJ 1048 Description This winter we are going on a trip to Bandorban. The main target is to climb up to the top of Keokradong.…
A palindrome partition is the partitioning of a string such that each separate substring is a palindrome. For example, the string "ABACABA" could be partitioned in several different ways, such as {"A","B","A","…
题目链接:http://lightoj.com/volume_showproblem.php?problem=1044 题意:求给出的字符串最少能分成多少串回文串. 一般会想到用区间dp暴力3个for但是这里的数据有1000,3个for肯定超时的. 但是这题只是判断回文串有多少个所以可以先预处理一下[i,j]是不是回文,然后 就是简单dp了 for(int i = 1 ; i <= len ; i++) { ans[i] = ans[i - 1] + 1; for(int j = i - 1 ;…
提高自己的实力, 也为了证明, 开始板刷lightoj,每天题量>=1: 题目的类型会在这边说明,具体见分页博客: SUM=54; 1000 Greetings from LightOJ [简单A+B] 1001 Opposite Task  [简单题] 1002 Country Roads[搜索题] 1003 Drunk[判环] 1004 Monkey Banana Problem [基础DP] 1006 Hex-a-bonacci[记忆化搜索] 1008 Fibsieve`s Fantabu…
Triangle Partitioning Time Limit: 500MS   Memory Limit: 32768KB   64bit IO Format: %lld & %llu Submit Status Description See the picture below. You are given AB, AC and BC. DE is parallel to BC. You are also given the area ratio between ADE and BDEC.…
感谢博主——      http://blog.csdn.net/cc_again?viewmode=list       ----------  Accagain  2014年5月15日 动态规划一直是ACM竞赛中的重点,同时又是难点,因为该算法时间效率高,代码量少,多元性强,主要考察思维能力.建模抽象能力.灵活度. 本人动态规划博客地址:http://blog.csdn.net/cc_again/article/category/1261899 ***********************…