上一页 1 ··· 8 9 10 11 12 13 14 15 16 ··· 30 下一页
摘要: 1 //dp 2 #include 3 using namespace std; 4 5 int dp[40] = {0,1,2}; 6 7 void init() 8 { 9 for(int i=3; i> n; 18 while(n--) 19 { 20 cin >> m; 21 cout << dp[m-1] <... 阅读全文
posted @ 2017-04-09 14:58 Posase 阅读(119) 评论(0) 推荐(0) 编辑
摘要: 1 /* 2 d[v] = w; ->价值为v时,d[v] = 达到该价值的最小重量 3 */ 4 #include 5 #include 6 using namespace std; 7 8 int d[10005]; 9 int maxd,n,maxw,w,v; 10 11 void bag(int w,int v) 12 { 13 i... 阅读全文
posted @ 2017-04-08 13:47 Posase 阅读(175) 评论(0) 推荐(0) 编辑
摘要: 1 /* 2 状态转移方程如下 ai,bj分别代表a字符串和b字符串的i,j处的字符 3 4 -> 0 (i = j =0) 5 v[i,j] = -> v[i-1][j-1] (ai == bj) 6 -> Max(v[i-... 阅读全文
posted @ 2017-04-07 15:49 Posase 阅读(145) 评论(0) 推荐(0) 编辑
摘要: CCF 学生排队 PS:此文章已在我的站点更新,请移步访问~更多注释讲解哦。https://www.jeson.xin/ccf-student_queuing.html // 即将失效。。。 题目 问题描述 体育老师小明要将自己班上的学生按顺序排队。他首先让学生按学号从小到大的顺序排成一排,学号小的 阅读全文
posted @ 2017-04-05 10:48 Posase 阅读(1839) 评论(0) 推荐(0) 编辑
摘要: 1 #include 2 typedef struct 3 { 4 int attack,health; 5 } cus; 6 7 cus info[2][8]; 8 int aliv[2]; 9 int player = 0; 10 11 void summon(); 12 void attack(); 13 void solven();... 阅读全文
posted @ 2017-04-05 10:14 Posase 阅读(321) 评论(0) 推荐(0) 编辑
摘要: 1 //一个数组元素存14位,模拟即可 2 #include 3 int len = 0; 4 const long long m = 100000000000000; 5 long long a[10000]={1}; 6 7 void solve(long long x) 8 { 9 int add = 0; 10 for(int i=0; i 0) 18... 阅读全文
posted @ 2017-04-04 14:31 Posase 阅读(108) 评论(0) 推荐(0) 编辑
摘要: 1 //与数塔一样dp递推即可 2 #include 3 #include 4 5 int a[100005][11]; 6 7 int Max(int a,int b) 8 { 9 return a>b?a:b; 10 } 11 12 int Max(int a,int b,int c) 13 { 14 return Max(a,b)>c?Max(a,b... 阅读全文
posted @ 2017-04-03 21:26 Posase 阅读(186) 评论(0) 推荐(0) 编辑
摘要: 1 #include 2 #include 3 using namespace std; 4 5 int ans; 6 char s[10005]; 7 char v[10005]; 8 9 void solve(int x) 10 { 11 if(!ans || v[ans] =s[x]) 18 { 19 v... 阅读全文
posted @ 2017-03-31 18:49 Posase 阅读(115) 评论(0) 推荐(0) 编辑
摘要: 1 //认真读题啊。。。。。。。。god。。。。 2 #include 3 #include 4 using namespace std; 5 6 int ans; 7 int v[3005]; 8 9 void solve(int x) 10 { 11 int i; 12 for(i=0; i= x) 14 { 15 ... 阅读全文
posted @ 2017-03-31 15:15 Posase 阅读(114) 评论(0) 推荐(0) 编辑
摘要: 1 #include 2 #include 3 using namespace std; 4 5 int ans; 6 int v[21]; 7 8 void solve(int x) 9 { 10 int t; 11 if(!ans || v[ans] > x) 12 v[++ans] = x; 13 else 14 { 1... 阅读全文
posted @ 2017-03-31 12:08 Posase 阅读(115) 评论(0) 推荐(0) 编辑
上一页 1 ··· 8 9 10 11 12 13 14 15 16 ··· 30 下一页