[题目链接] A - Alphabet 最长公共子序列.保留最长公共子序列,剩余的删除或者补足即可. #include <bits/stdc++.h> using namespace std; const int maxn = 1e5 + 10; char s[maxn]; char t[maxn]; int dp[100][100]; int main() { scanf("%s", s); for(int i = 0; i < 26; i ++) { t[i] =…
摘要: 本文是The 2018 ACM-ICPC Asia Qingdao Regional Contest(青岛现场赛)的部分解题报告,给出了出题率较高的几道题的题解,希望熟悉区域赛的题型,进而对其他区域赛的准备有借鉴意义. Function and Function 题意 给出x和k,计算gk(x). 解题思路 通过观察发现,g函数经过一定次数的递推一定会在0和1之间变换,所以循环内加判断提前结束递推即可. 易错分析 注意计算f(0)返回的是1的问题,下面的写法避免了这种错误. 代码实现 #…
SurfNow that you've come to Florida and taken up surng, you love it! Of course, you've realized thatif you take a particular wave, even if it's very fun, you may miss another wave that's just aboutto come that's even more fun. Luckily, you've gotten…