摘要: echo cd ~/桌面 >> .bashrc 将终端默认路径设为桌面 ~/.bashrc、/etc/bash.bashrc、/etc/profile这几个文件。这些文件的的作用时机:/etc/profile:此文件为系统的每个用户设置环境信息,当用户第一次登录时,该文件被执行.并从/etc/pro 阅读全文
posted @ 2015-11-30 14:34 cdongyang 阅读(165) 评论(0) 推荐(0) 编辑
摘要: intput n 1<=n<=24 n串只有大写字母的字符串 output 选出最多个字符串且每个大写字母出现的次数为偶数 第一行输出个数x 第二行输出x个字符串的下标 做法:将每个字符串转化为一个26bit数,1为奇数个大写字母,0为偶数个,则转化为找出最多个数异或和为0,直接枚举为O((2^n) 阅读全文
posted @ 2015-11-26 10:05 cdongyang 阅读(928) 评论(0) 推荐(0) 编辑
摘要: inputn s 10 2 #include 3 #include 4 #include 5 #include 6 #include 7 #include 8 #include 9 #include 10 #include 11 #include 12 #define MAX 1000... 阅读全文
posted @ 2015-11-25 20:48 cdongyang 阅读(278) 评论(0) 推荐(0) 编辑
摘要: input n d 1<=n<=1000 n行坐标xi,yi output 位于x轴扫描器的扫描距离为d,至少要多少个扫描器才能扫描到所有坐标 如果无法扫描完输出-1,否则输出扫描器个数 做法:将每个坐标转化为扫描器可扫到它的区间,然后取最少区间,最少区间为最多的不连续区间数 1 #include< 阅读全文
posted @ 2015-11-25 19:17 cdongyang 阅读(323) 评论(0) 推荐(0) 编辑
摘要: inputr c m r 2 #include 3 #include 4 #include 5 #include 6 #include 7 #include 8 #include 9 #include 10 #include 11 #include 12 #d... 阅读全文
posted @ 2015-11-23 20:29 cdongyang 阅读(231) 评论(0) 推荐(0) 编辑
摘要: inputn m 1 2 #include 3 #include 4 #include 5 #include 6 #include 7 #include 8 #include 9 #include 10 #include 11 #include 12 #defi... 阅读全文
posted @ 2015-11-23 09:09 cdongyang 阅读(276) 评论(0) 推荐(0) 编辑
摘要: inputq nq行 F a b或者Q a boutputface left face top face right可以用map或者线段树做 1 //map 2 #include 3 #include 4 using namespace std; 5 mapa; 6 int main() 7 {... 阅读全文
posted @ 2015-11-22 19:32 cdongyang 阅读(151) 评论(0) 推荐(0) 编辑
摘要: 最大连续区间和是一个经典的问题。给定一个长度为n的序列a[1],a[2]...a[n-1],a[n],求一个连续的子序列a[i],a[i+1]...a[j-1],a[j],使得a[i]+a[i+1]...a[j-1]+a[j]最大。①最简单最容易想到的就是根据定义来枚举。枚举上下界{i,j | 0< 阅读全文
posted @ 2015-11-18 20:46 cdongyang 阅读(332) 评论(0) 推荐(0) 编辑
摘要: input1 2 #include 3 #include 4 #include 5 #include 6 #include 7 #include 8 #include 9 #include 10 #include 11 #include 12 13 using namespace st... 阅读全文
posted @ 2015-11-05 10:11 cdongyang 阅读(162) 评论(0) 推荐(0) 编辑
摘要: input 1<=n<=1e6 1<=k<=2*1e9 a1 a2 ... an 1<=an<=2*1e9 output k存在则输出k是第几大的数,否则输出-1 做法,从两端开始找到中间,把比b大的和比b小的交换 1 #include <cstdio> 2 #include <queue> 3 # 阅读全文
posted @ 2015-11-03 12:28 cdongyang 阅读(178) 评论(0) 推荐(0) 编辑