自定义博客皮肤VIP专享

*博客头图:

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

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

博客底图:

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

栏目图:

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

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

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

原创 11、Java基础(接口)

1、什么是接口接口相当于抽象类,定义方式、组成部分与抽象类类似使用interface关键字定义接口没有构造方法,不能创建对象。只能定义:公开的静态常量、公开抽象方法。什么是接口微观概念:接口是一种能力。接口的定义:代表了某种能力方法的定义:能力的具体要求。经验:Java为单继承,当父类的方法种类无法满足子类需求时,可实现接口扩充子类能力。接口支持多实现,可为类扩充多种能力。2、接口与类的异同与抽象类的异同相同:...

2021-09-07 14:44:11 87

原创 Java三个修饰符(10)

1、abstract什么是抽象?似是而非,像却又不想;具备某种对象那个的特征,但不完整。应用:abstract修饰类,此类不能new对象。(new对象报错)作用:1.可被子类继承,提供共性属性和方法。 2.可声明为引用,更自然的是用多态。2、抽象类、抽象方法3、static4、静态成员、类加载5、final6、最终类、方法,常量...

2021-09-07 13:18:31 98

原创 XYZZY(SPFA判正环)

It has recently been discovered how to run open-source software on the Y-Crate gaming device. A number of enterprising designers have developed Advent-style games for deployment on the Y-Crate. Your j...

2021-09-06 19:55:41 278

原创 R - FATE (完全背包)

最近xhd正在玩一款叫做FATE的游戏,为了得到极品装备,xhd在不停的杀怪做任务。久而久之xhd开始对杀怪产生的厌恶感,但又不得不通过杀怪来升完这最后一级。现在的问题是,xhd升掉最后一级还需n的经验值,xhd还留有m的忍耐度,每杀一个怪xhd会得到相应的经验,并减掉相应的忍耐度。当忍耐度降到0或者0以下时,xhd就不会玩这游戏。xhd还说了他最多只杀s只怪。请问他能升掉这最后一级吗?Inp...

2019-03-21 20:31:06 106

原创 S - Sumsets

Farmer John commanded his cows to search for different sets of numbers that sum to a given number. The cows use only numbers that are an integer power of 2. Here are the possible sets of numbers th...

2019-03-21 17:10:39 111

原创 K - FatMouse and Cheese

FatMouse has stored some cheese in a city. The city can be considered as a square grid of dimension n: each grid location is labelled (p,q) where 0 <= p < n and 0 <= q < n. At each grid lo...

2019-03-19 15:18:11 119

原创 李白打酒 蓝桥杯

标题:李白打酒 话说大诗人李白,一生好饮。幸好他从不开车。 一天,他提着酒壶,从家里出来,酒壶中有酒2斗。他边走边唱: 无事街上走,提壶去打酒。 逢店加一倍,遇花喝一斗。 这一路上,他一共遇到店5次,遇到花10次,已知最后一次遇到的是花,他正好把酒喝光了。 请你计算李白遇到店和花的次序,可以把遇店记为a,遇花记为b。则:babaabba...

2019-03-19 14:33:56 191 1

原创 I - A/B

要求(A/B)%9973,但由于A很大,我们只给出n(n=A%9973)(我们给定的A必能被B整除,且gcd(B,9973) = 1)。Input数据的第一行是一个T,表示有T组数据。 每组数据有两个数n(0 &lt;= n &lt; 9973)和B(1 &lt;= B &lt;= 10^9)。Output对应每组数据输出(A/B)%9973。Sample Input2...

2018-12-20 20:15:42 179

原创 全排列

#include&lt;iostream&gt;#include&lt;algorithm&gt;using namespace std;int main(){    int n,i,b;    int a[100];    cin&gt;&gt;b;    while(b--)    {        cin&gt;&gt;n;        for(i=0; i&lt;n...

2018-12-19 20:14:07 80

原创 H - 调查问卷 HDU - 6344

度度熊为了完成毕业论文,需要收集一些数据来支撑他的论据,于是设计了一份包含 mm 个问题的调查问卷,每个问题只有 'A' 和 'B' 两种选项。 将问卷散发出去之后,度度熊收到了 nn 份互不相同的问卷,在整理结果的时候,他发现可以只保留其中的一部分问题,使得这 nn 份问卷仍然是互不相同的。这里认为两张问卷是不同的,当且仅当存在至少一个被保留的问题在这两份问卷中的回答不同。 现在度度熊想知道...

2018-09-29 21:42:50 223

原创 D - Polycarp and Div 3 CodeForces - 1005D

Polycarp likes numbers that are divisible by 3.He has a huge number ss. Polycarp wants to cut from it the maximum number of numbers that are divisible by 33. To do this, he makes an arbitrary number...

2018-09-15 13:56:39 124

原创 G - Line CodeForces - 7C

A line on the plane is described by an equation Ax + By + C = 0. You are to find any point on this line, whose coordinates are integer numbers from  - 5·1018 to 5·1018 inclusive, or to find out that s...

2018-09-02 21:41:49 146

原创 F - 统计难题 HDU - 1251

Ignatius最近遇到一个难题,老师交给他很多单词(只有小写字母组成,不会有重复的单词出现),现在老师要他统计出以某个字符串为前缀的单词数量(单词本身也是自己的前缀). Input输入数据的第一部分是一张单词表,每行一个单词,单词的长度不超过10,它们代表的是老师交给Ignatius统计的单词,一个空行代表单词表的结束.第二部分是一连串的提问,每行一个提问,每个提问都是一个字符串. 注...

2018-09-02 21:23:32 121

原创 D - FatMouse and Cheese HDU - 1078

FatMouse has stored some cheese in a city. The city can be considered as a square grid of dimension n: each grid location is labelled (p,q) where 0 &lt;= p &lt; n and 0 &lt;= q &lt; n. At each grid lo...

2018-09-02 21:11:02 213

原创 X - Farey Sequence POJ - 2478

The Farey Sequence Fn for any integer n with n &gt;= 2 is the set of irreducible rational numbers a/b with 0 &lt; a &lt; b &lt;= n and gcd(a,b) = 1 arranged in increasing order. The first few are F2 ...

2018-09-02 20:59:54 170

原创 A - 深海探险 51Nod - 1535

很久很久以前的一天,一位美男子来到海边,海上狂风大作。美男子希望在海中找到美人鱼,但是很不幸他只找到了章鱼怪。 然而,在世界的另一端,人们正在积极的收集怪物的行为信息,以便研制出强大的武器来对付章鱼怪。由于地震的多发,以及恶劣的天气,使得我们的卫星不能很好的定位怪物,从而不能很好的命中目标。第一次射击的分析结果会反映在一张由n个点和m条边组成的无向图上。现在让我们来确定这张图是不是可以被认...

2018-09-02 20:52:03 89

原创 B - 整数划分 51Nod - 1201

将N分为若干个不同整数的和,有多少种不同的划分方式,例如:n = 6,{6} {1,5} {2,4} {1,2,3},共4种。由于数据较大,输出Mod 10^9 + 7的结果即可。Input输入1个数N(1 &lt;= N &lt;= 50000)。Output输出划分的数量Mod 10^9 + 7。Sample Input6Sample Output4题解...

2018-09-02 20:44:26 179

原创 A - Robot Rapping Results Report CodeForces - 645D

 While Farmer John rebuilds his farm in an unfamiliar portion of Bovinia, Bessie is out trying some alternative jobs. In her new gig as a reporter, Bessie needs to know about programming competition...

2018-08-27 08:07:18 118

原创 E - 超级密码 HDU - 1226

Ignatius花了一个星期的时间终于找到了传说中的宝藏,宝藏被放在一个房间里,房间的门用密码锁起来了,在门旁边的墙上有一些关于密码的提示信息: 密码是一个C进制的数,并且只能由给定的M个数字构成,同时密码是一个给定十进制整数N(0&lt;=N&lt;=5000)的正整数倍(如果存在多个满足条件的数,那么最小的那个就是密码),如果这样的密码存在,那么当你输入它以后门将打开,如果不存在这样的密码....

2018-08-26 21:00:23 175

原创 C - Tree UVA - 548

You are to determine the value of the leaf node in a given binary tree that is the terminal node of a path of least value from the root of the binary tree to any leaf. The value of a path is the sum o...

2018-08-26 20:41:47 146

原创 F - Super Jumping! Jumping! Jumping! HDU - 1087

Nowadays, a kind of chess game called “Super Jumping! Jumping! Jumping!” is very popular in HDU. Maybe you are a good boy, and know little about this game, so I introduce it to you now. The game ...

2018-08-26 20:12:12 150

原创 D - Anniversary party POJ - 2342

There is going to be a party to celebrate the 80-th Anniversary of the Ural State University. The University has a hierarchical structure of employees. It means that the supervisor relation forms a tr...

2018-08-26 19:05:40 177

原创 F - 度度熊学队列 HDU - 6375

度度熊正在学习双端队列,他对其翻转和合并产生了很大的兴趣。 初始时有 [Math Processing Error]N 个空的双端队列(编号为 [Math Processing Error]1 到 [Math Processing Error]N ),你要支持度度熊的 [Math Processing Error]Q 次操作。 ①[Math Processing Error]1 [Math P...

2018-08-26 19:03:40 146

原创 B - Not so Mobile UVA - 839

https://vjudge.net/problem/UVA-839#include&lt;stdio.h&gt;#include&lt;iostream&gt;using namespace std;int flag;int read(){ int w1,d1,w2,d2; cin&gt;&gt;w1&gt;&gt;d1&gt;&gt;w2&gt;&gt;d2;...

2018-08-26 18:55:49 175

原创 E - The order of a Tree HDU - 3999

As we know,the shape of a binary search tree is greatly related to the order of keys we insert. To be precisely: 1.  insert a key k to a empty tree, then the tree become a tree with only one node; ...

2018-08-26 18:51:56 150

原创 D - Trees on the level HDU - 1622

Trees are fundamental in many branches of computer science. Current state-of-the art parallel computers such as Thinking Machines' CM-5 are based on fat trees. Quad- and octal-trees are fundamental to...

2018-08-26 18:50:48 193

原创 A - 二叉搜索树 HDU - 3791

判断两序列是否为同一二叉搜索树序列Input开始一个数n,(1&lt;=n&lt;=20) 表示有n个需要判断,n= 0 的时候输入结束。 接下去一行是一个序列,序列长度小于10,包含(0~9)的数字,没有重复数字,根据这个序列可以构造出一颗二叉搜索树。 接下去的n行有n个序列,每个序列格式跟第一个序列一样,请判断这两个序列是否能组成同一颗二叉搜索树。Output如果序列相同则...

2018-08-26 18:49:08 128

原创 E - Fox And Names CodeForces - 510C

Fox Ciel is going to publish a paper on FOCS (Foxes Operated Computer Systems, pronounce: "Fox"). She heard a rumor: the authors list on the paper is always sorted in the lexicographical order.After...

2018-08-16 21:15:32 134

原创 B - Parity 51Nod - 1204

你的朋友写下一串包含1和0的串让你猜,你可以从中选择一个连续的子串(例如其中的第3到第5个数字)问他,该子串中包含了奇数个还是偶数个1,他会回答你的问题,然后你可以继续提问......你怀疑朋友的答案可能有错,或说同他之前的答案相互矛盾,例如:1 - 2 奇数,3 - 4 奇数,那么可以确定1 - 4 一定是偶数,如果你的朋友回答是奇数,就产生了矛盾。给出所有你朋友的答案,请你找出第一个出现矛盾的...

2018-08-16 21:09:43 169

原创 A - Ice_cream's world I HDU - 2120

ice_cream's world is a rich country, it has many fertile lands. Today, the queen of ice_cream wants award land to diligent ACMers. So there are some watchtowers are set up, and wall between watchtower...

2018-08-16 21:08:12 74

原创 A - Minimum Transport Cost HDU - 1385

These are N cities in Spring country. Between each pair of cities there may be one transportation track or none. Now there is some cargo that should be delivered from one city to another. The transpor...

2018-08-16 21:06:27 134

原创 I - Wormholes POJ - 3259

While exploring his many farms, Farmer John has discovered a number of amazing wormholes. A wormhole is very peculiar because it is a one-way path that delivers you to its destination at a time that i...

2018-08-14 20:56:11 221

原创 A - 食物链 POJ - 1182

动物王国中有三类动物A,B,C,这三类动物的食物链构成了有趣的环形。A吃B, B吃C,C吃A。 现有N个动物,以1-N编号。每个动物都是A,B,C中的一种,但是我们并不知道它到底是哪一种。 有人用两种说法对这N个动物所构成的食物链关系进行描述: 第一种说法是"1 X Y",表示X和Y是同类。 第二种说法是"2 X Y",表示X吃Y。 此人对N个动物,用上述两种说法,一句接一句地说出K句话...

2018-08-14 20:37:05 116

原创 C - 最短路径问题 HDU - 3790

给你n个点,m条无向边,每条边都有长度d和花费p,给你起点s终点t,要求输出起点到终点的最短距离及其花费,如果最短距离有多条路线,则输出花费最少的。Input输入n,m,点的编号是1~n,然后是m行,每行4个数 a,b,d,p,表示a和b之间有一条边,且其长度为d,花费为p。最后一行是两个数 s,t;起点s,终点。n和m为0时输入结束。 (1&lt;n&lt;=1000, 0&lt;m&...

2018-08-14 19:51:24 397 1

原创 H - Play on Words POJ - 1386

Some of the secret doors contain a very interesting word puzzle. The team of archaeologists has to solve it to open that doors. Because there is no other way to open the doors, the puzzle is very impo...

2018-08-14 19:38:09 148

原创 F - 确定比赛名次 HDU - 1285

有N个比赛队(1&lt;=N&lt;=500),编号依次为1,2,3,。。。。,N进行比赛,比赛结束后,裁判委员会要将所有参赛队伍从前往后依次排名,但现在裁判委员会不能直接获得每个队的比赛成绩,只知道每场比赛的结果,即P1赢P2,用P1,P2表示,排名时P1在P2之前。现在请你编程序确定排名。 Input输入有若干组,每组中的第一行为二个数N(1&lt;=N&lt;=500),M;其中N表...

2018-08-14 19:10:14 97

原创 D - 六度分离 HDU - 1869

1967年,美国著名的社会学家斯坦利·米尔格兰姆提出了一个名为“小世界现象(small world phenomenon)”的著名假说,大意是说,任何2个素不相识的人中间最多只隔着6个人,即只用6个人就可以将他们联系在一起,因此他的理论也被称为“六度分离”理论(six degrees of separation)。虽然米尔格兰姆的理论屡屡应验,一直也有很多社会学家对其兴趣浓厚,但是在30多年的时间...

2018-08-14 19:05:08 110

原创 E - Is It A Tree? POJ - 1308

A tree is a well-known data structure that is either empty (null, void, nothing) or is a set of one or more nodes connected by directed edges between nodes satisfying the following properties. There ...

2018-08-09 17:46:47 109

原创 F - 数组的最大代价 51Nod - 1270

数组A包含N个元素A1, A2......AN。数组B包含N个元素B1, B2......BN。并且数组A中的每一个元素Ai,都满足1 &lt;= Ai &lt;= Bi。数组A的代价定义如下:  (公式表示所有两个相邻元素的差的绝对值之和)给出数组B,计算可能的最大代价S。Input第1行:1个数N,表示数组的长度(1 &lt;= N &lt;= 50000)。 第...

2018-08-09 17:37:46 109

原创 B - 小希的迷宫 HDU - 1272

上次Gardon的迷宫城堡小希玩了很久(见Problem B),现在她也想设计一个迷宫让Gardon来走。但是她设计迷宫的思路不一样,首先她认为所有的通道都应该是双向连通的,就是说如果有一个通道连通了房间A和B,那么既可以通过它从房间A走到房间B,也可以通过它从房间B走到房间A,为了提高难度,小希希望任意两个房间有且仅有一条路径可以相通(除非走了回头路)。小希现在把她的设计图给你,让你帮忙判断她的...

2018-08-09 17:35:18 127

空空如也

空空如也

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

TA关注的人

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