上一页 1 ··· 11 12 13 14 15 16 17 18 19 ··· 26 下一页
摘要: #include #include #include #include #include using namespace std; int main() { int T, m; cin >> T; while(T--) { map >mp; string place, name; int num; ... 阅读全文
posted @ 2017-05-21 23:35 kimsimple 阅读(325) 评论(0) 推荐(0) 编辑
摘要: 滚动数组的作用在于优化空间,主要应用在递推或动态规划中(如01背包问题)。因为DP题目是一个自底向上的扩展过程,我们常常需要用到的是连续的解,前面的解往往可以舍去。所以用滚动数组优化是很有效的。利用滚动数组的话在N很大的情况下可以达到压缩存储的作用。 一个简单的例子: 斐波那契数列: 滚动数组实际是 阅读全文
posted @ 2017-05-21 09:01 kimsimple 阅读(4159) 评论(0) 推荐(2) 编辑
摘要: 三种编程命名规范(匈牙利命名法、驼峰式命名法、帕斯卡命名法) 1 . 匈牙利命名: 开头字母用变量类型的缩写,其余部分用变量的英文或英文的缩写,要求单词第一个字母大写。 ex: int iMyAge; “i”是int类型的缩写; char cMyName[10]; “c”是char类型的缩写; fl 阅读全文
posted @ 2017-05-21 08:17 kimsimple 阅读(3886) 评论(0) 推荐(0) 编辑
摘要: #include #include using namespace std; typedef long long ll; const int MAXN = 2e5 + 10; int A[MAXN]; int B[MAXN]; bool vis[MAXN]; int abs(int a) { return a < 0 ? -a : a; } int main () {... 阅读全文
posted @ 2017-05-20 23:41 kimsimple 阅读(383) 评论(0) 推荐(0) 编辑
摘要: 交换相邻两数 如果只是交换相邻两数,那么最少交换次数为该序列的逆序数。 交换任意两数 数字的总个数减去循环节的个数?? A cycle is a set of elements, each of which is in the place of another. So in example sequ 阅读全文
posted @ 2017-05-20 23:25 kimsimple 阅读(6082) 评论(0) 推荐(0) 编辑
摘要: 经常看人写#include <bits/stdc++.h>却不知道是干啥的? #include<bits/stdc++.h>包含了目前c++所包含的所有头文件 对比: 这么神奇?可以这么轻松? 兼容性问题: 注意,目前POJ还不支持<bits/stdc++.h>(G++、C++都不支持)。HDU部分 阅读全文
posted @ 2017-05-18 18:48 kimsimple 阅读(22285) 评论(1) 推荐(1) 编辑
摘要: 输入n,紧接n行,每行a,b n个气球,a,b表示从第a到第b个气球涂一次色,输出每个球最终的涂几次色 暴力超时,优化数据结构 1.树状数组 2.线段树 3.奇技淫巧 从此题discuss中看到 每个气球有两属性 作为起点的次数st 作为终点的次数ed 一共享变量sum_st记录到当前点的所有作为染 阅读全文
posted @ 2017-05-16 22:31 kimsimple 阅读(392) 评论(0) 推荐(0) 编辑
摘要: E. 黑心啤酒厂 Time limit per test: 1.0 seconds Time limit all tests: 1.0 seconds Memory limit: 256 megabytes Accept / Submit: 1184 / 4093 E. 黑心啤酒厂 Time lim 阅读全文
posted @ 2017-05-15 23:46 kimsimple 阅读(276) 评论(0) 推荐(0) 编辑
摘要: 我们的个人信息为什么会被盗呢?原因之一是我们的电脑有漏洞,通俗的说,门窗关闭不严。 默认情况下,Windows有很多端口是开放的,在你上网的时候,网络病毒和黑客可以通过这些端口连上你的电脑。 为了让你的系统变为铜墙铁壁,应该封闭这些端口,主要有:TCP 135、139、445、593、1025 端口 阅读全文
posted @ 2017-05-13 22:45 kimsimple 阅读(4669) 评论(0) 推荐(0) 编辑
摘要: 感谢:巴氏(bash)威佐夫(Wythoff)尼姆(Nim)博弈之模板 转自:http://colorfulshark.cn/wordpress/巴氏(bash)威佐夫(wythoff)尼姆(nim)博弈之模板-823.html 最近研究了一下博弈论(听起来很高大上),当然,这只是博弈论中的冰山一角 阅读全文
posted @ 2017-05-01 23:12 kimsimple 阅读(566) 评论(0) 推荐(0) 编辑
上一页 1 ··· 11 12 13 14 15 16 17 18 19 ··· 26 下一页