自定义博客皮肤VIP专享

*博客头图:

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

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

博客底图:

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

栏目图:

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

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+

Wilbert的博客

我们背靠万丈深渊 我们只能大步向前

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

原创 POJ-2585 Window Pains

DescriptionBoudreaux likes to multitask, especially when it comes to using his computer. Never satisfied with just running one application at a time, he usually runs nine applications, each in its

2016-07-24 19:18:00 452

原创 POJ-1094 Sorting It All Out

DescriptionAn ascending sorted sequence of distinct values is one in which some form of a less-than operator is used to order the elements from smallest to largest. For example, the sorted sequenc

2016-07-24 16:31:33 417

原创 POJ-1562 Oil Deposits

DescriptionThe 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

2016-07-24 11:51:10 345

原创 POJ-1659 Frogs' Neighborhood

Description未名湖附近共有N个大小湖泊L1, L2, ..., Ln(其中包括未名湖),每个湖泊Li里住着一只青蛙Fi(1 ≤ i ≤ N)。如果湖泊Li和Lj之间有水路相连,则青蛙Fi和Fj互称为邻居。现在已知每只青蛙的邻居数目x1, x2, ..., xn,请你给出每两个湖泊之间的相连关系。Input第一行是测试数据的组数T(0 ≤ T ≤ 20)。每组数

2016-07-24 10:59:55 358

原创 HDU-5726 GCD

Problem DescriptionGive you a sequence of N(N≤100,000) integers : a1,...,an(0ai≤1000,000,000). There are Q(Q≤100,000) queries. For each query l,r you have to calculate gcd(al,,al+1,...,ar)

2016-07-21 23:13:01 1116

原创 HDU-5723 Abandoned country

Problem DescriptionAn abandoned country has n(n≤100000) villages which are numbered from 1 to n. Since abandoned for a long time, the roads need to be re-built. There are m(m≤1000000) roads

2016-07-21 19:59:29 374

原创 AOJ-795 西瓜理发记(三)

Description顺利潜入勺林寺几天后,方丈给了西瓜一个光荣而艰巨的任务——打扫寺庙中的道路。同时给了西瓜一张勺林寺的地图。西瓜这才知道,勺林寺中总共有n座房子,但道路只有n-1条,这n-1条道路连接了寺中的所有房子,即保证在任何两座房子都能沿着道路抵达。好在西瓜人缘不错,他知道每座房子中都有个自己的朋友,只要给他们每个人打个电话,让他到自己这里来,顺便把路也扫了,即给某座房子

2016-07-20 15:09:16 716

原创 Codeforces-698B Fix a Tree

A tree is an undirected connected graph without cycles.Let's consider a rooted undirected tree with n vertices, numbered 1 through n. There are many ways to represent such a tree. One way is to

2016-07-20 14:59:24 481

原创 Codeforces-698A Vacations

Vasya has n days of vacations! So he decided to improve his IT skills and do sport. Vasya knows the following information about each of this n days: whether that gym opened and whether a contest was

2016-07-20 14:55:07 598

原创 Codeforces-699B One Bomb

You are given a description of a depot. It is a rectangular checkered field of n × m size. Each cell in a field can be empty (".") or it can be occupied by a wall ("*").You have one bomb. If you

2016-07-20 14:45:59 442

原创 Codeforces-699A Launch of Collider

There will be a launch of a new, powerful and unusual collider very soon, which located along a straight line. n particles will be launched inside it. All of them are located in a straight line and

2016-07-20 14:40:47 576

原创 HDU 5721Palace

Palace  Accepts: 28  Submissions: 307 Time Limit: 8000/4000 MS (Java/Others)  Memory Limit: 262144/262144 K (Java/Others)问题描述为了寻找失去的爱人Cupid,Psyche需要完成Venus的最后一项任务:前往冥界,收集一盒冥界

2016-07-18 20:17:05 580

原创 HDU-5720 Wool

Wool  Accepts: 109  Submissions: 770 Time Limit: 8000/4000 MS (Java/Others)  Memory Limit: 262144/262144 K (Java/Others)问题描述黎明时,Venus为Psyche定下了第二个任务。她要渡过河,收集对岸绵羊身上的金羊毛。那些绵羊

2016-07-18 20:13:37 374

原创 HDU-5719 Arrange

Arrange  Accepts: 221  Submissions: 1401 Time Limit: 8000/4000 MS (Java/Others)  Memory Limit: 262144/262144 K (Java/Others)问题描述Cupid一不小心将爱情之箭射到了自己,他爱上了Psyche。这引起了他的母亲Venus

2016-07-18 20:09:54 827

原创 HDU-5718 Oracle

Oracle  Accepts: 599  Submissions: 2576 Time Limit: 8000/4000 MS (Java/Others)  Memory Limit: 262144/262144 K (Java/Others)问题描述曾经有一位国王,统治着一片未名之地。他膝下有三个女儿。三个女儿中最年轻漂亮的当属Psych

2016-07-18 20:03:53 373

原创 Codeforces-696B Puzzles

Barney lives in country USC (United States of Charzeh). USC has n cities numbered from 1 through n and n - 1 roads between them. Cities and roads of USC form a rooted tree (Barney's not sure why it

2016-07-17 13:46:07 1030

原创 Codeforces-697B Barnicle

Barney is standing in a bar and starring at a pretty girl. He wants to shoot her with his heart arrow but he needs to know the distance between him and the girl to make his shot accurate.Barney

2016-07-15 13:19:04 953

原创 Codeforces-697C Lorenzo Von Matterhorn

Barney lives in NYC. NYC has infinite number of intersections numbered with positive integers starting from 1. There exists a bidirectional road between intersections i and 2i and another road betwe

2016-07-15 13:05:33 1608

原创 AOJ-782 整倍数

Description给定自然数N和十进制集合X={x1,x2,...,xm}(0Input输入包括多组测试数据,每组占两行,第一行为一个自然数N,1Output对每组测试数据输出一行结果。若在位数小于500的N的正整倍数中存在满足条件的数,则输出其中最小的正整倍数,若不存在,则输出没找到标志“No Found”Sample Input

2016-07-11 14:39:07 606

原创 Codeforces-687C The Values You Can Make

Pari wants to buy an expensive chocolate from Arya. She has n coins, the value of the i-th coin is ci. The price of the chocolate is k, so Pari will take a subset of her coins with sum equal to k 

2016-07-01 13:07:21 1439

原创 Codeforces-687B Remainders Game

Today Pari and Arya are playing a game called Remainders.Pari chooses two positive integer x and k, and tells Arya k but not x. Arya have to find the value . There are n ancient numbers c1, 

2016-07-01 12:40:40 761

原创 Codeforces-687A NP-Hard Problem

Recently, Pari and Arya did some research about NP-Hard problems and they found the minimum vertex cover problem very interesting.Suppose the graph G is given. Subset A of its vertices is called

2016-07-01 12:30:55 1216

原创 Codeforces-688B Lovely Palindromes

Pari has a friend who loves palindrome numbers. A palindrome number is a number that reads the same forward or backward. For example 12321, 100001 and 1 are palindrome numbers, while 112 and 1021 ar

2016-07-01 12:27:21 594

原创 Codeforces-688A Opponents

Arya has n opponents in the school. Each day he will fight with all opponents who are present this day. His opponents have some fighting plan that guarantees they will win, but implementing this pla

2016-07-01 12:24:37 639

原创 半场小结

今天是2016年的6月7日。打完了5月22日的省赛,5月28日的蓝桥杯,6月5日的湘潭邀请赛。收获:省赛一等奖,蓝桥杯省赛一等奖,全国优秀奖,湘潭打铁事实上,实力的确是弱的厉害,也算是学了一些算法吧。但是在全国各个高手的眼中。确实是一个蒟蒻。本来去湘潭之前,周sir就跟我们说了,不要去湘潭,安安心心的在学校刷题训练,但是不甘心的我们却依旧去了湘潭,然后打铁而归。原因很多,事实也很残

2016-06-08 00:00:46 507 1

原创 HDU-1007 Quoit Design

题目大意:给你n个点,代表toy,求一个使得可以套住一个toy且只能套住一个toy的环的最大半径。解法:只需要求出所有点的最近点对的长度就可以解决了。但是如何求最近点对? 最容易想到的就是暴力枚举所有点对,求出最小长度,然后就可以得到结果。但是复杂度为O(n^2)而这题n的范围是100000,必然不能通过。所以可以使用分治来解决这题。 分治解决这个问题的复杂度为O(nlognlogn),所以是比

2016-05-20 10:14:30 1062

原创 AOJ-737 关于最大公约数的疑惑

Description小光是个十分喜欢素数的人,有一天他在学习最大公约数的时候突然想到了一个问题,他想知道从1到n这n个整数中有多少对最大公约数为素数的(x,y),即有多少(x,y),gcd(x,y)=素数,1Input一个整数N (1Output(x,y)的个数Sample Input5Sample Output5H

2016-05-12 21:54:25 700

原创 队列(Queue)

最近学习了数据结构队列,队列是一种特殊的线性表,是被限定了的线性表,先进先出(FIFO, First in First out),跟栈的后进先出(LIFO, Last in First out)是类似的一种数据结构,对于这个数据结构,已经有很多的文章有过介绍了,这里也就不再赘述,直接贴出代码,希望能够互相进步!这里使用了一个HeadNode的节点来表示一个队列,里面只有两个信息,分别是指向队列

2016-04-25 23:16:41 588

原创 Codeforces-632D Longest Subsequence

You are given array a with n elements and the number m. Consider some subsequence of a and the value of least common multiple (LCM) of its elements. Denote LCM as l. Find any longest subsequence o

2016-03-24 12:37:02 691

原创

栈是一种数据结构,在计算机科学中被广泛使用。今天刚刚上了数据结构课,晚上就顺便写了一个比较简单的栈。栈的特性在百度百科还有维基百科都有提到。其它菊苣的博客里面也有详细阐述,就不再赘述了。直接把我写的栈贴出来。希望大家能够一起进步!#include using namespace std;typedef int Element;typedef struct Stack { Ele

2016-03-15 20:29:29 401 1

原创 【Linux】Ubuntu装好之后出现插入网线被提示没有插入网线情况的解决方案

今天在实验室帮某屌丝装Ubuntu装好之后发现没有有线连接,一开始以为网卡驱动出现问题,但是考虑目前来说Ubuntu的硬件兼容能力已经非常不错了,而且经过查看之后发现网卡驱动的确是好的。那么是什么出现问题了呢?于是又试了一下sudo service network-manager restart发现还是没有作用。然后上网找啊找,突然看到以前贴吧还是论坛里面有个人因为设置的双工模式问题造成了

2015-12-28 00:03:22 7140

原创 HDU - 5596 - GTW likes gt

这题是来自BestCoder Round #66的一道题目,不是很难,官方题解上说的也比较清楚了。O(nlog(n))的算法真心没考虑,一开始想的就是O(n)的算法,看了题解之后居然还是没想到O(nlogn)的算法怎么写。其实仔细想想,在第Ci秒结束时,B1, B2, B3, ... Bci都增加1,这一看就觉得是区间更新(唔,有种线段树的感觉),但是考虑区间更新来写,实在是有些麻烦,不如反向

2015-12-17 16:20:52 535

原创 AOJ-542-Window/POJ-2823-Window

DescriptionAn array of size n ≤ 106 is given to you. There is a sliding window of size k which is moving from the very left of the array to the very right. You can only see the k numbers in the wi

2015-08-26 11:57:20 491

原创 HDU-1074-Doing Homework

Problem DescriptionIgnatius has just come back school from the 30th ACM/ICPC. Now he has a lot of homework to do. Every teacher gives him a deadline of handing in the homework. If Ignatius hands in

2015-08-23 20:06:06 453

原创 HDU-5365-Run

Problem Description AFA is a girl who like runing.Today,he download an app about runing .The app can record the trace of her runing.AFA will start runing in the park.There are many chairs in the park,

2015-08-22 18:19:38 503

原创 HDU-5366-The mook jong

Problem DescriptionZJiaQ want to become a strong man, so he decided to play the mook jong。ZJiaQ want to put some mook jongs in his backyard. His backyard consist of n bricks that is 1*1,so it is 1*n。ZJ

2015-08-22 18:14:26 571

原创 HDU-5391-Zball in Tina Town

Problem DescriptionTina Town is a friendly place. People there care about each other.Tina has a ball called zball. Zball is magic. It grows larger every day. On the first day, it becomes 1 time

2015-08-22 17:36:07 645

原创 AOJ-351-求最值之差

Description 给出N个数,求第a个数到第b个数之间最大的数减去最小的数的结果Input N(N小于100,000),M(M小于100,000) 接下来有N个数 接下来M组范围,所有数均在[0,231-1]内 每个范围有2个整数a,b(1<=a<=b<=N) Output 每行输出一个结果Sample Input 5 3 4 2 5 1 10 1 5 2 3 2 2Sa

2015-08-21 23:26:47 575

原创 AOJ-743-多重部分和问题

Description 有n种不同大小的数字,每种各个。判断是否可以从这些数字之中选出若干使它们的和恰好为K。Input 首先是一个正整数T(1<=T<=100) 接下来是T组数据 每组数据第一行是一个正整数n(1<=n<=100),表示有n种不同大小的数字 第二行是n个不同大小的正整数ai(1<=ai<=100000) 第三行是n个正整数mi(1<=mi<=100000),表示每种数字

2015-08-21 23:16:37 736

原创 Code[VS]1044拦截导弹

题目描述 Description 某国为了防御敌国的导弹袭击,发展出一种导弹拦截系统。但是这种导弹拦截系统有一个缺陷:虽然它的第一发炮弹能够到达任意的高度,但是以后每一发炮弹都不能高于前一发的高度。某天,雷达捕捉到敌国的导弹来袭。由于该系统还在试用阶段,所以只有一套系统,因此有可能不能拦截所有的导弹。输入描述 Input Description 输入导弹依次飞来的高度(雷达给出的高度数据

2015-07-24 20:04:13 2482 1

空空如也

空空如也

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

TA关注的人

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