码迷,mamicode.com
首页 >  
搜索关键字:using password: yes    ( 53562个结果
合并石子(平行四边形优化)
#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
HDOJ1848NIM博弈 SG函数
题目链接: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
病毒感染检测 (15分) 人的DNA和病毒DNA均表示成由一些字母组成的字符串序列。然后检测某种病毒DNA序列是否在患者的DNA序列中出现过,如果出现过,则此人感染了该病毒,否则没有感染。
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
string类的坑(string 类的应用和加倍后出现的问题)
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
HDOJ1527博弈论之Wythoff游戏
题目链接: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
HDOJ1521组合数学 指数型母函数计数
题目链接: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
【C++多线程】创建启动线程
摘要 子线程在创建时启动。 线程关联的可调对象可以是:普通函数、仿函数对象、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
csp-M3-消消乐大师-Q老师
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
csp-M3-瑞神的序列
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
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!