自定义博客皮肤VIP专享

*博客头图:

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

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

博客底图:

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

栏目图:

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

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

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

原创 1131. Subway Map (30)

开始用dij求最短路径,结果超时,最后用dfs回溯剪枝,ac了#include<iostream>#include<vector>#include<cstdlib>#include<set>#include<cstring>#pragma warning(disable:4996)using namespace std;struct ArcNode { int line;

2017-03-18 13:14:29 1430

原创 1130. Infix Expression (25)

很水的题,建树,按要求输出即可#include<iostream>#include<string>using namespace std;struct node { string data; int l, r;};node all[25];int root;void InOrderTraver(int index){ int flag = 0;

2017-03-17 18:37:45 504

原创 1129. Recommendation System (25)

题目不难,注意别全部排序,这样会超时#include<iostream>#include<vector>#include<algorithm>using namespace std;int main(){ int N, K; cin >> N >> K; int visited[100000]; vector<int> all; int x;

2017-03-17 18:22:45 475

原创 1128. N Queens Puzzle (20)

简单题#include<string.h>#include<string>#include<iostream>using namespace std;int visited[1005][1005];bool nqueue(){ string s; int N; cin >> N; memset(visited, 0, sizeof(visited));

2017-03-16 20:12:01 581

原创 王道计算机网络--3.6局域网

1.局域网的基本概念和体系结构局域网(LAN)是在一个较小的地理范围(如一个学校)内将各种计算机、外部设备和数据库系统通过双绞线、同轴电缆等连接介质互相连起来,组成资源和信息共享的网络主要特点: ①为一个单位所拥有,且地理范围和站点数目均有限。        ②所有的站共享较高的总带宽(即较高的数据传输速率)③较低的延迟和较低的误码率    ④各站为平等关系

2017-03-16 15:54:54 1310

原创 王道计算机网络--3.5介质访问层

任务:为使用介质的每个节点隔离来自同一信道上其他结点所传送的信号,以协调活动结点的传输。决定广播信道中信道分配的协议属于数据链路层的一个子层,介质访问控制(MAC)子层(物理地址)常见的介质访问控制方法有:信道划分介质访问控制、随机访问介质访问控制、轮询访问介质访问控制1.信道划分介质访问控制:把使用介质的每个设备与来自同一信道的其他设备的通信隔离开来,把时域和频域资源合理地分配给

2017-03-15 15:41:53 1294

原创 考研---数学全书--一元积分学

f(x)在【a,b】上连续,则积分(a,b)f(x)dx存在,且f(x)在[a,b]上一定存在原函数f(x)在【a,b】上有界,且只有有限个间断点,则积分(a,b)f(x)dx存在,而f(x)在[a,b]上不一定存在原函数若f(x)在【a,b】有跳跃间断点,f(x)在[a,b]上一定不存在原函数(原函数是求导后必须等于f(x)的)f(x)为偶函数,积分(0,x)f(x)dx+C是奇

2017-03-15 12:34:40 1019

原创 王道计算机网络--3.1数据链路层的功能...3.4

1.数据链路层的功能:加强物理层传输原始比特流的功能,将物理层提供的可能出错的物理连接改造成逻辑上无差错的链路,⑴为网络层提供服务:数据链路层基本任务是将源机器中来自网络层的数据传输到目标机器网络层。其为网络层提供服务有①无确认的无连接服务(不需先建立链路连接,接收到帧后不需发回确认,对于丢失的帧,交给上层处理,适合实时通信或误码率低的通信信道,比如以太网)

2017-03-14 12:34:39 1878

原创 王道计算机网络--2.2传输介质 2.3物理层设备

1.双绞线、同轴电缆、光纤与无线传输介质传输介质也称为传输媒体,是发送设备和接收设备的物理通道,可分为导向传输介质(固体媒介)、非导向传输介质(传输介质为空气、真空、海水等)⑴双绞线:由两根采用一定规则并排绞合(为了减少对相邻导线的电磁干扰)的、互相绝缘的铜导线组成。        为进一步提高抗电磁干扰能力,可再外面加个金属丝编织成的屏蔽层就是屏蔽双绞线(STP),无屏蔽层的

2017-03-13 18:46:18 1610

原创 考研---数学全书--一元微分学

极值:设f(x)再x=x0的某领域有定义,若存在一个领域U(x0),当x∈U(x0)时有f(x)>=(拐点:连续曲线y=f(x)是的凹、凸弧的交界点称为该曲线的拐点驻点:先序曲线y=f(x)上若f ' (x)=0的解为a,则称其为f(x)的驻点或稳定点、临界点。弧微分:ds=sqrt(1+pow(y ',2) )  曲率:K=abs(dα/ds)=1/R        tan α

2017-03-13 11:53:33 518

原创 考研---数学全书(复合函数的连续性和极限存在性)

复合函数的极限存在性,x->x0,g(x)->u x->u,f(x)->A;x->x0,f(g(x))->A需要一个条件:g(x)在x0的去心领域内不等于g(x0)解释:x->u,f(x)->A是x->u的时候,不包括x=u的情况比如f(x)=x*sin(1/x),x->0的时候,f(x)->0;若g(x)在x0的去心领域内包括g(x)=g(x0)=0的情况,那么f(x)是

2017-03-10 11:40:31 7498 1

原创 王道计算机网络--1.2 计算机网络体系结构与参考模型

1.计算机网络的分层结构目的:为降低协议设计和调试过程的复杂性,便于对网络进行研究、实现和维护,促进标准化工作体系结构:计算机网络各层及其协议的集合。计算机网络及其所应完成的功能的精确定义,它是各层次、各层的协议及层间接口的集合。分层的基本原则:①每层实现相对独立的功能,降低大系统的复杂度②各层之间界面自然清晰,易于理解,各层之间交流尽可能少③各层功能的精确

2017-03-09 20:53:27 843

原创 王道计算机网络--1.1 计算机网络概述摘录

1.计算机网络的概念互连的、自治的计算机系统的集合(通过通信设备与线路相连)随着计算机网络发展的不同阶段,人们对计算机网络提出了不同的定义。1.广义观点只要能实现远程信息处理的系统或 进一步能达到资源共享的系统。其定义了一个计算机通信网络,物理结构上有具有计算机网络的雏形,但资源共享能力弱,是低级阶段2.资格共享观点以能够互相共享资源的方式互联起来的自治计算机系

2017-03-09 15:52:47 1942

原创 1001. Battle Over Cities - Hard Version (35)

这道题其实就是求去掉某节点后的最小生成树的长度,取最大的长度的序号进行输出,如果所有序号最小生成树长度都为0,则输出0#include<iostream>#include<vector>#pragma warning(disable:4996)using namespace std;int N, M, s_max = 0;vector<int> re;int arc[505][505];

2017-03-06 20:16:59 737

原创 1005.Number Sequence

寻找循坏周期,由于只有7*7=49种情况,而且只要相邻位置的数组出现重复就是循环,故再49以内必定会找到循环,然后根据循环来求解(注意未找到循环就结束的情况要额外考虑)#include<iostream>#include<climits>using namespace std;int main(){ int A, B, N; int x[50]; while (cin

2017-03-05 21:36:24 268

原创 1004.Let the Balloon Rise

Problem DescriptionContest time again! How excited it is to see balloons floating around. But to tell you a secret, the judges' favorite time is guessing the most popular problem. When the contest is

2017-03-05 20:04:55 219

原创 1068. 万绿丛中一点红(20)乙级

暴力破解#include<iostream>#include<vector>#include<cmath>#include<map>using namespace std;vector<vector<int>> all;map<int,int> visited;int N, M, T;bool pd(int x, int y){ if (x - 1 >= 0 && y -

2017-03-05 13:24:57 594

原创 1003.Max Sum

Problem DescriptionGiven a sequence a[1],a[2],a[3]......a[n], your job is to calculate the max sum of a sub-sequence. For example, given (6,-1,5,4,-7), the max sum in this sequence is 6 + (-1) + 5 + 4

2017-03-05 11:20:55 392

原创 1002.A + B Problem II

Problem DescriptionI have a very simple problem for you. Given two integers A and B, your job is to calculate the Sum of A + B.InputThe first line of the input contains an integer T(1<=T<=20) which

2017-03-05 11:18:44 290

原创 1001.Sum Problem

Problem DescriptionHey, welcome to HDOJ(Hangzhou Dianzi University Online Judge).In this problem, your task is to calculate SUM(n) = 1 + 2 + 3 + ... + n.InputThe input will consist of a series of in

2017-03-05 11:17:20 304

原创 1000. A + B Problem

Problem DescriptionCalculate A + B.InputEach line will contain two integers A and B. Process to end of file.OutputFor each case, output A + B in one line.Sample Input1 1Sample Output2简单题#inclu

2017-03-05 11:16:06 349

原创 1127. ZigZagging on a Tree (30)

按照中序后序建好树,然后按题目要求输出#include<iostream>#include<vector>#include<algorithm>using namespace std;struct node { int data; node *l, *r; node() { l = r = NULL; }};vector<node> all;int N;int

2017-03-04 21:59:29 269

原创 1126. Eulerian Path (25)

题目已经说证明了,那么按他的意思来就好了,注意判断图是否连通#include<iostream>#include<vector>using namespace std;int N, M;int arc[505][505] = {};int degree[505] = {};int visited[505] = {};void dfs(int index){ for (int

2017-03-04 21:37:14 616

原创 1125. Chain the Ropes (25)

考试的时候英语读了半天,也是很简单题,从小到大排序,然后依次合并,最后即是结果(小于结果的最大整数)#include<iostream>#include<vector>#include<algorithm>using namespace std;int main(){ int N; cin >> N; vector<double> all(N); for (

2017-03-04 21:13:13 370

原创 1124. Raffle for Weibo Followers (20)

题目很简单,只是考的时候想的太多#include<iostream>#include<vector>#include<string>#include<map>using namespace std;int main(){ vector<string> all; map<string, int> f; int M, N, S; cin >> M >> N >

2017-03-04 21:08:36 256

原创 7. Reverse Integer

Reverse digits of an integer.Example1: x = 123, return 321Example2: x = -123, return -321click to show spoilers.Note:The input is assumed to be a 32-bit signed integer. Your function should return 0

2017-03-03 14:17:14 336

原创 6. ZigZag Conversion

The string "PAYPALISHIRING" is written in a zigzag pattern on a given number of rows like this: (you may want to display this pattern in a fixed font for better legibility)P A H NA P L S I I GY

2017-03-03 13:25:03 103

原创 5. Longest Palindromic Substring

暴力破解,对s每一位置求最大AA型和ABA型的回文串class Solution {public: string longestPalindrome(string s) {//ABA型和AA型 int t = 0; int maxlen = 0; string re; while (2 * ((int)s.size() - t) >= maxlen)

2017-03-03 12:07:34 216

原创 4. Median of Two Sorted Arrays

There are two sorted arrays nums1 and nums2 of size m and n respectively.Find the median of the two sorted arrays. The overall run time complexity should be O(log (m+n)).Example 1:nums1 = [1, 3]nums2

2017-03-03 10:47:01 198

原创 3. Longest Substring Without Repeating Characters

Given a string, find the length of the longest substring without repeating characters.Examples:Given "abcabcbb", the answer is "abc", which the length is 3.Given "bbbbb", the answer is "b", with the le

2017-03-03 10:09:26 187

原创 2. Add Two Numbers

You are given two non-empty linked lists representing two non-negative integers. The digits are stored in reverse order and each of their nodes contain a single digit. Add the two numbers and return it

2017-03-03 10:05:39 173

原创 1. Two Sum

Given an array of integers, return indices of the two numbers such that they add up to a specific target.You may assume that each input would have exactly one solution, and you may not use the same ele

2017-03-03 10:03:40 195

原创 问题 D: 上帝视角

时间限制: 1 Sec内存限制: 128 MB提交: 558解决: 139提交状态题目描述给一棵二叉树的层序遍历序列和中序遍历序列,求这棵二叉树的先序遍历序列和后序遍历序列,并给出从右往左、从右上往左下、从上往下分别能看到的结点个数。注意,此处均把二叉树的每条边都设置为等长,角度为45度,因此结点可能在视觉上重叠。所谓从右往左看是指,对同一层的结点,右边的结点会挡住左边的结点,这样同一层结点就

2017-03-02 14:57:59 424

原创 问题 B: 万妖穴

时间限制: 1 Sec内存限制: 64 MB提交: 1020解决: 255提交状态题目描述“万妖穴中有若干小穴,每处小穴中皆有一只恶妖。小穴外设有封印,汝需消灭指定几处小穴中的恶妖方能解除该小穴封印,进而消灭穴中恶妖。”“此处石壁所刻便是万妖穴中各穴的封印解除关系。”“万妖穴中或有部分小穴未设封印,汝可以此作为突破口。”“吾将根据石壁所示,将各穴消灭顺序给予汝,汝自珍重。”输入每个输入文件中

2017-03-02 14:42:02 943

原创 问题 A: 那些年我们一起考过的浙大

时间限制: 1 Sec内存限制: 64 MB提交: 1354解决: 425提交状态题目描述时光如梭。浙大计算机考研初试总共有四门课,分值分别为100、100、150、150,其分数线分为单科线和总分线,其中四门课的单科线分别是a、b、c、d,总分线是L。也就是说,只有当每门课的分数都不低于该门课的单科线、并且总分不低于总分线时,才能够进入复试。为了简化题目,此处不考虑补分政策及其他政策。现在给

2017-03-02 14:39:55 578

原创 问题 C: 某计算器的超电磁炮(加减乘除括号表达式求值)

时间限制: 1 Sec内存限制: 64 MB提交: 510解决: 156提交状态题目描述输入由非负整数、+、-、*、/、(、)组成的计算表达式,计算该表达式的值。输入每个输入文件中一组数据。输入只有一行,不超过200个字符,其中不存在空格。数据保证表达式一定合法,且所有的整数都不小于0、不大于1024。中间结果保证不超过15位有效数位精度。输出输出一行,即表达式的值,结果精度保留小数点后2

2017-03-02 14:37:04 1038

原创 背包问题之01背包、完全背包和多重背包

这类问题的例子:带着背包的贼闯入一家珠宝店,如果他偷的东西超过某一重量M,背包就会破裂,设每件东西都有特定的价值和重量。这个贼的两难之处在于,既要使所偷东西的总价值最大,又不能使总重量超过M。> 01背包01背包:n件东西的重量分别为, w[1],w[2],w[3]…w[n],价值分别为c[1],c[1]…c[n]。设dp[w][i]代表发现第i件物品时,在总价值不超过w的前提下能带走的最大价值(即

2017-03-01 17:43:56 971

空空如也

空空如也

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

TA关注的人

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