问题 G: JS Window 时间限制: 2 Sec 内存限制: 512 MB 题目描述 JSZKC has an array A of N integers. More over, he has a Window of length M which means the Window can contain M continuous integers in the array. At the begging, the Window is at the position 1 which mea…
G.String Transformation 题目描述 Bobo has a string S = s1 s2...sn consists of letter a , b and c . He can transform the string by inserting or deleting substrings aa , bb and abab .Formally, A = u ? w ? v (“ ? ” denotes string concatenation) can be trans…
参考博客:http://www.cnblogs.com/chendl111/p/6891770.html 题目链接:https://www.icpc.camp/contests/4mYguiUR8k0GKE Parentheses Input The input contains zero or more test cases and is terminated by end-of-file. For each test case: The first line contains an inte…
//代码跑的很慢四秒会超时,结尾附两秒代码(标程) #include<bits/stdc++.h>using namespace std;typedef long long ll;const ll inf=0x3f3f3f3f;vector<pair<int,int>>tree[100010];ll dp[100010][110];/*dp[u][i]表示u节点为根的子树上选择了i个叶子节点,会经过u这个子树的边的权值和的最优值.转移方程如下:dp[u][i]=min(…
#2009. 「SCOI2015」小凸玩密室 内存限制:256 MiB时间限制:1000 ms标准输入输出 题目类型:传统评测方式:文本比较 上传者: 匿名 提交提交记录统计讨论测试数据 题目描述 小凸和小方相约玩密室逃脱,这个密室是一棵有 n nn 个节点的完全二叉树,每个节点有一个灯泡.点亮所有灯泡即可逃出密室.每个灯泡有个权值 Ai A_iAi,每条边也有个权值 bi b_ibi. 点亮第 1 11 个灯泡不需要花费,之后每点亮一个新的灯泡 V VV 的花费,等于上一个被点…