- 博客(48)
- 收藏
- 关注
原创 ZOJ Problem Set - 1295 Reverse Text
Reverse Text Time 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
482
原创 ZOJ Problem Set - 1241 Geometry Made Simple
Geometry Made Simple Time 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
551
原创 1003. 我要通过!(20)
1003. 我要通过!(20) 时间限制 400 ms 内存限制 65536 kB 代码长度限制 8000 B 判题程序 Standard 作者 CHEN, Yue “答案正确”是自动判题系统给出的最令人欢喜的回复。本题属于PAT的“答案正确”大派送 —— 只要读入的字符串
2015-12-23 16:08:23
503
原创 第12章 图形用户界面基础
12.3 Java GUI API GUI 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
912
原创 第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
621
原创 第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
4159
转载 最短路径—Dijkstra算法和Floyd算法
1.dijkstra算法简介 Dijkstra算法是由E.W.Dijkstra于1959年提出,又叫迪杰斯特拉算法,它应用了贪心算法模式,是目前公认的最好的求解最短路径的方法。算法解决的是有向图中单个源点到其他顶点的最短路径问题,其主要特点是每次迭代时选择的下一个顶点是标记点之外距离源点最近的顶点。但由于dijkstra算法主要计算从源点到其他所有点的最短路径,所以算法的效率较低。 2
2015-07-12 17:40:06
508
原创 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
404
原创 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
447
原创 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
377
原创 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
437
原创 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
471
原创 ZOJ Problem Set - 1195 Blowing Fuses
Blowing Fuses Time Limit: 2 Seconds Memory Limit: 65536 KB Maybe 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
740
原创 ZOJ Problem Set - 2932 The Seven Percent Solution
The Seven Percent Solution Time Limit: 2 Seconds Memory Limit: 65536 KB Uniform Resource Identifiers (or URIs) are strings like http://icpc.baylor.edu/icpc/, mailto:foo@bar.org, ftp://127
2015-07-04 13:51:05
679
原创 POJ 1163 The Triangle
The Triangle Time Limit: 1000MS Memory Limit: 10000K Total Submissions: 40354 Accepted: 24340 Description 7 3 8 8 1 0 2 7 4 4 4 5 2 6 5 (Figu
2015-07-02 21:24:02
498
原创 ZOJ Problem Set - 2186 Keep on Truckin'
Keep on Truckin' Time Limit: 2 Seconds Memory Limit: 65536 KB Boudreaux 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
597
原创 ZOJ Problem Set - 1712||Skew Binary
Skew Binary Time Limit: 2 Seconds Memory Limit: 65536 KB When 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
445
原创 ZOJ Problem Set - 2022||Factorial
Factorial Time Limit: 2 Seconds Memory Limit: 65536 KB The 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
480
转载 C++输出格式
一:标准输入函数cin 不知道说它是个函数对还是不对,它是代表标准的输入设备--键盘。他是属于流的,他的用法和流的用法是一样的。也就是:cin>>变量; 小小的说明一下,输入多个变量可以写在一行,如:cin>>x>>y>>z; 这样写不是不允许,而是不好看,如果是不同的变量类型,那就更是没头没脑了。除了你,人家是不知道该输入什么的,所以,一般在输入语句的前面,我们一般都 要做一个提示,
2015-06-30 21:13:05
461
原创 ZOJ Problem Set - 2482||IP Address
IP Address Time Limit: 2 Seconds Memory Limit: 65536 KB Suppose 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
469
原创 ZOJ Problem Set - 1414||Number Steps
Number Steps Time Limit: 2 Seconds Memory Limit: 65536 KB Starting 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
373
原创 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): 2152 Problem Description A
2015-05-16 21:08:43
366
原创 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
439
原创 ZOJ Problem Set - 1151||Word Reversal
Word Reversal Time Limit: 2 Seconds Memory Limit: 65536 KB For 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
541
原创 02-线性结构3. Pop Sequence (25)
02-线性结构3. Pop Sequence (25) 时间限制 100 ms 内存限制 65536 kB 代码长度限制 8000 B 判题程序 Standard 作者 CHEN, Yue Given a stack which can keep M numbers at
2015-05-02 16:05:35
441
转载 白话经典算法系列之六 快速排序 快速搞定
快速排序由于排序效率在同为O(N*logN)的几种排序方法中效率较高,因此经常被采用,再加上快速排序思想----分治法也确实实用,因此很多软件公司的笔试面试,包括像腾讯,微软等知名IT公司都喜欢考这个,还有大大小的程序方面的考试如软考,考研中也常常出现快速排序的身影。 总的说来,要直接默写出快速排序还是有一定难度的,因为本人就自己的理解对快速排序作了下白话解释,希望对大家理解有帮助,达到快速
2015-05-02 08:28:56
409
原创 ZOJ Problem Set - 3872||Beauty of Array
Beauty of Array Time Limit: 2 Seconds Memory Limit: 65536 KB Edward 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
562
原创 ZOJ Problem Set - 3876||May Day Holiday
May Day Holiday Time Limit: 2 Seconds Memory Limit: 65536 KB As 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
587
原创 ZOJ Problem Set - 3878||Convert QWERTY to Dvorak
Convert QWERTY to Dvorak Time Limit: 2 Seconds Memory Limit: 65536 KB Edward, 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
726
原创 ZOJ Problem Set - 3875||Lunch Time
Lunch Time Time Limit: 2 Seconds Memory Limit: 65536 KB The 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
510
原创 ZOJ Problem Set - 3869||Ace of Aces
Ace of Aces Time Limit: 2 Seconds Memory Limit: 65536 KB There 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
696
原创 ZOJ Problem Set - 3880||Demacia of the Ancients
Demacia of the Ancients Time Limit: 2 Seconds Memory Limit: 65536 KB There 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
394
原创 ZOJ Problem Set - 3603||Draw Something Cheat
Draw Something Cheat Time Limit: 2 Seconds Memory Limit: 65536 KB Have 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
595
原创 ZOJ Problem Set - 3600||Taxi Fare
Taxi Fare Time Limit: 2 Seconds Memory Limit: 65536 KB Last 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
453
原创 ZOJ Problem Set - 1115||Digital Roots
Digital Roots Time Limit: 2 Seconds Memory Limit: 65536 KB Background The 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
451
原创 ZOJ Problem Set - 1078||Palindrom Numbers
Palindrom Numbers Time Limit: 2 Seconds Memory Limit: 65536 KB Statement of the Problem We 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
424
原创 ZOJ Problem Set - 1067||Color Me Less
Color Me Less Time Limit: 2 Seconds Memory Limit: 65536 KB Problem A 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
506
原创 ZOJ Problem Set - 1057||Undercut
Undercut Time Limit: 2 Seconds Memory Limit: 65536 KB Undercut 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
406
原创 ZOJ Problem Set - 1049||I Think I Need a Houseboat
I Think I Need a Houseboat Time Limit: 2 Seconds Memory Limit: 65536 KB Fred Mapper is considering purchasing some land in Louisiana to build his house on. In the process of investigating
2015-04-22 13:49:00
427
原创 ZOJ Problem Set - 1048||Financial Management
Financial Management Time Limit: 2 Seconds Memory Limit: 65536 KB Larry 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
447
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人