- 博客(87)
- 资源 (2)
- 收藏
- 关注
原创 hdu1495 非常可乐 (bfs)
非常可乐Time Limit: 2000/1000 MS (Java/Others)Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 38624Accepted Submission(s): 15103Problem Description大家一定觉的运动以后喝可乐是一件很惬意的事情,但是seeyou却不这么认为。因为每次当seeyou买了可乐以后,阿牛就要求和seeyou一起分享这一瓶可乐,而且一定...
2020-09-16 11:56:48 143
原创 poj 1062 昂贵的聘礼
昂贵的聘礼Time Limit:1000MS Memory Limit:10000K Total Submissions:64699 Accepted:19696 Description年轻的探险家来到了一个印第安部落里。在那里他和酋长的女儿相爱了,于是便向酋长去求亲。酋长要他用10000个金币作为聘礼才答应把女儿嫁给他。探险家拿不出这么多金币,便请求酋长降低要求。酋长说:"嗯,如果你能够替我弄到大祭司的皮袄,我可以只要8000金币。如果你能够弄来他的...
2020-09-14 21:50:03 155
原创 hdu 2074 叠框(排版题)
叠筐Time Limit: 1000/1000 MS (Java/Others)Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 32762Accepted Submission(s): 8674Problem Description需要的时候,就把一个个大小差一圈的筐叠上去,使得从上往下看时,边筐花色交错。这个工作现在要让计算机来完成,得看你的了。Input输入是一个个的三元组,...
2020-08-30 19:47:44 296
原创 poj3320 尺取法+map
Jessica's Reading ProblemTime Limit:1000MS Memory Limit:65536K Total Submissions:23726 Accepted:7998 DescriptionJessica's a very lovely girl wooed by lots of boys. Recently she has a problem. The final exam is coming, yet she ha...
2020-08-09 13:15:44 124
原创 Poj3061 尺取法
SubsequenceTime Limit:1000MS Memory Limit:65536K Total Submissions:33132 Accepted:13783 DescriptionA sequence of N positive integers (10 < N < 100 000), each of them less than or equal 10000, and a positive integer S (S &l...
2020-08-09 12:48:53 123 1
原创 poj 1011 木棒长度
Url:http://poj.org/problem?id=1011搜索的经典题目。有一堆不同长度木棒,问你用这些木棒首尾相接所组成的一系列长度相等的木棒的最短长度。思路就是用DFS搜索,关键在剪枝:1.答案的长度必然可以整除总长度2.每次选取的第一根木棒必须能够组成一根目标长度,如果这根不行,那么后续的也不需要做了,直接换下一个长度就可以了#include<iostream>#include<stdio.h>#include<cstring>
2020-06-10 11:35:32 184
原创 Python Plt颜色配色一览(热力图)
环境:python 3.7可用配色:['Accent','Accent_r','Blues','Blues_r','BrBG','BrBG_r','BuGn','BuGn_r','BuPu','BuPu_r','CMRmap','CMRmap_r',\'Dark2','Dark2_r','GnBu','GnBu_r','Greens','Greens_r','Greys','Grey...
2020-05-06 12:49:53 25380 10
原创 Poj2010(堆-优先队列)
Moo University - Financial AidTime Limit:1000MS Memory Limit:30000K Total Submissions:14489 Accepted:4304 DescriptionBessie noted that ...
2020-04-12 20:24:41 178
原创 POJ2502(最短路)(dji)
SubwayTime Limit:1000MS Memory Limit:65536K Total Submissions:17354 Accepted:5544 DescriptionYou have just moved from a quiet Waterloo neighbourhood to a big, noisy city. I...
2020-03-22 14:25:51 173
原创 jungle roads|POJ 1251(最小生成树)(kruskal)
Jungle RoadsTime Limit:1000MS Memory Limit:10000K Total Submissions:38849 Accepted:18287 DescriptionThe Head Elder of the tropical island of Lagrishan has a problem. A b...
2020-03-21 15:20:19 112
原创 最长上升子序列
D:最大上升子序列和描述一个数的序列bi,当b1 < b2 < ... < bS的时候,我们称这个序列是上升的。对于给定的一个序列(a1, a2, ...,aN),我们可以得到一些上升的子序列(ai1, ai2, ..., aiK),这里1 <= i1 < i2 < ... < iK <= N。比如,对于序列(1, 7, 3, 5, 9, ...
2020-03-04 12:26:09 300
原创 leecode78(求子序列)
递归方法#include<iostream>#include<stdio.h>#include<vector>using namespace std;void dfs(int num,vector<vector <int> > &ans,vector<int>vec,vector<int>nu...
2020-03-03 19:44:14 197
转载 TensorFlow卷积函数tf.nn.conv2d
tf.nn.conv2d在TensorFlow中使用tf.nn.conv2d实现卷积操作,其格式如下:tf.nn.conv2d( input, filter, strides, padding, use_cudnn_on_gpu=True, data_format='NHWC', dilations=[1, 1, 1, 1]...
2020-02-10 16:05:58 335
转载 Latex+VScode配置
转载自:https://zhuanlan.zhihu.com/p/19779481?columnSlug=LaTeX https://www.jianshu.com/p/dc0ffa4368e3一、安装TexLive2019这里参考这篇文章。下载之后,可能是这样:对于.iso文件,在部分系统下可以自动挂载,双击即可(Windows 8/Ubuntu 14/04)。对于...
2019-12-06 23:50:31 309
原创 XV6作业1 bigger file
1,Preliminaries实验前,要根据mit的文档修改三个地方。首先,打开Makefile,将CPUS改为1,即为使用一个CPU。然后依然在Makefile中的QEMUOPTS上面添加QEMUEXTRA = -snapshot。最后,修改param.h中的#define FSSIZE 20000,扩大文件范围。2,开始下载下来big.c文件放在xv6的文件...
2019-10-04 21:11:57 669
转载 AC自动机算法详解 (转载)
AC自动机算法详解 (转载)https://www.cnblogs.com/cmmdc/p/7337611.html首先简要介绍一下AC自动机:Aho-Corasick automation,该算法在1975年产生于贝尔实验室,是著名的多模匹配算法之一。一个常见的例子就是给出n个单词,再给出一段包含m个字符的文章,让你找出有多少个单词在文章里出现过。要搞懂AC自动机,先得有模式树(字典树)...
2019-02-21 16:19:18 682
原创 HihoCoder - 1847
B - 等分数字串 HihoCoder - 1847 给定一个只包含0-9的字符串S,请你判断能否将S划分为两个或两个以上连续的子串,使得每一个子串中的数字总和都相等。Input输入包含多组数据。第一行包含一个整数N,代表数据组数。 以下N行,每行包含一个字符串S。 对于50%的数据,2 ≤ |S| ≤ 100 对于100%的数据,1 ≤ N ≤ 5, 2 ≤...
2019-02-21 14:41:47 470
原创 HihoCoder - 1846 dfs
A - ABC HihoCoder - 1846 杂货铺老板一共有N件物品,每件物品具有ABC三种属性中的一种或多种。从杂货铺老板处购得一件物品需要支付相应的代价。 现在你需要计算出如何购买物品,可以使得ABC三种属性都在购买的物品中出现,并且支付的总代价最小。Input第一行包含一个整数N。 以下N行,每行包含一个整数C和一个只包含"ABC"的字符串,代表购得该物品的...
2019-02-21 14:39:44 706
原创 poj 3126 bfs+素数筛
#include<iostream>#include<stdio.h>#include<cstring>#include<queue>#include<cmath>#define show(a) cout<<#a<<" = "<<a<&
2019-02-20 19:41:20 111
原创 codeforce 1064D bfs
D. Labyrinthtime limit per test2 secondsmemory limit per test512 megabytesinputstandard inputoutputstandard outputYou are playing some computer game. One of its levels puts you in a ...
2019-02-20 14:40:30 127
原创 hdu 1394 树状数组求逆序数
Problem DescriptionThe inversion number of a given number sequence a1, a2, ..., an is the number of pairs (ai, aj) that satisfy i < j and ai > aj.For a given sequence of numbers a1, a2, ..., ...
2019-02-20 10:22:29 120
转载 树状数组求逆序数(转)
原链接:https://www.cnblogs.com/xiongmao-cpp/p/5043340.html1、什么是逆序数? 在一个排列中,如果一对数的前后位置与大小顺序相反,即前面的数大于后面的数,那么它们就称为一个逆序。一个排列中逆序数的总数就是这个排列的逆序数。 2、用树状数组求逆序数的总数 2.1该背景下树状数组的含义 ...
2019-02-19 15:50:19 108
原创 toj 1196 Web Navigation(模拟)(字符串处理)
D. Web NavigationTime Limit: 1.0 Seconds Memory Limit: 65536K Multiple test filesStandard web browsers contain features to move backward and forward among the pages recently visited. One wa...
2018-12-25 12:10:46 200
原创 toj 1224 HTML(字符串处理)(输入输出格式)
F. HTMLTime Limit: 1.0 Seconds Memory Limit: 65536KIf you ever tried to read a html document on a Macintosh, you know how hard it is if no Netscape is installed. Now, who can forget to instal...
2018-12-25 12:03:50 381
转载 priority_queue的用法(含自定义排序方式)
转载自https://www.cnblogs.com/Deribs4/p/5657746.htmlpriority_queue本质是一个堆。1. 头文件是#include<queue>2. 关于priority_queue中元素的比较 模板申明带3个参数:priority_queue<Type, Container, Functional>,其中Type ...
2018-11-03 10:10:10 1456
原创 hdu1005(矩阵快速幂)
为了练习使用矩阵快速幂就写了矩阵快速幂,其实这道题更方便的做法是找规律,由于n由n-1和n-2确定,而n-1和n-2范围是0到6,所以共有7*7=49种结果,所以49必定是一个循环。#include<iostream>#include<algorithm>#include<stdio.h>#include<cstring>#includ...
2018-10-21 12:50:13 346
原创 hdu1004(字符串统计)
统计出现次数最多的字符串。不太会使用map的方法,就用string数组来记录了所有出现的颜色,然后逐一比较。要记住每次使用前都要清空map。#include<iostream>#include<algorithm>#include<stdio.h>#include<cstring>#include<map>usin...
2018-10-20 22:44:17 235
原创 hdu1003(大数运算)
计算两个大数求和,一般使用int数组存储,变量cnt记录长度,这里为了方便使用了string来简化。#include<iostream>#include<algorithm>#include<stdio.h>#include<cstring>using namespace std;string a,b;int ans[1005];...
2018-10-20 22:07:31 285
原创 hdu 1001
题意极其简单,但是有一种被玩的感觉,因为好久不做题了,WA了几次,才知道结果是32-bit但是中间过程却不一定,要用longlong保证一下#include<iostream>#include<stdio.h>#include<algorithm>#include<map>#include<string.h>#includ...
2018-10-20 21:25:43 166
原创 Jurassic Remains LA 2965(中途相遇法)
【中途相遇法】:首先,如果将每种状态用位表示,就是2^24种状态,1表示奇数个,0表示偶数个。利用异或运算的特殊性,模二加,奇数与奇数异或是偶数。所以我们的目的是找出m个数异或,使他们的结果为0。到这里为止,已经保证了编码的简便性。但是,复杂度任然是难以支撑。朴素的算法为2^24(==16000000)种情况,超时。书中提供“中途相遇法”,将考虑的情况分为两半,一边是2^12(==4096...
2018-10-06 19:43:47 258
转载 线性筛(欧拉函数)(莫比乌斯函数)
原文:https://www.cnblogs.com/Paul-Guderian/p/7723031.html在这里提供三种线性筛的讲解,它们分别是:素数筛,欧拉筛和莫比乌斯筛。 筛法正确性的重要理论依据: 上述函数均为积性函数。积性函数的性质为:若f(x)是一个积性函数,那么对于任意素数a,b,满足f(ab)=f(a)*f(b) ·一些可爱的要点(有助于理解筛法...
2018-09-23 21:52:53 2111
转载 线性素数筛
来源:https://www.jianshu.com/p/f16d318efe9b最low两个星期之前,如果你让我筛一下素数,我会告诉你很简单,然后一顿敲#define SIZE 1000000int main(){ int check[SIZE]; int prime[SIZE] = {0}; int pos; int flag; fo...
2018-09-23 21:21:34 173
原创 C Halt Problem
C Halting ProblemIn computability theory, the halting problem is the problem of determining, from a description of an arbitrary computer program, whether the program will finish running (i.e., halt)...
2018-09-22 20:50:30 284
原创 give gandies(数学题)
传送门:https://nanti.jisuanke.com/t/31716题意:求2的n次方(10^1000000)mod 1e9+7思路:利用费马小定理,a^(p-1)=1(mod p),然后求出次方模1e9+6的结果。求次方模1e9+6的方法是还原过程中每次mod 1e9+6#include <bits/stdc++.h>using namespace std;...
2018-09-16 09:47:17 140
原创 畅通工程续(dijkstra的heap优化模板)
http://acm.hdu.edu.cn/status.php作为dij堆优化的模板,适用于稠密图,码住了。#include<iostream>#include<stdio.h>#include<vector>#include<queue>using namespace std;const int maxn=1004;int ...
2018-09-11 23:47:05 156
原创 Distant Galaxy LA - 3695 (暴力)(图像)
https://vjudge.net/problem/UVALive-3695题意:找出矩形框上最多的星星数。比较暴力,枚举上下边界,然后维护左右边界找出最大值。尝试使用unique()#include <iostream>#include<stdio.h>#include<algorithm>using namespace std;i...
2018-08-25 10:45:21 158
原创 UVAlive - 3029 City Game (图像)(扫描法)
https://vjudge.net/problem/UVALive-3029题意:找出最大的子矩形。只想到了纯暴力,复杂度太高了。白书指导用扫描法,二维的扫描法,利用周围的元素维护当前元素,很微妙了。从上到下设为垂线,up数组记录,如果是R,记为0,否则是同列上面元素+1。从左到右利用lef数组维护,如果是R的话记得记为小于等于0的数,免得影响后续的判断,否则为max(同列上...
2018-08-24 20:47:50 237
原创 uva 2678 subsequnece(lower_bound)
https://vjudge.net/problem/UVALive-2678第一感觉是用滑窗来做,确实可以借助滑窗做,还可以结合前缀和。白书上借此介绍了lower_bound和upper_bound的用法。#include<iostream>#include<stdio.h>#include<algorithm>using namespac...
2018-08-24 18:21:13 116
原创 hud 3743 frosh week (归并排序)(逆序对)
http://acm.hdu.edu.cn/showproblem.php?pid=3743测试模板的一道题,蛮好的。敲了两种板子,白书上的第一种板子有点问题,改了一下,还是不太理解。第二种网上的好理解。#include <iostream>#include<stdio.h>#include<cstring>#include<map...
2018-08-24 15:37:41 185
原创 uva 3905 meteor(扫描线)(图形)
https://vjudge.net/problem/UVALive-3905题目看着麻烦,其实写起来还好。将每一个流星的运动分为X,Y方向上的运动,如果两个方向上都同时满足在范围之内,那么就是流星在方框内的时间范围。扫描时间线的时候直接记录开始和结束的时间就可以了,每次不需要重新计算,而是维护结果就可以了,有点像点灯的题。实现的时候按照白书上的用结构体实现的,其实还可以开两个数组,分...
2018-08-24 13:06:29 163
opengl的库中的静态链接库glext.lib
2019-10-28
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人