#include using namespace std; //部分状态转移方程有平行四边形优化 //但第三层寻找最优分割点的时候会有许多重复的过程, //这里我们可以用一个s[i][j]数组记录下从i 到 j 最优分割点的下标, 在下次寻找时减少寻找次数, //这样就可以将时间降低到 n ^ 2的... ...
分类:
其他好文 时间:
2020-06-06 21:20:09
阅读次数:
86
#include using namespace std; const int maxn=1000+10; int n,k,w[maxn],v[maxn],dp[maxn][maxn]={0},c[maxn]={0}; int main() { cin>>n>>k; for(int i=1;i>w[... ...
分类:
其他好文 时间:
2020-06-06 21:18:34
阅读次数:
60
题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=1848 代码如下: #include<bits/stdc++.h> using namespace std; typedef unsigned int ui; typedef long long ll; ...
分类:
其他好文 时间:
2020-06-06 19:00:21
阅读次数:
75
1 #include<iostream> 2 #include<cstring> 3 //.size()的头文件 4 using namespace std; 5 6 int next1[1000005]; 7 void getnext(string t ,int tsize)//从0号下标开始存起 ...
分类:
其他好文 时间:
2020-06-06 18:58:06
阅读次数:
236
1 #include<iostream> 2 using namespace std; 3 4 int main() 5 { 6 string t; 7 cin>>t; 8 int len = t.length(),i; 9 10 for(i = 0;i<len;i++) 11 { 12 t[len ...
分类:
其他好文 时间:
2020-06-06 18:39:11
阅读次数:
64
题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=1527 代码如下: #include<bits/stdc++.h> using namespace std; typedef unsigned int ui; typedef long long ll; ...
分类:
其他好文 时间:
2020-06-06 18:18:17
阅读次数:
60
题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=1521 代码如下: #include<bits/stdc++.h> using namespace std; typedef unsigned int ui; typedef long long ll; ...
分类:
其他好文 时间:
2020-06-06 13:06:06
阅读次数:
56
摘要 子线程在创建时启动。 线程关联的可调对象可以是:普通函数、仿函数对象、Lambda表达式、成员函数。 示例 普通函数 1 #include <thread> 2 #include <iostream> 3 4 using namespace std; 5 6 void test() 7 { 8 ...
分类:
编程语言 时间:
2020-06-06 12:40:20
阅读次数:
66
sample input: 4 5 2 2 3 1 2 3 4 5 1 4 2 3 2 1 3 2 2 2 4 4 sample output: 2 2 3 0 2 3 4 5 0 2 2 3 2 0 3 0 0 0 4 4 思路: 读懂题目意思,然后按行列遍历使得连续三个以上相邻的不小于3 刚开始 ...
分类:
其他好文 时间:
2020-06-06 11:07:10
阅读次数:
60
T1 简单题 思路: 根据定义遍历模拟即可 #include<iostream> using namespace std; int main(){ int n; cin>>n; int *a = new int[n] ; for(int i=0;i<n;i++) cin>>a[i]; int cnt ...
分类:
其他好文 时间:
2020-06-06 11:05:07
阅读次数:
66