摘要: 大模拟、数学题、阅读题(虽然我题意没看懂然后苟了题解QwQ) 1 #include<cstdio> 2 #include<cstring> 3 #include<cmath> 4 5 #define ri register int 6 #define inf 2147483647 7 8 using 阅读全文
posted @ 2020-01-14 15:58 Running-Coder 阅读(184) 评论(0) 推荐(0) 编辑
摘要: 1 #include<cstdio> 2 #include<cstring> 3 #include<cmath> 4 5 #define ll long long 6 7 using namespace std; 8 9 ll c[100005]; 10 ll addv[320]; 11 ll sum[320]; 12 int n,m,g,p=1,ks=1; //g每块大小 p临时指针 ks块数 阅读全文
posted @ 2019-08-11 21:24 Running-Coder 阅读(192) 评论(0) 推荐(0) 编辑
摘要: 1 #include<cstdio> 2 #include<cstring> 3 4 using namespace std; 5 6 inline int max(int x,int y){ 7 if(x>y)return x;else return y; 8 } 9 10 struct bignum{ 11 int c[10],l; 12 13 void clear(){ 14 memset( 阅读全文
posted @ 2019-08-11 21:08 Running-Coder 阅读(164) 评论(0) 推荐(0) 编辑
摘要: 1 #include<cstdio> 2 #include<cstring> 3 4 using namespace std; 5 6 int find(int); 7 int abs(int); 8 void setup(); 9 10 int fa[30005]; 11 int size[30005]; 12 int d[30005]; 13 int T,x,y,fx,fy; 14 char 阅读全文
posted @ 2019-08-11 21:02 Running-Coder 阅读(168) 评论(0) 推荐(0) 编辑
摘要: 高精实乃万恶之源 算法部分: 一、压位: 1.目的: 压位的目的在于优化时间、空间。 空间上,例如一个四位数1111,不压位则需要用4个变量存储每一位,而压位(比如压4位)后,就只需要用1个变量(比如int)了。 时间上,例如计算1111*1111,不压位则按位相乘共需计算4*4=16次,而压位(比 阅读全文
posted @ 2019-07-28 21:51 Running-Coder 阅读(613) 评论(3) 推荐(0) 编辑
摘要: 1 #include<cstdio> 2 3 using namespace std; 4 5 int max(int x,int y){ 6 if(x>y)return x;else return y; 7 } 8 9 int find(int); 10 11 int n,m,f,x,y,a,b; 阅读全文
posted @ 2019-07-10 16:41 Running-Coder 阅读(244) 评论(0) 推荐(0) 编辑
摘要: 本题思路非常明确:在所有能插入加号的位置枚举加号是否存在,对于每一种情况,若求得和为n则更新答案。 但是看看数据规模。。。长度<=40,也就是说枚举的时间最多可达2^39,显然会T,所以需要剪枝。 剪枝1:若整串拆分为单个数字后求和,所得结果>n,则一定无解。 原因:显然在一次拆分后,新生成的数字的 阅读全文
posted @ 2019-07-10 14:04 Running-Coder 阅读(311) 评论(0) 推荐(0) 编辑
摘要: 边界情况害人不浅 阅读全文
posted @ 2019-07-08 17:00 Running-Coder 阅读(359) 评论(0) 推荐(1) 编辑
摘要: 这道题好干燥啊。。。折腾了半个月。。。感谢bogo大佬对我的指导。。。题目要求支持的操作:1.查询某段路径的所有子路径的xor值之和;2.修改某条边的权值。重点是操作1。刚开始,我看到了操作1之后就不自觉的想到了非~常暴力的东西。。。还好大佬及时把我引上正途:分治! 大家知道,最大子段和有个分治算法 阅读全文
posted @ 2018-01-08 12:32 Running-Coder 阅读(349) 评论(0) 推荐(0) 编辑
摘要: 1 #include<cstdio> 2 #include<iostream> 3 #include<cstring> 4 #include<cmath> 5 #include<ctime> 6 #include<cstdlib> 7 8 #include<string> 9 #include<st 阅读全文
posted @ 2017-12-03 12:59 Running-Coder 阅读(184) 评论(0) 推荐(0) 编辑