自定义博客皮肤VIP专享

*博客头图:

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

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

博客底图:

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

栏目图:

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

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+
  • 博客(38)
  • 收藏
  • 关注

原创 openstack-swift多进程多线程上传下载的问题

这几天在折腾openstack-swift,在百万文件的数据集下,上传下载显得异常缓慢,顾考虑多进程多线程上传下载。过程中发现proxy机单位时间能接受的curl请求是有限的,当请求书过多,有些curl请求则会报This server could not verify that you are authorized to access the document you requested.或The server is currently unavailable等错误。解决方法:1. 增加代理节点

2020-12-22 19:29:04 282

原创 在h5py中发现的问题

混用conda和pip可能会造成报错,比如h5py这个库没有统一的规范,导致pip下装的h5py会有问题。解决方案:1. 如果pip安装包的报错,试着卸载它,用conda安装2. 只用纯的pip或者conda

2020-12-22 14:16:09 396

原创 python中多进程处理数据库连接的问题

python中主进程与多个子进程最好不要共享一个数据库的driver、session等连接,因为python的一个进程退出后会自动关闭它所使用的连接,这导致其它子进程或主进程无法在该连接下操作数据库。

2020-12-18 12:21:39 590 1

原创 ubutnu下apt-get update一直显示忽略或者404

解决步骤: 清空/var/lib/apt/lists下所有文件 rm -rf /var/lib/apt/lists/* 备份source.list cp /etc/apt/sources.list /etc/apt/sources.list.bak 写入新源 #vim /etc/apt/sources.list#以下源任选#sohu shangdongdeb http://mirrors.sohu.com/ubuntu/ trusty ..

2020-12-17 15:51:01 1327

原创 openstack-swift中auth token不固定问题

解决方案:~/swift/bin/stopallservice rsync restartservice rsyslog restartservice memcached restart~/swift/bin/startall

2020-12-16 11:41:27 100

原创 connector/c代码编写总结(1)

今日工作:使用MYSQL客户端的api读取本地txt文档,传入远程MYSQL服务器端(实验)收获:1.mysql_autocommit(&sql, 0);//关闭自动提交 MYSQL在innodb引擎下可支持非自动提交,用于事务处理。如这次做的多次插入SMART数据,再一起commit,可大大提高写入 效率。2.mysql_errno(&sql)//返...

2020-01-05 22:15:31 326

原创 离线搭建mysql服务器(centos)

0.环境:阿里云主机 centos7.3 64位1.从Mysql官网下载安装包(linux generic版)mysql-5.6.36-linux-glibc2.5-x86_64.tar.gz2.解压安装tar -xvf mysql-5.6.36-linux-glibc2.5-x86_64.tar.gzmv mysql-5.6.36-linux-glibc2.5-x86_64 ...

2019-12-30 17:25:55 258

原创 客户端远程连接Mysql环境搭建(c语言)

环境:阿里云主机 centos 7.3 64位1.从Mysql官网下载代码包(linuxgeneric版)mysql-connector-c-6.1.2-linux-glibc2.5-x86_64.tar.gz, 相应的devel:mysql-connector-c-devel-6.1.2-1.linux_glibc2.5.x86_64.rpm(不安这个会报缺少头文件的错误,也可直接用...

2019-12-29 20:00:46 258

原创 HDU 4739 Zhuge Liang's Mines

题意:在一个x-y坐标系上有N颗地雷,想要挖出一个地雷只有挖出跟它形成矩形的另外三颗雷才行,问最多可以挖出多少地雷?解题思路:记忆化搜索+状态压缩。先把所有雷的坐标按从上到下,从左到右排序,因为最多20颗雷,可以用二进制表示每颗雷的状态。然后DFS记忆化寻找矩形(四重循环确定四个点),找到了则改变雷的二进制状态然后深搜下去,遍历出所有情况,得出最大值。代码:#include

2016-11-14 09:31:09 264

转载 最大密度闭合子图

第一种:转换为最大权闭合图的模型来求解:设max g = f(x)= |E‘|/|V’| ,找一个子图的边数与点数的比值达到其中的最大,我们通常都是构造一个函数max h(g)= |E'|-g*|V'|,当h(g)为0的时候,g的值即为最优,h(g)>0 时 g最优值;因为如果最大值大于0那么我们就可以继续增加g的值来减小h(g),若最大值都小于0了,那么g不可能增加只可能减少!观

2016-10-02 16:33:18 398

原创 HDU 3182 Hamburger Magi(状压DP)

In the mysterious forest, there is a group of Magi. Most of them like to eat human beings, so they are called “The Ogre Magi”, but there is an special one whose favorite food is hamburger, having been

2016-08-31 12:10:15 287

原创 uva 1382 Distant Galaxy(离散化+枚举技巧)

题目:You are observing a distant galaxy using a telescope above the Astronomy Tower, and you think that a rectangle drawn in that galaxy whose edges are parallel to coordinate axes and contain maximum

2016-08-26 09:42:17 312

转载 HDU-3635 Dragon Balls

题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=3635题目大意:初始时,有n个龙珠,编号从1到n,分别对应的放在编号从1到n的城市中。现在又2种操作:T A B,表示把A球所在城市全部的龙珠全部转移到B城市。(第一次时,因为A球所在的城市只有一个球,所以只移动1个,如果有多个,则全部移动)。Q A,

2016-08-25 09:57:30 239

原创 hdu 3461 Code Lock(并查集+快速幂)

题目:A lock you use has a code system to be opened instead of a key. The lock contains a sequence of wheels. Each wheel has the 26 letters of the English alphabet 'a' through 'z', in order. If you m

2016-08-24 16:34:45 248

原创 HDU 4411 费用流,诡异的构图

There are (N+1) cities on TAT island. City 0 is where police headquarter located. The economy of other cities numbered from 1 to N ruined these years because they are all controlled by mafia. The poli

2016-08-23 21:38:30 339

转载 听说你会图论

=============================以下是最小生成树+并查集======================================【HDU】1213 How Many Tables 基础并查集★1272 小希的迷宫 基础并查集★1325&&poj1308 Is It A Tree? 基础并查集★1856 More is better

2016-08-16 20:33:42 695

原创 HDU 3225 Flowers Placement 二分图第k优解

DescriptionBytetown has a long tradition in organizing an international flower exhibition. Professor Feuerbach, a true flower lover, visited the exhibition this year. He was pleased by the most be

2016-08-15 11:15:36 318

原创 POJ 3680 Intervals 神奇的构图

DescriptionYou are given N weighted open intervals. The ith interval covers (ai, bi) and weighs wi. Your task is to pick some of the intervals to maximize the total weights under the limit tha

2016-08-09 21:35:48 295

原创 POJ3686 The Windy's 神奇的拆点

DescriptionThe Windy's is a world famous toy factory that owns M top-class workshop to make toys. This year the manager receives N orders for toys. The manager knows that every order will take d

2016-08-09 21:18:51 435

原创 POJ 2987 Firing 最大权闭合图

DescriptionYou’ve finally got mad at “the world’s most stupid” employees of yours and decided to do some firings. You’re now simply too mad to give response to questions like “Don’t you think it

2016-08-09 21:06:31 407

原创 uva 1151 Buy or Build 状压枚举

题目:不想给。题意:有n个网络站点,q张已经连好的网络子图,每个子图都有一定价格,连接了一些网络站点,最后给出n个点的坐标。现在想要连接这n个站点,可以买图,也可以自己修路(路的价格是两点距离的平方),求最小价格。解题思路:跑一遍不用套餐时的最小生成树,记录下加入生成树的边,然后二进制枚举所有套餐的使用情况,用完后套餐仍未连起来的点用第一次跑的最小生成树的边来连接,比较每种

2016-08-07 19:57:53 272 4

原创 POJ 2175 Evacuation Plan 费用流消圈算法

The City has a number of municipal buildings and a number of fallout shelters that were build specially to hide municipal workers in case of a nuclear war. Each fallout shelter has a limited capacity

2016-08-07 19:11:05 545

原创 POJ 2516 Minimum Cost 最大流的最小费用(不要拆点!)

DescriptionDearboy, a goods victualer, now comes to a big problem, and he needs your help. In his sale area there are N shopkeepers (marked from 1 to N) which stocks goods from him.Dearboy has M s

2016-08-07 11:21:55 305

原创 UVA 11419 SAM I AM 二分图+最小覆盖点

我不想给题目题意:给你一张二维图,上面有石头,然后你就用你TN的意大利炮去轰这些石头吧(意大利炮的威力很大,所以能够直线AOE),问你最少打几炮(只能横着或者竖着打)?输出打炮的位置。解题思路:题目等价于最多有多少个石头既不在同一行也不再同一列上。有石头的地方行和列就能匹配,找出最大匹配即可(匈牙利模板 )。然后是寻找打炮位置,看代码吧。。代码:#include#

2016-08-03 21:18:29 330

原创 POJ 3436ACM Computer Factory 最大流+路径输出 dinic模板

As you know, all the computers used for ACM contests must be identical, so the participants compete on equal terms. That is why all these computers are historically produced at the same factory.Ever

2016-08-03 21:02:09 615

原创 HDU 3696 SPFA算法

Description“Farm Game” is one of the most popular games in online community. In the community each player has a virtual farm. The farmer can decide to plant some kinds of crops like wheat or paddy

2016-07-31 11:12:20 348

原创 HDU 5222 Exploration 混合图判断是否成环

DescriptionMiceren likes exploration and he found a huge labyrinth underground! This labyrinth has  caves and some tunnels connecting some pairs of caves. There are two types of tunnel,

2016-07-30 20:23:07 276

原创 FZU 2039 二分图

DescriptionAre you interested in pets? There is a very famous pets shop in the center of the ACM city. There are totally m pets in the shop, numbered from 1 to m. One day, there are n customers in

2016-07-28 20:18:00 324

原创 POJ 3974 求回文串

DescriptionAndy the smart computer science student was attending an algorithms class when the professor asked the students a simple question, "Can you propose an efficient algorithm to find the le

2016-07-28 20:10:55 268

原创 hdu 4786 Fibonacci Tree 思路

Description  Coach Pang is interested in Fibonacci numbers while Uncle Yang wants him to do some research on Spanning Tree. So Coach Pang decides to solve the following problem:   Consider a bid

2016-07-27 20:45:24 264

原创 HDU 1421 搬寝室 动态规划

Description胡老师马上要搬新家了,可是搬家真的是一个很累的活,看着家里的n件物品, 胡老师已经凌乱了,因为物品实在太多。于是胡老师想了又想,决定先随便搬2* p件过去就行了。现在,胡老师发现每搬一次的疲劳度是和左右手的物品的重量差的平方成正比,( 每次左手一件右手一件) ,如果胡老师左手拿重量为3的物品, 右手拿重量为6的物品, 则他搬完这次的疲劳度为(6-3)^2 = 9.

2016-07-25 16:34:11 1331 1

原创 HDU 2059 动态规划

题意:额,中文题不翻译。解题思路:看别人的博客才理解的,由于每个加油站都可以选择加油和不加油,为了把所有情况考虑进去,不妨令dp[i]为从起点到第i个加油站所需要的最短时间,那么dp[i]就应该是从0到i-1这些节点充满电然后直接跑到i的最短时间。为什么这样做不会丢失最优解?不妨考虑第4个节点,计算过程中你求出了dp[2]+t2和dp[3]+t3,这就等于说你已经考虑了第3个节点充电或

2016-07-25 09:19:25 291

转载 HDU 3095 哈希+双向搜索

DescriptionPartychen invents a new game named “Eleven Puzzle” .Just like the classic game “Eight Puzzle”,but there some difference between them:The shape of the board is different and there are

2016-07-22 16:22:39 315

原创 POJ 2923 Relocation (状态压缩+背包)

DescriptionEmma and Eric are moving to their new house they bought after returning from their honeymoon. Fortunately, they have a few friends helping them relocate. To move the furniture, they o

2016-07-20 16:32:00 294

原创 hdu 5067 Harry And Dig Machine (状态压缩dp)

Description  As we all know, Harry Porter learns magic at Hogwarts School. However, learning magical knowledge alone is insufficient to become a great magician. Sometimes, Harry also has to gain k

2016-07-20 15:13:44 243

原创 POJ 2677 双调欧几里得旅行商问题

John Doe, a skilled pilot, enjoys traveling. While on vacation, he rents a small plane and starts visiting beautiful places. To save money, John must determine the shortest closed tour that connects h

2016-07-20 14:57:55 742

原创 HDU-1072-nightmare

Ignatius had a nightmare last night. He found himself in a labyrinth with a time bomb on him. The labyrinth has an exit, Ignatius should get out of the labyrinth before the bomb explodes. The initial

2016-07-09 13:54:28 222

原创 HDU-2437-Jerboas

Jerboas are small desert-living animals, which resemble mice with a long tufted tail and very long hind legs. Jerboas shelter in well-hidden burrows. They create two types of burrow: temporary and p

2016-07-09 13:38:20 377

空空如也

空空如也

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

TA关注的人

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