自定义博客皮肤VIP专享

*博客头图:

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

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

博客底图:

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

栏目图:

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

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

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

原创 如何在Linux服务器中安装并使用自己的指令

一般情况下,大家连接Linux服务器用的都是根指令。何为根指令呢?这个图里运行了两个命令,分别是which gcc:获取当前所使用的gcc指令的执行路径gcc --version:查看当前gcc的版本这两条指令的运行结果分别是/usr/bin/gccgcc (GCC) 4.8.5 20150623 (Red Hat 4.8.5-16)简而言之,当前我调用gcc指令使用的是根目录里的公用指令,版本是4.8.5.但是呢,有时候这样会带来问题,比如我需要更高版本的gcc来编译,那么直接调用根

2020-10-25 13:30:35 267

原创 No module named ignite.engine 解决方案

前言以下解决方案对No module named ignite.metricsNo module named ignite.baseNo module named ignite.contribNo module named ignite.distributedNo module named ignite.handlers效果相同正文前两天组里的一只萌新问了我一个神奇的问题。他说他装了ignite后代码报错说No module named ignite.engine其实是这样的,首先

2020-10-25 12:42:30 8392 6

原创 拉格朗日乘子法与KKT条件核心原理(小白都能看懂)

问题背景假设有一座山,山上有一条路。我们只能走在这条路上,其他的地方无法到达。在此基础上,我想知道我始终在路上的情况下,可能达到的最高点及其高度。拉格朗日乘子法和KKT条件解决的正是这么个问题。我们想知道在某个约束条件(山间小路)的限制下,所能达到的最值点(最大高度)。是一个限制条件下的最优化问题。拉格朗日乘子法的应用十分广泛,它是SVM的理论基础,是凸优化的重要研究部分。所以,我们细致地分析一下这一方法的内核。等式约束条件下的最优化我们先从最简单的开始,假设这条盘山公路的宽度无限趋近于于0。如下

2020-10-15 17:15:08 1145

原创 如果#define true false 会发生什么?(全CSDN最详细define讲解)

定义宏可以说是每个敲代码敲得多的人必然需要学习的一项新技能。毕竟代码里有很多地方是重叠的,如果能把这些地方简短地表示出来可以大大缩减工作量。比如博主打ACM的时候就特别喜欢定义这么一个宏#define rep(i, x, y) for(int i= x; i < y; i++)这样子一来,for循环少了80%,变成了简短的rep,可以说是非常爽了。你有没有想过?宏比你想的有意思得多。事先说明,博主全文的代码均使用GCC 4.9.2编译。文章目录#define true false#de

2020-10-15 00:12:00 6041 2

原创 为什么对偶问题一定是凸优化问题?

文章目录

2020-10-14 17:34:28 3544 1

原创 如何用python爬取e-hentai的图片

前言本来这是个正经的图片爬取教程,但是考虑到正经的教程一向是不会有人看的,所以干脆满足一下各位老绅士的心理,改成了E站的爬图教学。事先声明,本博客本质上还是个爬虫教学,所以不会提供任何ehentai访问方式和黄涩链接(代码本身也无法自动翻墙访问ehentai)。由于E站访问的问题,爬虫的效率具体也和网络稳定率有关,所以失败并不一定是代码有问题。博主并不常访问E站(不要说了,真的全是因为你们喜欢),所以对相关的页面并不是十分了解,如果有些页面反复使用该爬虫仍无法运行,那就可能是触及到了博主的知识盲区。(

2020-10-07 21:09:07 53261 6

原创 CV中的gallery和probe究竟是什么?

博主最早是做Re-ID(行人重识别)中遇到这个问题的,当时在网上粗略地百度了一下gallery和probe,很多人说可以翻译为训练集和测试集,深入学习后发现完全是两个东西。为了防止继往开来者继续被误导,就写了这篇博客帮大家细致区分一下。首先大家得了解一个事实,那就是无论是gallery还是probe都是仅在测试集出现的概念(更说明训练集和测试集的翻译是错的),因为人脸识别的任务本身就是给你一张人脸图片,让你从一个巨大的数据库中寻找匹配的照片以判断这张新的照片是谁。这个数据库就是gallery。galle

2020-10-07 11:51:46 3036 2

原创 2020数学建模国赛B题穿越沙漠个人解析

前言博主发这篇文章的时候国赛早就结束了,仅仅是出于给自己留个纪念以及交流讨论的目的写的博客。所以如果你对我不在比赛那几天发的行为感到不满,请直接退出就好,我也没觉得自己的想法多么优秀,能够断言自己是答案。不当之处欢迎各位大佬指正,但是抬杠还请放过。包括CSDN、B乎在内的很多平台也都发布了一些解析。这里插句题外话。凡是在比赛期间在这些平台发布答案的统统不要全信,因为你要明白,这么大胆的人十有八九是不打比赛的,不然不但方便了自己的竞争对手,而且被DQ岂不血亏?既然不打比赛,他对题目的思考就不可能很深入,一

2020-09-18 15:02:43 28202 2

原创 UVA-12369 Cards 概率DP

题目DescriptionTaha has got a standard deck of cards with him. In additionto the 52 regular ones, there are 2 joker cards. Every regularcard has a rank and a suit. The ranks in ascending order are:A, 2, 3, 4, 5, 6, 7, 8, 9, T, J, Q and K. The suit of a

2020-09-17 20:36:30 133

原创 HDU 4578 Transformation 懒标记

题目链接:HDU 4578 Transformation题目Problem DescriptionYuanfang is puzzled with the question below:There are n integers, a1, a2, …, an. The initial values of them are 0. There are four kinds of operati...

2019-10-19 23:25:27 164

原创 POJ 1177 Picture 线段树+扫描线

题目链接:POJ 1177 Picture题目DescriptionA number of rectangular posters, photographs and other pictures of the same shape are pasted on a wall. Their sides are all vertical or horizontal. Each rectangle...

2019-10-04 16:35:53 147

原创 UVA 1619 Feel Good 线段树二分

题目链接:UVA 1619 Feel Good题目DescriptionBill is developing a new mathematical theory for human emotions. His recent investigations are dedicated to studying how good or bad days influent people’s memo...

2019-09-13 10:41:49 206

原创 POJ 2182 Lost Cows 权值线段树

题目链接:POJ 2182 Lost Cows题目DescriptionN (2 <= N <= 8,000) cows have unique brands in the range 1…N. In a spectacular display of poor judgment, they visited the neighborhood ‘watering hole’ and...

2019-09-11 22:01:50 149

原创 POJ 2184 Cow Exhibition 背包问题

题目链接:POJ 2184 Cow Exhibition题目Description“Fat and docile, big and dumb, they look so stupid, they aren’t muchfun…”Cows with Guns by Dana LyonsThe cows want to prove to the public that they ar...

2019-09-11 21:46:25 127

原创 POJ 2576 Tug of War 背包问题

题目链接:POJ 2576 Tug of War题目DescriptionA tug of war is to be arranged at the local office picnic. For the tug of war, the picnickers must be divided into two teams. Each person must be on one team o...

2019-09-11 21:32:26 171

原创 POJ 2482 Stars in Your Window 线段树+扫描线

题目DescriptionFleeting time does not blur my memory of you. Can it really be 4 years since I first saw you? I still remember, vividly, on the beautiful Zhuhai Campus, 4 years ago, from the moment I s...

2019-09-05 16:38:11 152

原创 POJ 1151 Atlantis 线段树扫描线

题目DescriptionThere are several ancient Greek texts that contain descriptions of the fabled island Atlantis. Some of these texts even include maps of parts of the island. But unfortunately, these map...

2019-09-04 23:06:27 121

原创 Robots 2019icpc南京网络赛 DAG概率DP

题目DescriptionGiven a directed graph with no loops which starts at node 1 and ends at node nn.There is a robot who starts at 1, and will go to one of adjacent nodes or stand still with equal probabi...

2019-09-04 22:53:35 172

原创 BZOJ-4318 OSU! 概率DP

题目链接:BZOJ-4318 OSU!题目Descriptionosu 是一款群众喜闻乐见的休闲软件。我们可以把osu的规则简化与改编成以下的样子:一共有n次操作,每次操作只有成功与失败之分,成功对应1,失败对应0,n次操作对应为1个长度为n的01串。在这个串中连续的 X个1可以贡献X^3 的分数,这x个1不能被其他连续的1所包含(也就是极长的一串1,具体见样例解释)现在给出n,以及...

2019-08-17 17:25:29 148

原创 BZOJ-1076 奖励关 概率+状压DP

题目链接:BZOJ-1076 奖励关题目Description你正在玩你最喜欢的电子游戏,并且刚刚进入一个奖励关。在这个奖励关里,系统将依次随机抛出k次宝物,每次你都可以选择吃或者不吃(必须在抛出下一个宝物之前做出选择,且现在决定不吃的宝物以后也不能再吃)。宝物一共有n种,系统每次抛出这n种宝物的概率都相同且相互独立。也就是说,即使前k-1次系统都抛出宝物1(这种情况是有可能出现的,...

2019-08-14 00:32:22 93

原创 HDU 6644 - 11 Dimensions 数位DP

题目链接:HDU 6644 - 11 Dimensions题目Problem Description11 Dimensions is a cute contestant being talented in math. One day, 11 Dimensions came across a problem but didn’t manage to solve it. Today you ar...

2019-08-10 19:57:33 218

原创 HDU-6621 主席树+二分优化

题目链接:HDU-6621 K-th Closest Distance题目Problem DescriptionYou have an array: a1, a2, , an and you must answer for some queries.For each query, you are given an interval [L, R] and two numbers p an...

2019-08-03 16:41:49 79

原创 数据结构——静态主席树(主席树第一部分)

定义可持久化线段树。据说是某大佬学不会划分树,所以自己研究出了这一更为高效的算法(不愧是大佬,%%%)。由于主席树博大精深,这里分成几种类型的主席树分别讨论(无修改,维护修改)。作用查询区间内某个数出现次数、查找区间第kkk大值。原理学主席树,首先要学会权值线段树。权值线段树的概念比较基础。我给你一个数组aaa,你统计出这个数组里有那些数,排个序,再另开一个数组bbb储存这些数各自的出现...

2019-08-03 16:40:21 1324

原创 POJ-3245 Corn Fields 状压dp

题目链接:POJ-3245 Corn Fields题目DescriptionFarmer John has purchased a lush new rectangular pasture composed of M by N (1 ≤ M ≤ 12; 1 ≤ N ≤ 12) square parcels. He wants to grow some yummy corn for the ...

2019-08-01 21:06:08 195

原创 Codeforces 148D Bag of mice 简单概率dp

题目链接:Codeforces 148D Bag of mice题目DescriptionThe dragon and the princess are arguing about what to do on the New Year’s Eve. The dragon suggests flying to the mountains to watch fairies dancing in ...

2019-07-28 20:48:32 110

原创 HDU 4405 Aeroplane chess 概率dp入门

题目链接:HDU 4405 Aeroplane chess题目Problem DescriptionHzz loves aeroplane chess very much. The chess map contains N+1 grids labeled from 0 to N. Hzz starts at grid 0. For each step he throws a dice(a d...

2019-07-28 17:36:00 90

原创 数据结构——ST表

定义倍增查询表作用区间查询,单点多层次查询,求LCA原理倍增思想,能够快速向上推进查询。模板void init(){ for(int j = 1; j < 20; j++) for(int i = 1; i <= n; i++) st[i][j] = st[st[i][j-1]][j-1];}int query(int a, int b) /...

2019-07-27 21:08:15 185

原创 HDU 4507 吉哥系列故事——恨7不成妻 数位dp(超级恶心)

题目链接:HDU 4507 吉哥系列故事——恨7不成妻题目Problem Description单身!  依然单身!  吉哥依然单身!  DS级码农吉哥依然单身!  所以,他生平最恨情人节,不管是214还是77,他都讨厌!    吉哥观察了214和77这两个数,发现:  2+1+4=7  7+7=72  77=711  最终,他发现原来这一切归根到底都是因为和7有关!所以...

2019-07-26 19:46:21 155

原创 HDU 3652 - B-number 数位dp入门

题目链接:HDU 3652 - B-number题目Problem DescriptionA wqb-number, or B-number for short, is a non-negative integer whose decimal form contains the sub- string “13” and can be divided by 13. For example, 1...

2019-07-20 17:16:21 162

原创 数据结构——树状数组

定义树状的数组 (废话,你就是偷懒不想查)作用求出一段区间元素计算得到的值原理其实就是简化过的线段树啦 (你是不是懒癌发作了)不过树状数组求出的是从1开始的连续区间,若不从1开始,还得计算两个值再对这两个值计算得出答案模板#define lowbit(x) x&(-x) int tree[maxn]; void build(int n){ for(int i = 1...

2019-07-18 16:55:51 110

原创 数据结构——单调队列

定义内部元素单调递增/递减的队列操作作用求出一个数组内第一个大于等于一个数x的数求出数组里每个定长连续区间的最值原理加入一个元素时,若队列不为空且队尾元素大于/小于当前元素的值时,弹出队尾,重复该操作直至队列为空或队尾元素小于等于/大于等于新元素,新元素入队模板while(!dq.empty()) dq.pop_back();for(int j = 1; j <= b; j...

2019-07-18 12:31:39 161

原创 CodeForces - 1183H Subsequences (hard version) 特殊数位dp

题目链接:CodeForces - 1183H Subsequences (hard version)题目DescripionThe only difference between the easy and the hard versions is constraints.A subsequence is a string that can be derived from another ...

2019-07-18 11:28:42 315

原创 POJ 1185 炮兵阵地 状压dp

题目链接:POJ 1185 炮兵阵地题目Description司令部的将军们打算在NM的网格地图上部署他们的炮兵部队。一个NM的地图由N行M列组成,地图的每一格可能是山地(用"H" 表示),也可能是平原(用"P"表示),如下图。在每一格平原地形上最多可以布置一支炮兵部队(山地上不能够部署炮兵部队);一支炮兵部队在地图上的攻击范围如图中黑色区域所示:如果在地图中的灰色所标识的平原上部署一支炮...

2019-07-16 17:32:23 112

原创 HDU 3001 - Travelling 限制性TSP

题目链接:HDU 3001 - Travelling题目Problem DescriptionAfter coding so many days,Mr Acmer wants to have a good rest.So travelling is the best choice!He has decided to visit n cities(he insists on seeing al...

2019-07-12 19:09:32 87

原创 HDU 5711 - Ingress TSP+优先队列贪心

题目链接:HDU 5711 - Ingress题目Problem DescriptionBrickgao, who profited from your accurate calculating last year, made a great deal of money by moving bricks. Now he became ``gay shy fool’’ again and re...

2019-07-12 18:49:54 135

原创 ZOJ 4114 Flipping Game 动态规划

题目链接:ZOJ 4114 Flipping Game题目DescriptionLittle Sub loves playing the game Flip Me Please. In the game, lights, numbered from 1 to , are connected separately to switches. The lights may be either ...

2019-07-11 20:44:38 228 2

原创 UVA 11491 - Erasing and Winning 贪心水题

题目链接:UVA 11491 - Erasing and Winning(考虑到UVA的访问不是很方便,这里就放个vjudge的链接吧)题目DescriptionJuliano is a fan of the TV show Erasing and Winning, where participants are selected in a draw andreceive money for...

2019-07-11 00:53:17 325

原创 POJ 2688 - Cleaning Robot 搜索+TSP

题目链接:POJ 2688 - Cleaning Robot题目DescriptionHere, we want to solve path planning for a mobile robot cleaning a rectangular room floor with furniture.Consider the room floor paved with square tiles ...

2019-07-11 00:41:43 203

原创 HDU 5067 - Harry And Dig MachineTSP问题

题目链接:HDU 5067题目Problem DescriptionAs we all know, Harry Porter learns magic at Hogwarts School. However, learning magical knowledge alone is insufficient to become a great magician. Sometimes, Harr...

2019-07-11 00:35:33 114

原创 HDU 6024 动态规划

HDU 6024 动态规划题目Problem DescriptionHDU’s n classrooms are on a line ,which can be considered as a number line. Each classroom has a coordinate. Now Little Q wants to build several candy shops in the...

2019-05-26 15:27:21 162

空空如也

空空如也

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

TA关注的人

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