自定义博客皮肤VIP专享

*博客头图:

格式为PNG、JPG,宽度*高度大于1920*100像素,不超过2MB,主视觉建议放在右侧,请参照线上博客头图

请上传大于1920*100像素的图片!

博客底图:

图片格式为PNG、JPG,不超过1MB,可上下左右平铺至整个背景

栏目图:

图片格式为PNG、JPG,图片宽度*高度为300*38像素,不超过0.5MB

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+
  • 博客(26)
  • 资源 (1)
  • 收藏
  • 关注

原创 二叉树--uva 679 Dropping Balls 二叉树数组模拟

题意:n组数据,每组给定树的深度d和球的个数i,求每组第i个球组后落在哪。分析:模拟球下落的过程即可。思路一:对于每组球,模拟开关的状态,一个一个下落,最后获得结果。超时了妥妥的。/*@Filename: code.cpp@Author: wyl6 @Mail: ustbcs_wyl@163.com@Thought:*/#include #includ

2017-11-30 16:05:11 332

原创 双链表--uva12657 Boxes in a Line 从入门到放弃

分析:/*思路:用双向队列记录点的左右节点,每次移动进行更新。op == 4的时候需要链表反转,这个操作很麻烦,不如直接用inv记录。每次取反。inv为1的时候相当于不动,inv为0的时候我们的链表相当于反转的逆序。拿1234来说,inv为1是4321.此时1 2 4 是2341,我们直接操作就是3-op2就是,2 2 4生成1342,生成2431的逆序。而当n为奇数时,正逆求和一样;

2017-11-29 22:31:47 297

原创 单链表--uva 11988 Broken Keyboard 从入门到放弃

分析:/*思路:用s数组存储字符串;用光标指定元素位置,下一个元素插入时在光标位置后面;用next数组记录指向的下一个元素,在数组上构建链表关系;将光标在字符串中移动,模拟输出结果构建链表关系,最后根据链表将数据输出。注意:链表一般有个头节点,可以将s[0]空出来对应头节点。*/代码:#include #include #include #include #inclu

2017-11-29 22:27:03 200

原创 单调队列--poj2823 从入门到放弃

Sliding WindowTime Limit: 12000MS Memory Limit: 65536KTotal Submissions: 64041 Accepted: 18262Case Time Limit: 5000MSDescriptionAn array of size n ≤ 106 is

2017-11-27 23:21:08 490

原创 poj2970The lazy programmer 优先队列+贪心

The lazy programmerTime Limit: 5000MS Memory Limit: 65536KTotal Submissions: 2421 Accepted: 605DescriptionA new web-design studio, called SMART (Simply Masters

2017-11-26 22:42:29 459

原创 ubuntu软件包系统已损坏

多半是上次更新没有更新完sudo apt-get clean说明:删除包缓存中的所有包,将 /var/cache/apt/archives/ 的 所有 deb 删掉sudo apt-get -f install说明:自动修复安装程序包所依赖的包sudo apt-get update说明:更新软件列表sudo apt-get upgrade说明:将最新软件列表和本地软件比对,更新软件

2017-11-24 22:57:45 6992 1

原创 poj3279 Fliptile 开关问题

FliptileTime Limit: 2000MS Memory Limit: 65536KTotal Submissions: 12725 Accepted: 4681DescriptionFarmer John knows that an intellectually satisfied cow is a happy

2017-11-22 22:03:00 290

原创 poj3276 Face The Right Way 反转问题

Face The Right WayTime Limit: 2000MS Memory Limit: 65536KTotal Submissions: 5709 Accepted: 2641DescriptionFarmer John has arranged his N (1 ≤ N ≤ 5,000) cows in a

2017-11-21 20:26:30 198

原创 《挑战程序设计竞赛》 坐标离散化技巧实现

问题:w*h的格子上画了n条或垂直或水平的宽度为1的直线。求出这些线将格子划分了多少个区域 。w和h的范围都为[1, 1000000],n的范围为[1,500]。输入:w,h,nx1,x2,y1,y110 10 51 9 4 1 106 9 4 10 104 1 1 8 64 5 10 8 10结果:6分析:w和h都较大,直接搜索肯定超时

2017-11-20 22:53:52 343

原创 ubuntu下安装Anaconda后打不开ipython notebook (jupyter notebook)

一.安装Anaconda1.打开Anaconda官网 Anaconda下载官网,64位电脑一般情况下使用第一个x86_64,只要记住这个能兼容32就行了。x86_64,x64基本上是同一个东西,我们现在用的intel/amd的桌面级CPU基本上都是x86_64,与之相对的ppc等都不是x86_64。2.打开终端,跳到相应目录,输入:bash Anaconda3-5.0.1-Linu

2017-11-20 11:39:26 5486

原创 《挑战程序设计竞赛》 超大背包问题实现

问题:有n个重量和价值分别为w[i]和v[i]的物品,从这些物品中挑选总重量不超过W的物品,求所有挑选方案中价值总和的最大值。1 ≤ n ≤ 401 ≤ w[i], v[i] ≤ 10^151 ≤ W ≤ 10^15分析:直接用01背包肯定超时。可以对前n/2个元素进行枚举sw1,然后后n-n/2个元素进行枚举sw,然后再sw1中二分查找#include #include

2017-11-19 21:17:08 542

原创 poj2785 折半枚举 双向查找

4 Values whose Sum is 0Time Limit: 15000MS Memory Limit: 228000KTotal Submissions: 24737 Accepted: 7467Case Time Limit: 5000MSDescriptionThe SUM problem can

2017-11-19 15:47:35 393

原创 斐波那契数列 python实现

一.递归#递归计算第n项def febonaqi(n): if(n<=1): return n else: return febonaqi(n-1)+febonaqi(n-2)二.迭代1.迭代返回列表def febonaqi(n): febo = [] for i in range(n): if i <= 1:

2017-11-19 12:03:47 893

原创 poj3104 二分

DryingTime Limit: 2000MS Memory Limit: 65536KTotal Submissions: 18783 Accepted: 4727DescriptionIt is very hard to wash and especially to dry clothes in winter. Bu

2017-11-18 23:03:43 238

原创 poj2674 弹性碰撞

Linear worldTime Limit: 3000MS Memory Limit: 65536KTotal Submissions: 4304 Accepted: 977DescriptionThe Disc, being flat, has no real horizon. Any adventurous sail

2017-11-18 22:42:11 285

原创 POJ3684 弹性碰撞

Physics ExperimentTime Limit: 1000MS Memory Limit: 65536KTotal Submissions: 2758 Accepted: 987 Special JudgeDescriptionSimon is doing a physics experiment wit

2017-11-18 20:27:44 287

原创 poj3273 二分 易错题

Monthly ExpenseTime Limit: 2000MS Memory Limit: 65536KTotal Submissions: 29665 Accepted: 11263DescriptionFarmer John is an astounding accounting wizard and has re

2017-11-17 22:56:23 248

原创 poj3258 二分

River HopscotchTime Limit: 2000MS Memory Limit: 65536KTotal Submissions: 16187 Accepted: 6791DescriptionEvery year the cows hold an event featuring a peculiar ver

2017-11-17 22:42:33 189

原创 poj 3111 K Best 二分

K BestTime Limit: 8000MS Memory Limit: 65536KTotal Submissions: 11677 Accepted: 3016Case Time Limit: 2000MS Special JudgeDescriptionDemy has n jewels.

2017-11-17 22:37:08 247

原创 poj 2456 二分

Aggressive cowsTime Limit: 1000MS Memory Limit: 65536KTotal Submissions: 16384 Accepted: 7837DescriptionFarmer John has built a new long barn, with N (2 His C

2017-11-17 22:36:26 199

原创 poj 1064 二分

Cable masterTime Limit: 1000MS Memory Limit: 10000KTotal Submissions: 51858 Accepted: 10912DescriptionInhabitants of the Wonderland have decided to hold a regiona

2017-11-17 22:17:19 164

原创 poj3320 尺取法

Jessica's Reading ProblemTime Limit: 1000MS Memory Limit: 65536KTotal Submissions: 14120 Accepted: 4837DescriptionJessica's a very lovely girl wooed by lots of bo

2017-11-17 20:29:37 216

原创 poj3061 尺取法

SubsequenceTime Limit: 1000MS Memory Limit: 65536KTotal Submissions: 17085 Accepted: 7265DescriptionA sequence of N positive integers (10 < N < 100 000), each of

2017-11-17 20:01:57 214

原创 poj1456Supermarket 贪心解法

传送门题意:给出n个产品的利润和贩卖截止时间,单位时间只能贩卖一个产品.求最终获得的最大利润.分析:要获得最大利润,在同一时间肯定优先考虑利润较大的产品;所以可以根据利润进行排序,优先处理利润大的产品,最终获得的肯定是最大利润.#include #include #include #include #include #include #include #inc

2017-11-14 22:41:00 256

原创 c++中 gets(s)、scanf(%s) 、getline(s)、cin >> s 比较

1.gets和getline读取换行符//gets读取回车:string a;char b[100];int main(){ cin >> a; gets(b); cout << "a:" << a << endl; cout << "b:" << b << endl; return 0;}//getline读取回车string a;string b

2017-11-01 23:01:15 1682

原创 poj2718 枚举排列

Smallest DifferenceTime Limit: 1000MS Memory Limit: 65536KTotal Submissions: 13000 Accepted: 3512DescriptionGiven a number of distinct decimal digits, you can for

2017-11-01 22:17:00 304

杀生丸图像

杀生丸高清图像,可以用来做数据分析、用神经网络提取杀生丸特征,自动画出杀生丸的图像。 更新:共有106张图像

2018-01-31

空空如也

TA创建的收藏夹 TA关注的收藏夹

TA关注的人

提示
确定要删除当前文章?
取消 删除