题目链接:10453 - Make Palindrome 题目大意:给出一个字符串,通过插入字符使得原字符串变成一个回文串,要求插入的字符个数最小,并且输出最后生成的回文串. 解题思路:和uva 10739的做法相似,只是本题只能插入字符,所以只要在考虑子问题的同时记录住最优的选择就可以了. #include <stdio.h> #include <string.h> const int N = 1005; int n, dp[N][N], rec[N][N]; char str[…
E. Fire time limit per test 2 seconds memory limit per test 256 megabytes input standard input output standard output Polycarp is in really serious trouble — his house is on fire! It's time to save the most valuable items. Polycarp estimated that it…
B. The least round way time limit per test 2 seconds memory limit per test 64 megabytes input standard input output standard output There is a square matrix n × n, consisting of non-negative integer numbers. You should find such a way on it that star…
Brackets Sequence Time Limit: 1000MS Memory Limit: 65536K Total Submissions: 27793 Accepted: 7885 Special Judge Description Let us define a regular brackets sequence in the following way: 1. Empty sequence is a regular sequence. 2. If S is a re…