自定义博客皮肤VIP专享

*博客头图:

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

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

博客底图:

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

栏目图:

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

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+

?

  • 博客(64)
  • 收藏
  • 关注

原创 Tensorflow实现卷积神经网络识别mnist数字

很久以前写的代码,冒个泡from tensorflow.examples.tutorials.mnist import input_dataimport tensorflow as tf mnist = input_data.read_data_sets("MNIST_data/",one_hot=True)def weight_variable(shape): initial ...

2019-09-25 23:46:05 259

原创 Andrew Ng Coursera week2 Logistic Regression with a Neural Network mindset 编程作业代码祥注与数据集

这是coursea吴恩达老师的Neural Networks and Deep Learning week2的编程作业和离线数据

2019-02-27 13:59:55 338

原创 深度学习笔记: 逻辑回归模型和二元分类

多元分类(classification)在机器学习中,多元分类 是将示例归类为多个(大于两个)类别中的一类(将示例归为两类中的一类被称为二元分类)。一些分类算法自然地允许使用超过两类,另一些自然是二元分类算法;然而,它们可以通过多种策略转化为多元分类。多元分类不应该和多标签分类相混淆,多标签分类要为每个示例预测多个标签,即一个示例可以同时被归为多个类别。所以,要解决多元分类问题,只需将其简...

2019-02-27 12:27:09 2304

原创 深度学习笔记:什么是神经网络

定义人工神经网络(英语:Artificial Neural Network,ANN),简称神经网络(Neural Network,NN)或类神经网络,在机器学习和认知科学领域,是一种模仿生物神经网络(动物的中枢神经系统,特别是大脑)的结构和功能的数学模型或计算模型,用于对函数进行估计或近似。神经网络由大量的人工神经元联结进行计算。大多数情况下人工神经网络能在外界信息的基础上改变内部结构,是一种自...

2019-01-31 11:00:43 391

原创 Matlab:如何实现二元函数的图像和线性规划

在数学建模竞赛的过程中,常常出现要求线性规划的情景,这时用matlab来作图比较直观例:x>=63.25y>=5933.95z>=200.5z=x+y代码如下x=63.25:20:100; @这是x的下限:步长:上限y=5933.95:20:10000;[x, y] = meshgrid(x,y);@绘制x,y轴z = x+y;surf(x, y, z) ...

2019-01-27 09:18:00 3541

原创 UVA - 1395 Slim Span Kruskal算法变形

Slim SpanDescriptionGiven an undirected weighted graph G, you should find one of spanning trees specified as follows.The graph G is an ordered pair (V, E), where V is a set of vertices {v1, v2, …, ...

2018-11-07 21:35:20 216

原创 Educational Codeforces Round 52 (Rated for Div. 2) C. Make It Equal

C. Make It EqualThere is a toy building consisting of n towers. Each tower consists of several cubes standing on each other. The i-th tower consists of hi cubes, so it has height hi.Let’s define ope...

2018-11-04 23:46:30 130

原创 Educational Codeforces Round 52 (Rated for Div. 2) A. Vasya and Chocolate

A. Vasya and ChocolateThere is a special offer in Vasya’s favourite supermarket: if the customer buys a chocolate bars, he or she may take b additional bars for free. This special offer can be used a...

2018-11-04 23:43:57 158

原创 Codeforces Round #517 (Div. 2, based on Technocup 2019 Elimination Round B. Curiosity Has No Limits

B. Curiosity Has No LimitsWhen Masha came to math classes today, she saw two integer sequences of length n−1 on the blackboard. Let’s denote the elements of the first sequence as ai (0≤ai≤3), and the...

2018-11-04 23:40:27 157

原创 Technocup 2019 - Elimination Round 2 A. Golden Plate

A. Golden PlateYou have a plate and you want to add some gilding to it. The plate is a rectangle that we split into w×h cells. There should be k gilded rings, the first one should go along the edge o...

2018-11-04 23:36:45 186

原创 Codeforces Round #518 (Div. 2) B. LCM 因数分解

B. LCMIvan has number b. He is sorting through the numbers a from 1 to 1018, and for every a writes [a,b]a on blackboard. Here [a,b] stands for least common multiple of a and b. Ivan is very lazy, th...

2018-11-04 23:27:30 554

原创 Codeforces Round #518 (Div. 2) A. Birthday 思维

A. BirthdayIvan is collecting coins. There are only N different collectible coins, Ivan has K of them. He will be celebrating his birthday soon, so all his M freinds decided to gift him coins. They a...

2018-11-04 23:12:34 407 3

原创 LightOJ - 1224 DNA Prefix trie字典树 毒瘤题

DNA PrefixGiven a set of n DNA samples, where each sample is a string containing characters from {A, C, G, T}, we are trying to find a subset of samples in the set, where the length of the longest co...

2018-10-04 01:58:33 345 1

原创 POJ 2001 Shortest Prefixes 字典树 trie模板题

Shortest PrefixesDescriptionA prefix of a string is a substring starting at the beginning of the given string. The prefixes of “carbon” are: “c”, “ca”, “car”, “carb”, “carbo”, and “carbon”. Note tha...

2018-10-04 01:44:35 289

原创 在Ubuntu 18.04上畅玩 Cataclysm: Dark Days Ahead:大灾变!

作为一个Cdda的狂热玩家,当然要在拥有的各个平台和设备畅玩Cdda啦,从Windows到Linux再到Mac和安卓IOS,Cdda都是完美兼容了的,这次我就来教各位幸存者如何在Ubuntu上畅玩Cdda! 首先,我们需要去下载cdda的包,鉴于官网的包已经太过古老,所以我们直接去github上下载 https://github.com/CleverRaven/Cataclysm-DDA ...

2018-09-17 01:36:17 4005 2

原创 2018 Summer Manacher(马拉车)算法 C和C++版

最长回文子串如果给你一个字符串abcbcbd,这个字符串里所包含的最长的回文子串是什么呢?毫无疑问,是bcbcb,它的长为6, 我们给出一个暴力简洁的算法:遍历整个字符串,对于每一个字符,都向左和右边找相等的字符,每次更新最大值,直到遍历完成。这样的算法看似简单,但是会遇到一个问题:对于奇数长度的回文串好处理,但对于偶数长度的回文串就比较麻烦。同时,这种算法的最坏复杂度为n^2,我们需要更加...

2018-09-05 22:16:28 1820

原创 2018 Summer KMP算法浅析和在算法竞赛中的应用

KMP算法浅析kmp算法是什么?kmp算法是一种字符串匹配算法,它使用的典型场景如下:现在有字符串A,B。问B是否是A的子串,如果是,B在A中出现了几次? A:aaabbcabbccc B:abbc 如果使用朴素的匹配方法,则思路如下 1.先找到A中第一个出现”a的位置flag 2.判断A中flag+1位置上是否是’b’ 3.如果2中成立,则判断下一位是否匹配,若不...

2018-09-03 19:08:02 516

原创 Ubuntu18.04 下使用Flatpak稳定安装TIM、微信、迅雷和百度云!

Ubuntu18.04 下使用Flatpak稳定安装TIM、微信、迅雷和百度云!国际惯例,废话不多说,先上效果图 Flatpak是什么在安装之前,我们先认识一下Flatpak是什么: Flatpak(前世为xdg-app) 是一种用于构建,分发,安装和运行应用程序的技术。它主要针对的是Linux桌面,通过在沙箱中隔离应用程序来提高Linux桌面的安全性,允许应用程序...

2018-09-02 23:23:17 50695 60

原创 2018-Summer之区间dp

区间dp什么是区间dp: 区间dp是解决区间上的一类动态规划问题的方法,例如区间合并、区间符号配对等等,其思想是将大区间分成小区间,结合动态转移方程来求小区间的最优解,最终合并成大区间的最优解区间dp的一般思路 1.确定dp数组初始值 2.确定转移方程 3.枚举区间、分割点 4.dp[1][N]一般是最后答案 5.区间dp的复杂度一般为n^2,数据规模为几百区间dp的一般模...

2018-09-02 00:33:16 261

原创 c语言课程设计-旅馆管理系统 基于链表

自己写的一个基础的管理系统,使用链表实现,能实现登入、建立链表、插入信息、查询信息、信息排序、信息删减、保存链表至本地和从本地数据中创建链表等功能 首先是链表的建立和节点插入,我是首先建立链表(第一次使用软件),之后的信息添加则通过添加节点实现struct save *creat()//建立链表函数 { struct save *p1,*p2,*head; i...

2018-07-24 23:46:27 2735 1

原创 四种素数筛法:朴素素数筛,埃氏筛,欧拉筛和区间筛 详解

预备知识:1.算术基本定理:任何一个大于1的自然数 N,如果N不为质数,那么N可以唯一分解成有限个质数的乘积 2. 若一个数可以进行因数分解,则得到的两个数一定是有一个>=sqrt(x),另一个<=sqrt(x).朴素算法复杂度:O(n√n) 介绍:这个算法是最简单的素数判断算法+遍历素组,耗时长#include<bits/stdc++.h>#d...

2018-07-04 01:06:45 7402 4

原创 01背包方案计数

状态转移方程:F[j]=F[j]+F[j-G[i]]#include<bits/stdc++.h>using namespace std;int hav[150];int val[150];int dp[20009];int n,v; int ans=0;int solve(){ for(int i=1;i<=n;i++) for(...

2018-04-30 23:38:11 502

原创 DFS求连通块 UVa 572 Oil Deposits

Oil DepositsThe GeoSurvComp geologic survey company is responsible for detecting underground oil deposits. GeoSurvComp works with one large rectangular region of land at a time, and creates a grid t...

2018-03-08 21:34:45 143

原创 uva-524 Prime Ring Problem 回溯法

回溯法搜索+素数判断 本题的输出格式及其坑,需要注意#include<cstdio>#include<iostream>#include<cstring>#include<cmath>using namespace std;int vis[20];int cur=0;int ans[20];int n;bool pri...

2018-03-06 20:55:51 187

原创 回溯法 八皇后和N皇后

八皇后在国际象棋棋盘上放置八个皇后,要求每两个皇后之间不能直接吃掉对方。 Input 无输入。 Output 按给定顺序和格式输出所有八皇后问题的解(见Sample Output)。 Sample Input Sample Output No. 1 1 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0...

2018-03-06 17:49:45 509

原创 并查集之关系分类 POJ - 1703 Find them, Catch them

Find them, Catch themThe police office in Tadu City decides to say ends to the chaos, as launch actions to root up the TWO gangs in the city, Gang Dragon and Gang Snake. However, the police first ne...

2018-02-10 21:50:35 301

原创 并查集之关系分类 POJ - 1182 食物链

食物链动物王国中有三类动物A,B,C,这三类动物的食物链构成了有趣的环形。A吃B, B吃C,C吃A。 现有N个动物,以1-N编号。每个动物都是A,B,C中的一种,但是我们并不知道它到底是哪一种。 有人用两种说法对这N个动物所构成的食物链关系进行描述: 第一种说法是”1 X Y”,表示X和Y是同类。 第二种说法是”2 X Y”,表示X吃Y。 此人对N个动物,用上述两种说法,一...

2018-02-10 21:47:57 150

原创 并查集之求连通块的数量 HDU - 1213 How Many Tables

How Many TablesProblem Description Today is Ignatius’ birthday. He invites a lot of friends. Now it’s dinner time. Ignatius wants to know how many tables he needs at least. You have to notice that ...

2018-02-10 21:40:59 269

原创 并查集之求连通块的数量 HDU1232 畅通工程

畅通工程Problem Description某省调查城镇交通状况,得到现有城镇道路统计表,表中列出了每条道路直接连通的城镇。省政府“畅通工程”的目标是使全省任何两个城镇间都可以实现交通(但不一定有直接的道路相连,只要互相间接通过道路可达即可)。问最少还需要建设多少条道路? Input 测试输入包含若干测试用例。每个测试用例的第1行给出两个正整数,分别是城镇数目N ( < ...

2018-02-10 21:37:25 223

原创 Codeforces Round #460 (Div. 2) C. Seat Arrangements

C. Seat ArrangementsSuppose that you are in a campus and have to go for classes day by day. As you may see, when you hurry to a classroom, you surprisingly find that many seats there are already occ

2018-02-01 00:58:33 220

原创 Codeforces Round #460 (Div. 2) B. Perfect Number

B. Perfect NumberWe consider a positive integer perfect, if and only if the sum of its digits is exactly 10. Given a positive integer k, your task is to find the k-th smallest perfect positive integ

2018-02-01 00:54:11 205

原创 Codeforces Round #460 (Div. 2) A. Supermarket

A. SupermarketWe often go to supermarkets to buy some fruits or vegetables, and on the tag there prints the price for a kilo. But in some supermarkets, when asked how much the items are, the clerk w

2018-02-01 00:51:28 223

原创 Codeforces Round #459 (Div. 2) B. Radio Station

B. Radio Stationtime limit per test2 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputAs the guys fried the radio station facili

2018-01-30 22:22:55 171

原创 Codeforces Round #459 (Div. 2) A. Eleven

A. Eleventime limit per test1 secondmemory limit per test256 megabytesinputstandard inputoutputstandard outputEleven wants to choose a new name for herself. As

2018-01-30 21:56:34 200

原创 动态规划之最长上升子序列 HDU1950

最长上升子序列问题求的是形如一个数列a={4,2,3,1,5},那么这个数列的最长上升子序列就是{2,3,5}求解这种问题有两种方法,第一种是求当前元素之前元素的最长上升子序列,得到递推公式dp[i]=max(1,dp[j]+1)意思是仅当前元素或者前一元素递推得到的最长上升子序列+当前元素,第二种是求相等长度的上升子序列,最后一个元素越小,则该子序列的“上升潜力”越大。方法一:int dp[ma...

2018-01-28 23:13:49 252

原创 快速幂

快速幂思想:将指数二进制展开 复杂度:log n//quick_pow#include<iostream>#include<cstdio>using namespace std;int quick_pow(long long a,long long b){ long long ans=1,base=2; while(b!=0) { if(b&1)//从右至左二进最后一

2017-12-25 21:06:16 154

原创 教你在debian 9上完美安装deepin qq 8.9

教你在debian 9上完美安装deepin qq 8.9废话不多说,先上效果图 教程开始安装crossover crossover是一个类似于wine的环境,使用户能在linux/mac上运行windows程序,对比起wine来说,crossover的兼容性大大增强 并且crossover的价格并不贵,只需要128rmb一年就可以使用 这里给出官方下载地址,试用15天是免费的 http

2017-12-21 23:37:13 11778 1

原创 简单的动态规划——装箱问题

装箱问题告诉你箱子的容积为多少,告诉你有N件物品和每一件物品的体积,问如何选择物品才能令箱子的剩余容积最小。 搜索递归#include<bits/stdc++.h>using namespace std;int p;int v[40];int n;int dp(int i,int j){ int ans=j; if(i==0) {ans=j;return ans;} else

2017-12-20 20:25:06 3292

原创 pair排序 线段覆盖 贪心

题目链接 思路非常简单的一道贪心题目,但是在给pair排序的时候出了一点问题 我在使用重载<时发现不起作用,询问学长后才知是pair自带了重载,我定义的被覆盖了,解决方法是用自定义函数#include<bits/stdc++.h>using namespace std;int ans=1;pair<int,int>line[110];bool cmp(const pair<int,int>

2017-12-19 21:08:26 168

原创 Codeforces Round #451 (Div. 2) Proper Nutrition 暴力枚举

Proper NutritionVasya has n burles. One bottle of Ber-Cola costs a burles and one Bars bar costs b burles. He can buy any non-negative integer number of bottles of Ber-Cola and any non-negative integer

2017-12-18 08:34:53 187

空空如也

空空如也

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

TA关注的人

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