自定义博客皮肤VIP专享

*博客头图:

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

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

博客底图:

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

栏目图:

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

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

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

原创 Codeforces Round #404 (Div. 2) C题

C. Anton and Fairy Tale time limit per test 1 second memory limit per test 256 megabytes input standard input output standard outputAnton likes to listen to fairy tales, especially when Danik,

2017-03-16 19:49:32 338

原创 Codeforces Round #404 (Div. 2) B题

B. Anton and Classes time limit per test 4 seconds memory limit per test 256 megabytes input standard input output standard outputAnton likes to play chess. Also he likes to do programming. No

2017-03-16 19:24:02 476

原创 Codeforces Round #404 (Div. 2) A题

A. Anton and Polyhedronstime limit per test2 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputAnton’s favourite geometric figures are regular polyhedrons. Note that ther

2017-03-16 19:13:19 365

原创 Codeforces Round #402 (Div2)E题

E. Bitwise Formula time limit per test 3 seconds memory limit per test 512 megabytes input standard input output standard outputBob recently read about bitwise operations used in computers: AND

2017-03-15 21:27:50 364

原创 Codeforces Round #402 (Div. 2) B题

B. Weird Roundingtime limit per test1 secondmemory limit per test256 megabytesinputstandard inputoutputstandard outputPolycarp is crazy about round numbers. He especially

2017-03-15 21:14:32 408

原创 Codeforces Round #402 (Div2)D题

D. String Game time limit per test 2 seconds memory limit per test 512 megabytes input standard input output standard outputLittle Nastya has a hobby, she likes to remove some letters from word

2017-03-15 20:53:54 373

原创 Codeforces Round #402 (Div2)C题

C. Dishonest Sellers time limit per test 2 seconds memory limit per test 256 megabytes input standard input output standard outputIgor found out discounts in a shop and decided to buy n items.

2017-03-15 20:44:01 744

原创 cs231n assignment1--two_layer_net

神经网络部分。要先把理论知识搞的比较清楚才好写作业。梯度推导参考: http://www.jianshu.com/p/004c99623104multiclass 梯度推导: 调整参数部分,一开始想要把参数综合起来找一个最优参数,结果发现一次训练跑了一个小时,于是我就对每个参数进行单独训练,找到一个最好的参数,保留下来,换另一个参数。最后的测试正确率有54.8%import numpy as

2017-03-15 17:21:30 5702 2

原创 cs231n assignment1--Softmax

svm实现完了,这部分会相对比较轻松,大部分和svm类似。 关于梯度的推导,我主要参考这篇文章 http://www.jianshu.com/p/004c99623104multiclass 梯度推导: 向量化的实现和svm类似,实现过svm应该不难实现softmax以下是softmax.py代码:import numpy as npfrom random import shuffle

2017-03-15 16:00:34 2693 1

原创 cs231n assignment1--svm

本节作业的难点主要是svm的梯度向量的求解,在完成作业的时候找了大量的资料才求解出来。首先是矩阵求导的问题,我是参考以下博客: http://www.cnblogs.com/huashiyiqike/p/3568922.html在这作业中我们只需要用到以下公式 d(xT∗A/dx=AT)d(x^{T}*A/dx=A^{T})下面是损失函数的公式: Li=∑j!=yi[max(0,wTjxi−w

2017-03-15 15:52:13 3331 1

原创 Codeforces Round #402 (Div. 2) A题

A. Pupils Redistributiontime limit per test1 secondmemory limit per test256 megabytesinputstandard inputoutputstandard outputIn Berland each high school student is charac

2017-03-14 23:40:25 240

原创 cs231 assignment1--KNN

这次作业的主要的难点: 实现训练集和测试集之间距离的方法,主要是用向量形式来实现的部分 交叉检验的部分import numpy as npfrom collections import Counterclass KNearestNeighbor(object): """ a kNN classifier with L2 distance """ def __init__(self):

2017-03-11 16:55:42 2120

原创 poj1741 树分治

题目链接:http://poj.org/problem?id=1741可参考论文:https://wenku.baidu.com/view/e087065f804d2b160b4ec0b5.html题意:求树上的点对(u,v)个数,点对满足dist(u,v)解法:树上点分治。树上递归求解问题,为了防止递归过程中树退化成一条链,我们每次递归时找树的重心。重心求

2017-03-04 23:40:05 359

原创 poj1655 求树的重心

题目链接:http://poj.org/problem?id=1655题意:求树的重心。解法:对树进行dfs,记录对于某个节点它的子树大小son[u],在dfs的时候可以处理出来这个点的所有子树节点个数的最大值Max,而n-son[u]可以处理出它父节点延伸出去的节点数目,那么答案便可以找到了。#include<cstdio>#include<cstring>#include<algorithm

2017-02-28 23:54:37 234

原创 Codeforces Round #396 (Div. 2)

A. Mahmoud and Longest Uncommon Subsequence题意: 求最长不公共序列解法: 如果两个字符串完全一样,那么必定不满足题意,否则长的那一段必定不为另一段的子序列,所以取两段最值即可。#include<cstdio>#include<string.h>#include<algorithm>using namespace std;const int N=

2017-02-26 20:00:09 241

翻译 《深度学习21天实战caffe》第6天 学习笔记

这一节的学习主要是通过手写体数字识别例程来熟悉caffe的基本使用。首先下载MNIST数据集$ cd data/mnist$ ./get_mnist.sh下载到四个文件 训练集(图片)train-images-idx3-ubyte 训练集(标签)train-labels-idx1-ubyte 测试集(图片)t10k-images-idx3-ubyte 测试集(标签)t10k-labels-

2017-02-22 22:54:03 2276

原创 Ubuntu16.04下配置caffe(仅CPU)

第二次配置caffe环境,依旧把之前犯过的错误重新走了一遍,不会配置的地方还是忘了,所以打算通过博客记录下来,方便以后学习使用。1.安装依赖包$ sudo apt-get install libprotobuf-dev libleveldb-dev libsnappy-dev libopencv-dev libhdf5-serial-dev protobuf-compiler$ sudo

2017-02-22 12:29:21 6346 1

原创 poj1950 深搜

DessertDescriptionFJ has a new rule about the cows lining up for dinner. Not only must the N (3 <= N <= 15) cows line up for dinner in order, but they must place a napkin between each pair of cows with

2016-02-25 20:36:39 411

原创 poj2299

Ultra-QuickSortTime Limit: 7000MS Memory Limit: 65536KTotal Submissions: 51330 Accepted: 18828DescriptionIn this problem, you have to analyze a particular sorting a

2016-02-15 20:54:02 402

原创 hdu1426&3111 数独问题

题目链接: http://acm.hdu.edu.cn/showproblem.php?pid=1426 http://acm.hdu.edu.cn/showproblem.php?pid=3111这两题均可用dfs即可 line[i][j] 记录第i行j数字有没有出现 row[i][j] 记录第i列j数字有没有出现 sqr[b[i][j]][k] 记录第i行第j列在其3*3方块中有无出现

2016-01-29 18:41:16 387

原创 hdu5547 dfs

SudokuTime Limit: 3000/1000 MS (Java/Others)    Memory Limit: 65535/65535 K (Java/Others)Total Submission(s): 646    Accepted Submission(s): 238Problem DescriptionYi Sima was one of the be

2016-01-29 13:45:57 585

原创 Codeforces616C The Labyrinth

C. The Labyrinthtime limit per test1 secondmemory limit per test256 megabytesinputstandard inputoutputstandard outputYou are given a rectangular field of n × m ce

2016-01-27 19:34:10 955 1

原创 hdu1078 记忆化搜索

FatMouse and CheeseProblem DescriptionFatMouse has stored some cheese in a city. The city can be considered as a square grid of dimension n: each grid location is labelled (p,q) where 0 <= p < n and 0

2016-01-25 11:26:23 231

原创 hdu1080

Human Gene FunctionsTime Limit: 2000/1000 MS (Java/Others)    Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 2866    Accepted Submission(s): 1619Problem DescriptionIt is wel

2016-01-25 09:00:49 312

原创 hdu1160 dp+路径记录

FatMouse's SpeedTime Limit: 2000/1000 MS (Java/Others)    Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 12849    Accepted Submission(s): 5641Special JudgeProblem Description

2016-01-16 11:16:00 285

原创 hdu1978

How many waysProblem Description这是一个简单的生存游戏,你控制一个机器人从一个棋盘的起始点(1,1)走到棋盘的终点(n,m)。游戏的规则描述如下:1.机器人一开始在棋盘的起始点并有起始点所标有的能量。2.机器人只能向右或者向下走,并且每走一步消耗一单位能量。3.机器人不能在原地停留。4.当机器人选择了一条可行路径后,当他走到这条路径的终点

2016-01-15 12:05:42 311

原创 hdu1421

搬寝室Problem Description搬寝室是很累的,xhd深有体会.时间追述2006年7月9号,那天xhd迫于无奈要从27号楼搬到3号楼,因为10号要封楼了.看着寝室里的n件物品,xhd开始发呆,因为n是一个小于2000的整数,实在是太多了,于是xhd决定随便搬2*k件过去就行了.但还是会很累,因为2*k也不小是一个不大于n的整数.幸运的是xhd根据多年的搬东西的经验发现每搬一次的疲劳度是和

2016-01-15 00:40:15 243

原创 hdu1171

免费馅饼Problem Description都说天上不会掉馅饼,但有一天gameboy正走在回家的小径上,忽然天上掉下大把大把的馅饼。说来gameboy的人品实在是太好了,这馅饼别处都不掉,就掉落在他身旁的10米范围内。馅饼如果掉在了地上当然就不能吃了,所以gameboy马上卸下身上的背包去接。但由于小径两侧都不能站人,所以他只能在小径上接。由于gameboy平时老呆在房间里玩游戏,虽然在游戏中是

2016-01-09 23:10:11 233

原创 hdu1171 二进制优化背包问题

Big Event in HDUProblem DescriptionNowadays, we all know that Computer College is the biggest department in HDU. But, maybe you don’t know that Computer College had ever been split into Computer Colleg

2016-01-09 11:06:55 252

原创 hdu2577

How to TypeProblem DescriptionPirates have finished developing the typing software. He called Cathy to test his typing software. She is good at thinking. After testing for several days, she finds that

2016-01-09 01:09:32 246

原创 hdu1069 最长上升子序列变形

Monkey and BananaProblem DescriptionA group of researchers are designing an experiment to test the IQ of a monkey. They will hang a banana at the roof of a building, and at the mean time, provide the m

2016-01-09 00:11:57 267

原创 hdu2571 简单dp

命运Problem Description穿过幽谷意味着离大魔王lemon已经无限接近了! 可谁能想到,yifenfei在斩杀了一些虾兵蟹将后,却再次面临命运大迷宫的考验,这是魔王lemon设下的又一个机关。要知道,不论何人,若在迷宫中被困1小时以上,则必死无疑! 可怜的yifenfei为了去救MM,义无返顾地跳进了迷宫。让我们一起帮帮执着的他吧! 命运大迷宫可以看成是一个两维的方格阵列,如下

2016-01-08 00:19:49 217

原创 hdu3998 最长上升子序列及其个数 dp或dp+最大流

SequenceProblem DescriptionThere is a sequence X (i.e. x[1], x[2], …, x[n]). We define increasing subsequence of X as x[i1], x[i2],…,x[ik], which satisfies follow conditions: 1) x[i1] < x[i2],…,Input

2016-01-07 00:38:31 457 1

原创 poj2533&&hdu1087 最长上升子序列问题

题目链接: http://poj.org/problem?id=2533 http://acm.hdu.edu.cn/showproblem.php?pid=1087最长上升子序列问题: 思路1:dp[i]表示以i结尾的最长上升子序列 转移方程:dp[i]=max{dp[j]+1}; 思路2:dp[i]表示长度为i的最小元素升序排列: iterator lower_bound( cons

2016-01-06 18:34:12 267

原创 hdu1203

I NEED A OFFER!Problem DescriptionSpeakless很早就想出国,现在他已经考完了所有需要的考试,准备了所有要准备的材料,于是,便需要去申请学校了。要申请国外的任何大学,你都要交纳一定的申请费用,这可是很惊人的。Speakless没有多少钱,总共只攒了n万美元。他将在m个学校中选择若干的(当然要在他的经济承受范围内)。每个学校都有不同的申请费用a(万美元),并且Sp

2016-01-06 10:13:10 277

原创 hdu 3790 最短路

最短路径问题Problem Description给你n个点,m条无向边,每条边都有长度d和花费p,给你起点s终点t,要求输出起点到终点的最短距离及其花费,如果最短距离有多条路线,则输出花费最少的。Input输入n,m,点的编号是1~n,然后是m行,每行4个数 a,b,d,p,表示a和b之间有一条边,且其长度为d,花费为p。最后一行是两个数 s,t;起点s,终点。n和m为0时输入结束。 (1Out

2016-01-06 10:03:31 238

原创 hdu2955 dp(背包)

**Robberies**Problem DescriptionThe aspiring Roy the Robber has seen a lot of American movies, and knows that the bad guys usually gets caught in the end, often because they become too greedy. He has d

2016-01-05 11:32:07 234

原创 hdu1272(并查集)

题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=1272思路: 1、判断所有点是否联通,用边数=顶点数-1 来判断 2、判断有没成环,用并查集来判断两个点是否联通,如果已经联通,则会成环。 3、特判 直接读入空图即,a==0&&b==0 输出Yes代码:#include<cstdio>#include<cstring>const int N=

2015-12-25 23:24:34 274

原创 hdu3410 单调队列

**Passing the Message**Problem Description What a sunny day! Let’s go picnic and have barbecue! Today, all kids in “Sun Flower” kindergarten are prepared to have an excursion. Before kicking of

2015-12-22 11:07:10 305

原创 hdu1548 最短路

**A strange lift**Problem DescriptionThere is a strange lift.The lift can stop can at every floor as you want, and there is a number Ki(0 <= Ki <= N) on every floor.The lift have just two buttons: up a

2015-12-18 17:15:31 437

空空如也

空空如也

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

TA关注的人

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