随笔分类 -  蓝桥杯备赛

摘要:注意从下面往上走。 #include<cstdio> #include<iostream> #include<string> #include<cstring> #include<cmath> #include<stdlib.h> #include<algorithm> #include<vecto 阅读全文
posted @ 2020-10-07 22:04 Tomorrow1126 阅读(64) 评论(0) 推荐(0) 编辑
摘要:http://poj.org/problem?id=1384 完全背包是物品的个数是无限的。 二维数组:(这个题目用二维数组会超时) 由于dp数组初始化的问题,一直答案不对。 后面发现是: for(int i=0;i<=N;i++) dp[i][0]=0; #include<cstdio> #inc 阅读全文
posted @ 2020-10-05 11:30 Tomorrow1126 阅读(136) 评论(0) 推荐(0) 编辑
摘要:数组放在int main外面,不然会有问题 Process exited after 31.91 seconds with return value 3221225620 阅读全文
posted @ 2020-10-04 11:11 Tomorrow1126 阅读(200) 评论(0) 推荐(0) 编辑
摘要:https://www.nowcoder.com/questionTerminal/b44f5be34a9143aa84c478d79401e22a #include<cstdio> #include<iostream> #include<string> #include<cstring> #inc 阅读全文
posted @ 2020-10-04 10:20 Tomorrow1126 阅读(153) 评论(0) 推荐(0) 编辑
摘要:#include<cstdio> #include<iostream> #include<string> #include<cstring> #include<cmath> #include<stdlib.h> #include<algorithm> #include<vector> #includ 阅读全文
posted @ 2020-09-29 13:12 Tomorrow1126 阅读(125) 评论(0) 推荐(0) 编辑
摘要:定义: 回溯法(探索与回溯法)是一种选优搜索法,又称为试探法,按选优条件向前搜索,以达到目标。 但当探索到某一步时,发现原先选择并不优或达不到目标,就退回一步重新选择,这种走不通就退回再走的技术为回溯法, 而满足回溯条件的某个状态的点称为“回溯点”。 #include<cstdio> #includ 阅读全文
posted @ 2020-09-28 12:06 Tomorrow1126 阅读(123) 评论(0) 推荐(0) 编辑
摘要:1、最长不增子序列,拦截导弹 #include<cstdio> #include<iostream> #include<string> #include<cstring> #include<cmath> #include<stdlib.h> #include<algorithm> #include< 阅读全文
posted @ 2020-09-21 16:27 Tomorrow1126 阅读(145) 评论(0) 推荐(0) 编辑
摘要:1、 long long 为64位整数类型,一般的long long为64位,由于负数补码的原因, 第一位作为符号位,因此有63位可用。则取值范围为-2^63到2^63-1。 2、 C++中也可以用科学计数法,比如: 0.01 = 1e-2 (注意e前面的那个是数字1) 100 = 1e2 阅读全文
posted @ 2020-09-19 16:14 Tomorrow1126 阅读(4099) 评论(0) 推荐(0) 编辑
摘要:https://www.nowcoder.com/questionTerminal/df219d60a7af4171a981ef56bd597f7b#include<cstdio> #include<iostream> #include<string> #include<cstring> #incl 阅读全文
posted @ 2020-09-19 16:13 Tomorrow1126 阅读(126) 评论(0) 推荐(0) 编辑
摘要:https://www.nowcoder.com/questionTerminal/c978e3375b404d598f1808e4f89ac551 #include<cstdio> #include<iostream> #include<string> #include<cstring> #inc 阅读全文
posted @ 2020-09-19 15:42 Tomorrow1126 阅读(165) 评论(0) 推荐(0) 编辑
摘要:1、递推求解 2、最大连续子序列和 3、最长递增子序列 4、最长公共子序列 5、背包问题 阅读全文
posted @ 2020-09-19 15:41 Tomorrow1126 阅读(92) 评论(0) 推荐(0) 编辑
摘要:http://acm.hdu.edu.cn/showproblem.php?pid=1232 #include<cstdio> #include<iostream> #include<string> #include<cstring> #include<cmath> #include<stdlib. 阅读全文
posted @ 2020-09-19 11:15 Tomorrow1126 阅读(138) 评论(0) 推荐(0) 编辑
摘要:#include<iostream> using namespace std; char g[10][9]; bool st[10][9]; int dx[]={-2,-1,1,2,2,1,-1,-2},dy[]={1,2,2,1,-1,-2,-2,-1};//这里我是看图从左上顺时针写的 bool 阅读全文
posted @ 2020-09-18 14:35 Tomorrow1126 阅读(149) 评论(0) 推荐(0) 编辑
摘要:#include<cstdio> #include<iostream> #include<string> #include<cstring> #include<cmath> #include<stdlib.h> #include<algorithm> #include<vector> #includ 阅读全文
posted @ 2020-09-07 15:16 Tomorrow1126 阅读(90) 评论(0) 推荐(0) 编辑
摘要:一般vector不会超时 其他的可以用数组来模拟一下。 阅读全文
posted @ 2020-08-11 14:47 Tomorrow1126 阅读(193) 评论(0) 推荐(0) 编辑
摘要:__int64与long long 都是在32位平台开始使用bai的du64位整数的数据类型,在存储方式和使用方式上没有区别。两者的区zhi别在于,它们命名的发起人不同,支持的平台不同。 long long这个数据类型,是UNIX平台发起并支持的,而__int64是微软从win95(VC6)开始发起 阅读全文
posted @ 2020-08-11 14:41 Tomorrow1126 阅读(539) 评论(0) 推荐(0) 编辑
摘要:#include<cstdio> #include<iostream> #include<string> #include<cstring> #include<cmath> #include<stdlib.h> #include<algorithm> #include<vector> #includ 阅读全文
posted @ 2020-08-11 13:22 Tomorrow1126 阅读(96) 评论(0) 推荐(0) 编辑
摘要:bool visit[100]; memset(visit,false,sizeof(visit)); 阅读全文
posted @ 2020-08-11 13:16 Tomorrow1126 阅读(155) 评论(0) 推荐(0) 编辑
摘要:比如阶乘,如果用int 输出可能是错的,因为正确答案超出范围了。 所以一定要注意用什么类型! 阅读全文
posted @ 2020-08-09 16:58 Tomorrow1126 阅读(147) 评论(0) 推荐(0) 编辑
摘要:开了一个int a[1000000]放在main函数里运行出错了,全局变量就可以。 全局变量在静态存储区分配内存,局部变量是在栈上分配内存空间。 阅读全文
posted @ 2020-08-09 16:41 Tomorrow1126 阅读(612) 评论(0) 推荐(0) 编辑

点击右上角即可分享
微信分享提示