自定义博客皮肤VIP专享

*博客头图:

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

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

博客底图:

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

栏目图:

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

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

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

原创 ZOJ Problem Set - 1295 Reverse Text

Reverse TextTime Limit: 2 Seconds      Memory Limit: 65536 KB In most languages, text is written from left to right. However, there are other languages where text is read and written from ri

2016-02-01 18:29:49 411

原创 ZOJ Problem Set - 1241 Geometry Made Simple

Geometry Made SimpleTime Limit: 2 Seconds      Memory Limit: 65536 KB Mathematics can be so easy when you have a computer. Consider the following example. You probably know that in a right-a

2016-02-01 18:27:32 458

原创 1003. 我要通过!(20)

1003. 我要通过!(20)时间限制400 ms内存限制65536 kB代码长度限制8000 B判题程序Standard作者CHEN, Yue“答案正确”是自动判题系统给出的最令人欢喜的回复。本题属于PAT的“答案正确”大派送 —— 只要读入的字符串

2015-12-23 16:08:23 425

原创 第12章 图形用户界面基础

12.3 Java GUI APIGUI API包含的类可以分成三个组:组建类(component class)、容器类(container class)和辅助类(helper class)。组建类是用来创建用户界面的,例如,JButton、JLabel和JTextField。容器类是用来包含其他组件的,例如,JFrame、JPanel和JApplet。辅助类是用来支持GUI组件的,例如,Graphics、Color、Font、FontMetrics和Dimension。注意 JFrame、JAppl

2015-07-24 17:37:14 836

原创 第11章 继承和多态

11.3 使用super关键字子类继承它的父类所有可访问的数据域和方法。它能继承构造方法吗?父类的构造方法能够从子类调用吗?关键字super是指这个super出现的类的父类。关键字super可以用于两种途径:1)调用父类的构造方法。2)调用父类的方法。11.3.1 调用父类的构造方法调用父类构造方法的语法是:super(), or super(parameters);语句super()调用它的父类的无参构造方法,而语句super(参数)调用于参数匹配的父类的构造方法。语句super()和su

2015-07-24 17:35:05 560

原创 第8章 对象和类

Date类java在java.util.Date类中还提供了与系统无关的对日期和时间的封装。+Date()以当前时间构造一个Date对象+Date(elapseTime:long)以从GMT时间1970年1月1日开始算起的毫秒数为给定时间的构造一个Date对象+toString():String返回日期和时间的字符串表达式+g

2015-07-24 13:16:15 4036

转载 最短路径—Dijkstra算法和Floyd算法

1.dijkstra算法简介Dijkstra算法是由E.W.Dijkstra于1959年提出,又叫迪杰斯特拉算法,它应用了贪心算法模式,是目前公认的最好的求解最短路径的方法。算法解决的是有向图中单个源点到其他顶点的最短路径问题,其主要特点是每次迭代时选择的下一个顶点是标记点之外距离源点最近的顶点。但由于dijkstra算法主要计算从源点到其他所有点的最短路径,所以算法的效率较低。2

2015-07-12 17:40:06 453

原创 ZOJ Problem Set - 1092 Arbitrage (Floyd)

Floyd-Warshall算法描述:For k←1 to n do // k为“媒介节点” For i←1 to n do For j←1 to n do if (dist(i,k) + dist(k,j) < dist(i,j)) then // 是否是更短的路径? dist(i,j) = dist(i,k) +

2015-07-12 13:02:02 350

原创 ZOJ Problem Set - 1082 Stockbroker Grapevine

第一次做最短路径的题目。大致是看别人的代码。不过多多少理解了。还要多多练习才行。用过一个map二维数组来存储两点之间的权值。首先输入人数个数num,然后在输入num行,第一行代表第一个人,第二行代表第二个人,每行第一个数位对数pair,然后分别输入pair对。例如:2 2 4 3 5 则表示有两对数据分别是2 4 和3 5  代表 第一个人传递到第二个人需要4个时间。第一个人传递给第三

2015-07-11 13:35:54 385

原创 ZOJ Problem Set - 1402 Magnificent Meatballs

水题。一开始想复杂了。其实就是当相等时输出各自的位置,否则输出。。。。#include #include int main(){ int pos[31], i, n, sum, flag, temp; while(scanf("%d", &n) != EOF && n) { sum = 0; flag = 1; temp = 0; for(i = 1; i <=

2015-07-05 14:21:20 322

原创 ZOJ Problem Set - 2850 Beautiful Meadow

用一个二维数组存储,0代表割草,1代表有草,要求两个割草的地方不能是相邻,不能每块都有草。首先在输入时判断是否有块地方是0,即为割草。则flag = 1, 接下来通过相邻两块相加是否 == 0 来判断两块地是否都为割草。需要注意边界情况,初始化为1#include int main(){ int n, m, i, j, map[15][15], flag; while(sc

2015-07-05 12:37:00 392

原创 ZOJ Problem Set - 2136 Longest Ordered Subsequence

参考了别人的代码,自己也真正懂了的第一道应该算是DP吧。用一个数组来记录以每个数字为结尾时序数的个数情况。然后后面的数若比前面的数大并且序数个数大于以这个数为结尾的序数个数,则在前面的基础上加上1并保存结果。最后输出数组中的最大值!#include int main(){ int ncases; scanf("%d", &ncases); while(ncases--) {

2015-07-04 18:23:14 394

原创 ZOJ Problem Set - 1195 Blowing Fuses

Blowing FusesTime Limit: 2 Seconds      Memory Limit: 65536 KBMaybe you are familiar with the following situation. You have plugged in a lot of electrical devices, such as toasters, refrigerat

2015-07-04 14:06:10 665

原创 ZOJ Problem Set - 2932 The Seven Percent Solution

The Seven Percent SolutionTime Limit: 2 Seconds      Memory Limit: 65536 KBUniform Resource Identifiers (or URIs) are strings like http://icpc.baylor.edu/icpc/, mailto:[email protected], ftp://127

2015-07-04 13:51:05 596

原创 POJ 1163 The Triangle

The TriangleTime Limit: 1000MS Memory Limit: 10000KTotal Submissions: 40354 Accepted: 24340Description73 88 1 02 7 4 44 5 2 6 5(Figu

2015-07-02 21:24:02 444

原创 ZOJ Problem Set - 2186 Keep on Truckin'

Keep on Truckin'Time Limit: 2 Seconds      Memory Limit: 65536 KBBoudreaux and Thibodeaux are on the road again . . ."Boudreaux, we have to get this shipment of mudbugs to Baton Rouge by ton

2015-07-01 20:54:55 521

原创 ZOJ Problem Set - 1712||Skew Binary

Skew BinaryTime Limit: 2 Seconds      Memory Limit: 65536 KBWhen a number is expressed in decimal, the kth digit represents a multiple of 10 k. (Digits are numbered from right to left, where t

2015-06-30 22:26:18 400

原创 ZOJ Problem Set - 2022||Factorial

FactorialTime Limit: 2 Seconds      Memory Limit: 65536 KBThe most important part of a GSM network is so called Base Transceiver Station (BTS). These transceivers form the areas called cells (

2015-06-30 21:54:42 421

转载 C++输出格式

一:标准输入函数cin不知道说它是个函数对还是不对,它是代表标准的输入设备--键盘。他是属于流的,他的用法和流的用法是一样的。也就是:cin>>变量;小小的说明一下,输入多个变量可以写在一行,如:cin>>x>>y>>z;这样写不是不允许,而是不好看,如果是不同的变量类型,那就更是没头没脑了。除了你,人家是不知道该输入什么的,所以,一般在输入语句的前面,我们一般都要做一个提示,

2015-06-30 21:13:05 407

原创 ZOJ Problem Set - 2482||IP Address

IP AddressTime Limit: 2 Seconds      Memory Limit: 65536 KBSuppose you are reading byte streams from any device, representing IP addresses. Your task is to convert a 32 characters long sequenc

2015-06-30 20:31:37 404

原创 ZOJ Problem Set - 1414||Number Steps

Number StepsTime Limit: 2 Seconds      Memory Limit: 65536 KBStarting from point (0,0) on a plane, we have written all non-negative integers 0, 1, 2,... as shown in the figure. For example, 1,

2015-06-30 20:27:13 318

原创 HDU 1702 ACboy needs your help again!

ACboy needs your help again!Time Limit: 1000/1000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 4226    Accepted Submission(s): 2152Problem DescriptionA

2015-05-16 21:08:43 311

原创 01-复杂度1. 最大子列和问题(20)

01-复杂度1. 最大子列和问题(20)时间限制10000 ms内存限制65536 kB代码长度限制8000 B判题程序Standard给定K个整数组成的序列{ N1, N2, ..., NK },“连续子列”被定义为{ Ni, Ni+1, ..., Nj },其中

2015-05-16 09:01:49 393

原创 ZOJ Problem Set - 1151||Word Reversal

Word ReversalTime Limit: 2 Seconds      Memory Limit: 65536 KBFor each list of words, output a line with each word reversed without changing the order of the words.This problem contains mu

2015-05-02 21:41:23 472

原创 02-线性结构3. Pop Sequence (25)

02-线性结构3. Pop Sequence (25)时间限制100 ms内存限制65536 kB代码长度限制8000 B判题程序Standard作者CHEN, YueGiven a stack which can keep M numbers at

2015-05-02 16:05:35 403

转载 白话经典算法系列之六 快速排序 快速搞定

快速排序由于排序效率在同为O(N*logN)的几种排序方法中效率较高,因此经常被采用,再加上快速排序思想----分治法也确实实用,因此很多软件公司的笔试面试,包括像腾讯,微软等知名IT公司都喜欢考这个,还有大大小的程序方面的考试如软考,考研中也常常出现快速排序的身影。总的说来,要直接默写出快速排序还是有一定难度的,因为本人就自己的理解对快速排序作了下白话解释,希望对大家理解有帮助,达到快速

2015-05-02 08:28:56 366

原创 ZOJ Problem Set - 3872||Beauty of Array

Beauty of ArrayTime Limit: 2 Seconds      Memory Limit: 65536 KBEdward has an array A with N integers. He defines the beauty of an array as the summation of all distinct integers in the array.

2015-04-28 16:14:32 512

原创 ZOJ Problem Set - 3876||May Day Holiday

May Day HolidayTime Limit: 2 Seconds      Memory Limit: 65536 KBAs a university advocating self-learning and work-rest balance, Marjar University has so many days of rest, including holidays a

2015-04-26 22:37:55 525

原创 ZOJ Problem Set - 3878||Convert QWERTY to Dvorak

Convert QWERTY to DvorakTime Limit: 2 Seconds      Memory Limit: 65536 KBEdward, a poor copy typist, is a user of the Dvorak Layout. But now he has only a QWERTY Keyboard with a broken Caps Lo

2015-04-26 22:27:01 648

原创 ZOJ Problem Set - 3875||Lunch Time

Lunch TimeTime Limit: 2 Seconds      Memory Limit: 65536 KBThe 999th Zhejiang Provincial Collegiate Programming Contest will be held in Marjar University. The canteen of Marjar University is m

2015-04-26 21:39:35 454

原创 ZOJ Problem Set - 3869||Ace of Aces

Ace of AcesTime Limit: 2 Seconds      Memory Limit: 65536 KBThere is a mysterious organization called Time-Space Administrative Bureau (TSAB) in the deep universe that we humans have not disco

2015-04-26 21:29:57 629

原创 ZOJ Problem Set - 3880||Demacia of the Ancients

Demacia of the AncientsTime Limit: 2 Seconds      Memory Limit: 65536 KBThere is a popular multiplayer online battle arena game called Demacia of the Ancients. There are lots of professional t

2015-04-26 21:25:36 341

原创 ZOJ Problem Set - 3603||Draw Something Cheat

Draw Something CheatTime Limit: 2 Seconds      Memory Limit: 65536 KBHave you played Draw Something? It's currently one of the hottest social drawing games on Apple iOS and Android Devices! In

2015-04-23 19:23:01 529

原创 ZOJ Problem Set - 3600||Taxi Fare

Taxi FareTime Limit: 2 Seconds      Memory Limit: 65536 KBLast September, Hangzhou raised the taxi fares.The original flag-down fare in Hangzhou was 10 yuan, plusing 2 yuan per kilometer aft

2015-04-22 19:09:18 399

原创 ZOJ Problem Set - 1115||Digital Roots

Digital RootsTime Limit: 2 Seconds      Memory Limit: 65536 KBBackgroundThe digital root of a positive integer is found by summing the digits of the integer. If the resulting value is a si

2015-04-22 16:02:13 405

原创 ZOJ Problem Set - 1078||Palindrom Numbers

Palindrom NumbersTime Limit: 2 Seconds      Memory Limit: 65536 KBStatement of the ProblemWe say that a number is a palindrom if it is the sane when read from left to right or from right to

2015-04-22 14:59:41 381

原创 ZOJ Problem Set - 1067||Color Me Less

Color Me LessTime Limit: 2 Seconds      Memory Limit: 65536 KBProblemA color reduction is a mapping from a set of discrete colors to a smaller one. The solution to this problem requires th

2015-04-22 14:32:12 441

原创 ZOJ Problem Set - 1057||Undercut

UndercutTime Limit: 2 Seconds      Memory Limit: 65536 KBUndercut is a card game where two players each have five cards numbered one through five. At each round, each player selects a card, th

2015-04-22 14:09:55 341

原创 ZOJ Problem Set - 1049||I Think I Need a Houseboat

I Think I Need a HouseboatTime Limit: 2 Seconds      Memory Limit: 65536 KBFred Mapper is considering purchasing some land in Louisiana to build his house on. In the process of investigating

2015-04-22 13:49:00 383

原创 ZOJ Problem Set - 1048||Financial Management

Financial ManagementTime Limit: 2 Seconds      Memory Limit: 65536 KBLarry graduated this year and finally has a job. He's making a lot of money, but somehow never seems to have enough. Larr

2015-04-22 13:08:13 406

空空如也

空空如也

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

TA关注的人

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