自定义博客皮肤VIP专享

*博客头图:

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

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

博客底图:

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

栏目图:

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

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

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

原创 Codeforces 1027D 图论

题目:D. Mouse Hunttime limit per test2 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputMedicine faculty of Berland State University has just finished...

2018-08-20 12:33:23 623

原创 mnist 多层感知机 及 模型保存和重新加载

前一篇文章中写了mnist的两种训练方法,今天尝试自己搭建网络。这次,搭建了一个只含两层隐层和一层dropout层本模型训练速度很快,且训练正确率达到了98%以上。此外,本代码中还包含了保存模型和再次导入模型的内容。具体代码如下:# -*- coding: utf-8 -*-"""Created on Thu Aug 16 10:02:18 2018@author: cz...

2018-08-16 16:24:09 364 1

原创 mnist 神经网络——tensorflow基础

使用两层卷积层搭建的卷积神经网络,实现mnist的识别。使用了两层卷积+池化层,一层全连接层(fully connected layer),并在全连接层中使用dropout以防止过拟合。代码:# -*- coding: utf-8 -*-"""Created on Sat Jul 21 05:13:22 2018@author: czx"""import tensorf...

2018-07-24 21:45:08 258

原创 MNIST softmax——tensorflow初学

花了一上午终于搞定了anaconda,tensorflow,使用spyder IDE写机器学习代码tensorflow入门 MNIST手写数字识别。模仿着教程的代码写,也算小有收获。以下代码:# -*- coding: utf-8 -*-"""Created on Fri Jul 20 14:12:45 2018@author: czx"""# create a sof...

2018-07-20 22:55:15 233

原创 codeforcces 1000C 模拟+思维

C. Covered Points Counttime limit per test3 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputYou are given nn segments on a coordinate line; each endpoint of every segm...

2018-07-01 10:50:13 409

原创 Codeforces 1000B 贪心+模拟

B. Light It Uptime limit per test1 secondmemory limit per test256 megabytesinputstandard inputoutputstandard outputRecently, you bought a brand new smart lamp with programming features. At first, you ...

2018-07-01 10:41:30 427

原创 Codeforecs 991D 暴力模拟

D. Bishwocktime limit per test1 secondmemory limit per test256 megabytesinputstandard inputoutputstandard outputBishwock is a chess figure that consists of three squares resembling an "L-bar". This fi...

2018-07-01 10:33:10 264

原创 Codeforces 991C 二分

C. Candiestime limit per test1 secondmemory limit per test256 megabytesinputstandard inputoutputstandard outputAfter passing a test, Vasya got himself a box of nn candies. He decided to eat an equal a...

2018-07-01 10:29:23 729

原创 Codeforces 991B 水题

B. Getting an Atime limit per test1 secondmemory limit per test256 megabytesinputstandard inputoutputstandard outputTranslator's note: in Russia's most widespread grading system, there are four grades...

2018-07-01 10:25:43 328

原创 Codeforces 982C dfs

C. Cut 'em all!time limit per test1 secondmemory limit per test256 megabytesinputstandard inputoutputstandard outputYou're given a tree with nn vertices.Your task is to determine the maximum possible ...

2018-06-15 18:04:51 446 1

原创 Codeforces 989C 思维

C. A Mist of Florescencetime limit per test1 secondmemory limit per test256 megabytesinputstandard inputoutputstandard outputAs the boat drifts down the river, a wood full of blossoms shows up on the ...

2018-06-14 21:24:40 341

原创 Codeforces 990D 图论+思维

D. Graph And Its Complementtime limit per test2 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputGiven three numbers n,a,bn,a,b. You need to find an adjacency matrix of...

2018-06-14 20:14:28 468

原创 Codeforces 990C 水题

C. Bracket Sequences Concatenation Problemtime limit per test2 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputA bracket sequence is a string containing only character...

2018-06-14 20:06:01 263

原创 codeforces 990B 水题

B. Micro-Worldtime limit per test2 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputYou have a Petri dish with bacteria and you are preparing to dive into the harsh mic...

2018-06-14 19:59:21 248

原创 Codeforces 975B 水题

B. Mancalatime limit per test1 secondmemory limit per test256 megabytesinputstandard inputoutputstandard outputMancala is a game famous in the Middle East. It is played on a board that consists of 14 ...

2018-05-27 20:30:53 374

原创 Codeforces 985C 贪心

C. Liebig's Barrelstime limit per test2 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputYou have m = n·k wooden staves. The i-th stave has length ai. You have to assem...

2018-05-27 19:59:25 345

原创 Codeforces 985B 水题

B. Switches and Lampstime limit per test3 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputYou are given n switches and m lamps. The i-th switch turns on some subset of...

2018-05-27 19:38:30 376

原创 Codeforces 975C 二分

C. Valhalla Siegetime limit per test2 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputIvar the Boneless is a great leader. He is trying to capture Kattegat from Lagert...

2018-05-27 19:15:20 242

原创 Codeforces 975D 计算几何

Ghosts live in harmony and peace, they travel the space without any purpose other than scare whoever stands in their way.There are nn ghosts in the universe, they move in the OXYOXY plane, each one of...

2018-05-27 19:08:25 447 1

原创 周志华 《机器学习》 习题3 (Matlab实现)

习题3.3 与 习题 3.5 编程实现对率回归、线性判别分析原始数据:其中‘+’表示好瓜,‘o'表示坏瓜对率回归即线性判别分析原理见书。以下为代码及结果,Matlab实现:1、对率回归(逻辑斯蒂回归)clear all; clc;x = importdata('ex4x.txt');y = importdata('ex4y.txt');[m,n]

2018-01-13 11:18:18 2091

原创 poj 2774 后缀数组模板

Long Long MessageTime Limit: 4000MS Memory Limit: 131072KTotal Submissions: 32516 Accepted: 13130Case Time Limit: 1000MSDescriptionThe little cat is majoring

2018-01-10 14:30:05 196

原创 数论(基础欧拉函数)

被数论虐的飞起:弱的数论学习之路第一题:poj2407Given n, a positive integer, how many positive integers less than n are relatively prime to n? Two integers a and b are relatively prime if there are no integers x >

2017-08-04 23:50:13 438

转载 HDU 2255 KM算法—模板

代码转自kuangbin博客:http://www.cnblogs.com/kuangbin/p/3228861.html题目:传说在遥远的地方有一个非常富裕的村落,有一天,村长决定进行制度改革:重新分配房子。 这可是一件大事,关系到人民的住房问题啊。村里共有n间房间,刚好有n家老百姓,考虑到每家都要有房住(如果有老百姓没房子住的话,容易引起不安定因素),每家必须分配到一间房子且只

2017-07-23 09:55:46 300

原创 求逆序数两种方法:线段树/归并排序

题目:HDU 4911/poj 2299第一反应是暴力扫一遍,时间复杂度O(N^2),这在处理10^5的数量级的数据时一定会超时。以下给出两种将时间复杂度优化至O(NlogN)的方法以HDU 4911为例,求逆序数的模板题方法1,归并排序法:在区间[l,r]上,mid=(l+r)>>1;将两串已经排好序的序列a[l...m]与a[m+1...r]进行归并排序。设l当a[

2017-07-21 10:36:06 958

原创 次小生成树 ACM Contest and Blackout

题目:Problem AACM contest and Blackout In order to prepare the “The First National ACM School Contest”(in 20??) the major of the city decided to provide all the schools with a reliable sourc

2017-07-19 10:02:32 359

原创 The Unique MST 2017 暑期 学习 次小生成树

Given a connected undirected graph, tell if its minimum spanning tree is unique.Definition 1 (Spanning Tree): Consider a connected, undirected graph G = (V, E). A spanning tree of G is a subgrap

2017-07-17 10:52:02 271

原创 UESTC 1006 最长上升序列 脑洞+简单dp

一个数的序列B=(b1,b2,⋯,bS),当b1b2⋯bS 的时候,我们称这个序列是上升的。对于给定的一个序列A=(a1,a2,⋯,aN),我们可以得到一些上升的子序列(ai1,ai2,⋯,aiK),这里1≤i1i2⋯iK≤N。比如,对于序列(1,7,3,5,9,4,8),有它的一些上升子序列,如(1,7),(3,4,8)等等。这些子序列中最长的长度是4,比如子序列(1,3,5,8)

2017-07-15 23:51:41 526

原创 Connections in Galaxy War并查集+set+脑洞

In order to strengthen the defense ability, many stars in galaxy allied together and built many bidirectional tunnels to exchange messages. However, when the Galaxy War began, some tunnels were destro

2017-07-11 10:46:41 295

原创 分组并查集(种类并查集)

这是并查集的一种变形。在这种并查集中,节点被分为了不同的n类(类别一般较少)。其大致结构与并查集相同,但区别在于,分组并查集需要一个relation数组,来存储节点的种类。这就需要注意结点与其根节点之间的关系。下面具体问题具体分析。A Bug's LifeBackground Professor Hopper is researching the sexual behavi

2017-07-09 20:50:30 1956

原创 kuangbin 最短路 H题(如何将看似拓扑的问题转化成floyd )

N (1 ≤ N ≤ 100) cows, conveniently numbered 1..N, are participating in a programming contest. As we all know, some cows code better than others. Each cow has a certain constant skill rating that is un

2017-07-08 17:40:01 320

原创 hdu 2012 A计划

题目:A计划Time Limit: 3000/1000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 22366    Accepted Submission(s): 5619Problem Description可怜的公主在一次次被魔王掳走一次次被骑士

2017-07-08 13:21:46 224

原创 Codeforces 369C DFS

C. Valera and Electionstime limit per test1 secondmemory limit per test256 megabytesinputstandard inputoutputstandard outputThe city Valera lives in is going to hold elec

2017-06-16 20:35:01 393

原创 CodeForces 352B 水题

B. Jeff and Periodstime limit per test1 secondmemory limit per test256 megabytesinputstandard inputoutputstandard outputOne day Jeff got hold of an integer sequence a1,

2017-06-14 14:08:58 254

原创 Codeforces 329B bfs

B. Biridian Foresttime limit per test2 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputYou're a mikemon breeder currently in the middle o

2017-06-08 11:24:09 378

原创 POJ 3318 算法学习:随机化算法

题目:Matrix MultiplicationTime Limit: 2000MS Memory Limit: 65536KTotal Submissions: 18772 Accepted: 4035DescriptionYou are given three n × n matrices A, B andC.

2017-06-05 15:03:06 428

原创 算法学习--快速幂 POJ 3641

题目:Pseudoprime numbersTime Limit: 1000MS Memory Limit: 65536KTotal Submissions: 9959 Accepted: 4250DescriptionFermat's theorem states that for any prime number

2017-05-22 20:48:15 312

原创 codeforces 320B bfs

题目:B. Ping-Pong (Easy Version)time limit per test2 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputIn this problem at each moment you

2017-05-16 18:57:35 305

原创 二分+最小生成树

G. 铁路修复计划Time limit per test: 2.0 secondsTime limit all tests: 15.0 secondsMemory limit: 256 megabytesAccept / Submit: 146 / 1219在 A 国有很多城际铁路。这些铁路都连接两个城市(城市从 1 到 n 编号),可以双向通行

2017-05-14 15:25:26 281

原创 浙江大学 数据结构—堆的操作

题目:05-树7 堆中的路径   (25分) 将一系列给定数字插入一个初始为空的小顶堆H[]。随后对任意给定的下标i,打印从H[i]到根结点的路径。输入格式:每组测试第1行包含2个正整数NNN和MMM(≤1000\le 1000≤1000),分别是插入元素的个数、以及需要打印的路径条数。下一行给出区间[-10000, 10000]内的NNN个要被插入一个初始为空的小

2017-05-11 11:26:37 558

原创 Codeforces 801C 二分法

C. Voltage Keepsaketime limit per test2 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputYou have n devices that you want to use simultane

2017-05-10 20:13:11 443

空空如也

空空如也

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

TA关注的人

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