自定义博客皮肤VIP专享

*博客头图:

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

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

博客底图:

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

栏目图:

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

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+
  • 博客(172)
  • 资源 (1)
  • 收藏
  • 关注

原创 设计一个钟表类Clock,包括时、分、秒等私有数据成员。要求重载比较运算符“==”、“!=”,以实现该类的对象的比较运算。

#include <iostream>#include <cmath>using namespace std;class date{public:date(){a = 0, b = 0, c = 0;}date(int aa, int bb, int cc){a = aa; b = bb; c = cc;}friend...

2019-04-22 20:56:25 5929

原创 设计一个日期类Date,包括年、月、日等私有数据成员。要求实现日期的基本运算,如一日期加上天数、一日期减去天数、两日期 相差的天数等。要求:使用运算符重载。

#include <iostream>#include <cmath>using namespace std;class date{public:date(){a = 0, b = 0, c = 0;}date(int aa, int bb, int cc){a = aa; b = bb; c = cc;}friend...

2019-04-22 20:55:52 7236 1

原创 设计一个三角形类Triangle,包含三角形三条边长的私有数据成员,另有一个重载运算符”+”,以实现求两个三角形对象的面积之和。

#include <iostream>#include <cmath>using namespace std;class tri{public:tri(){a = 0, b = 0, c = 0;}tri(int a, int b, int c):a(a),b(b),c(c){}friend tri operator ...

2019-04-22 20:55:13 7498 1

原创 定义一个Complex类,为其定义构造函数,析构函数,试对下列几个运算符进行重载:++,=,!=,+,-,==,其中要求要有成员重载形式和友元重载形式,而且,++运算符要求实现先加和后加两种形式。

#include <iostream>#include <cmath>using namespace std;class com{public:com(){a = 0;}com(int x):a(x){};friend com operator + (com &c1, com &c2);...

2019-04-22 20:54:10 1495

原创 数据结构实验之图论十:判断给定图是否存在合法拓扑序列

Problem Description 给定一个有向图,判断该有向图是否存在一个合法的拓扑序列。Input 输入包含多组,每组格式如下。第一行包含两个整数n,m,分别代表该有向图的顶点数和边数。(n&lt;=10)后面m行每行两个整数a b,表示从a到b有一条有向边。 Output 若给定有向图存在合法拓扑序列,则输出YES;否则输出NO。 Sample I...

2018-12-07 20:14:46 281

原创 数据结构实验之链表六:有序链表的建立

Problem Description输入N个无序的整数,建立一个有序链表,链表中的结点按照数值非降序排列,输出该有序链表。Input第一行输入整数个数N;第二行输入N个无序的整数。Output依次输出有序链表的结点值。Sample Input633 6 22 9 44 5Sample Output5 6 9 22 33 44Hint不得使用数组...

2018-10-18 15:49:18 162

原创 数据结构实验之栈与队列八:栈的基本操作

Problem Description堆栈是一种基本的数据结构。堆栈具有两种基本操作方式,push 和 pop。push一个值会将其压入栈顶,而 pop 则会将栈顶的值弹出。现在我们就来验证一下堆栈的使用。Input首先输入整数t(1 &lt;= t &lt;= 10),代表测试的组数,以后是 t 组输入。 对于每组测试数据,第一行输入两个正整数 m(1 &lt;= m &lt;= ...

2018-10-11 12:38:37 196

原创 数据结构实验之栈与队列十一:refresh的停车场

Problem Description refresh最近发了一笔横财,开了一家停车场。由于土地有限,停车场内停车数量有限,但是要求进停车场的车辆过多。当停车场满时,要进入的车辆会进入便道等待,最先进入便道的车辆会优先进入停车场,而且停车场的结构要求只出去的车辆必须是停车场中最后进去的车辆。现告诉你停车场容量N以及命令数M,以及一些命令(Add num 表示车牌号为num的车辆要进入停车场...

2018-10-11 10:07:50 111

原创 A. Benches

A. Benchestime limit per test1 secondmemory limit per test256 megabytesinputstandard inputoutputstandard outputThere are nn benches in the Berland Central park. It is known that aiai...

2018-09-20 22:15:25 374

翻译 B. Vitamins

B. Vitaminstime limit per test2 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputBerland shop sells nn kinds of juices. Each juice has its price cici....

2018-09-20 22:10:38 546

原创 Frogger POJ - 2253

Freddy Frog is sitting on a stone in the middle of a lake. Suddenly he notices Fiona Frog who is sitting on another stone. He plans to visit her, but since the water is dirty and full of tourists' sun...

2018-09-11 09:16:05 126

原创 数据结构实验之栈与队列三:后缀式求值

数据结构实验之栈与队列三:后缀式求值Time Limit: 1000 ms Memory Limit: 65536 KiBProblem Description对于一个基于二元运算符的后缀表示式(基本操作数都是一位正整数),求其代表的算术表达式的值。Input输入一个算术表达式的后缀式字符串,以‘#’作为结束标志。Output求该后缀式所对应的算术表达式的值,并输出之。...

2018-09-08 20:04:38 124

翻译 Punching Power

AC代码(二分图匹配问题)Select Code#include &lt;iostream&gt;#include &lt;vector&gt;#include &lt;bits/stdc++.h&gt;#define maxn 20010using namespace std;int vis[maxn], link[maxn], n;vector&lt;int&gt...

2018-09-07 15:19:48 158

原创 Dark Ride with Monsters

AC代码Select Code#include &lt;iostream&gt;#include &lt;bits/stdc++.h&gt;using namespace std;int main(){ //freopen("monsters.cpp", "r", stdin); int n, i, t; long long ans; i...

2018-09-07 14:17:49 134

原创 Forest Picture

Input SpecificationThere are more test cases. Each case starts with a line containing two integersM,Nseparatedby space (1≤M≤100, 1≤N≤105). Next, there areNlines, ...

2018-09-07 14:13:48 243

原创 Amusement Anticipation

Amusement Anticipationamusement.c,amusement.cpp,amusement.c11,Amusement.java,amusement.pyIt is was late Saturday morning at the end of October. The amusement park was going to be...

2018-09-07 14:11:58 403

翻译 单源最大权路径 CSU - 1960

有一棵由N个结点构成的树,每一条边上都有其对应的权值。现在给定起点,求从该点出发的一条路径(至少有一条边)使得这条路径上的权值之和最大,并输出这个最大值。Input第一行一个正整数T,代表数据组数。每组数据第一行两个正整数n(2&lt;=n&lt;=10^5),s(1&lt;=s&lt;=n),分别表示树结点数目以及给定的起点,点的编号从1至N。接下来M行,每行三个整数x,y,z,(1&l...

2018-09-06 10:39:52 111

原创 Preparing for Exams Gym - 101778G

StatementsRan Mouri and Sonoko Suzuki are preparing for the final exams. They decided to study mathematics as it is the hardest subject for them. While they are solving mathematical problems, they f...

2018-09-05 11:10:02 237

原创 Genta Game Gym - 101778H

Kojima Genta is one of the best friends of Conan, and the fattest one!Everyone believes that Genta is just thinking about food. So, he wants to prove the opposite. So, his friends challenged him in ...

2018-09-05 10:14:36 132

原创 Rescue Haibara Gym - 101778E

Haibara is one of Conan's best friends. Conan sent her as a spy in order to discover the killer in one of his investigations. Haibara was on her first mission as a spy. Unfortunately, her mission did ...

2018-09-05 10:12:33 293

原创 UEFA Champions League Gym - 101778I

StatementsConan is always busy investigating murders, and he rarely finds an opportunity to enjoy his time. His friend Ran told him that this lifestyle harms his health, and this may lead to prematu...

2018-09-05 10:11:11 267

翻译 最大数maxnumber HYSBZ - 1012

 现在请求你维护一个数列,要求提供以下两种操作:1、 查询操作。语法:Q L 功能:查询当前数列中末尾L个数中的最大的数,并输出这个数的值。限制:L不超过当前数列的长度。2、 插入操作。语法:A n 功能:将n加上t,其中t是最近一次查询操作的答案(如果还未执行过查询操作,则t=0),并将所得结果对一个固定的常数D取模,将所得答案插入到数列的末尾。限制:n是非负整数并且在长整范围内。注意:初...

2018-08-29 21:12:17 75

原创 Mike and palindrome CodeForces - 798A

Mike has a string s consisting of only lowercase English letters. He wants to change exactly onecharacter from the string so that the resulting one is a palindrome.A palindrome is a string that read...

2018-08-29 19:21:02 156

翻译 Longest k-Good Segment CodeForces - 616D

The array a with n integers is given. Let's call the sequence of one or more consecutive elements in a segment. Also let's call the segment k-goodif it contains no more than k different values.Find ...

2018-08-28 21:09:24 155

原创 数据结构实验之图论六:村村通公路

数据结构实验之图论六:村村通公路Time Limit: 1000 ms Memory Limit: 65536 KiBSubmit Statistic DiscussProblem Description当前农村公路建设正如火如荼的展开,某乡镇政府决定实现村村通公路,工程师现有各个村落之间的原始道路统计数据表,表中列出了各村之间可以建设公路的若干条道路的成本,你的任务是根据给出的数...

2018-08-28 19:44:51 121

原创 Restructuring Company CodeForces - 566D

Even the most successful company can go through a crisis period when you have to make a hard decision — to restructure, discard and merge departments, fire employees and do other unpleasant stuff. Let...

2018-08-27 21:31:16 112

原创 Killer Problem UVA - 11898

AC代码(暴力+剪枝) Select Code#include &lt;iostream&gt;#include &lt;bits/stdc++.h&gt;using namespace std;int a[200000+10], b[200000+10];int main(){ int t, n, i, q, l, r, h; scanf("%d",&...

2018-08-27 19:30:00 115

原创 Jungle Roads POJ - 1251

The Head Elder of the tropical island of Lagrishan has a problem. A burst of foreign aid money was spent on extra roads between villages some years ago. But the jungle overtakes roads relentlessly,...

2018-08-25 10:29:17 117

翻译 4个数和为0 51Nod - 1267

给出N个整数,你来判断一下是否能够选出4个数,他们的和为0,可以则输出"Yes",否则输出"No"。Input第1行,1个数N,N为数组的长度(4 &lt;= N &lt;= 1000) 第2 - N + 1行:Aii(-10^9 &lt;= Aii &lt;= 10^9)Output如果可以选出4个数,使得他们的和为0,则输出"Yes",否则输出"No"。Sample In

2018-08-24 21:03:17 267

原创 权势二进制 51Nod - 1413

一个十进制整数被叫做权势二进制,当他的十进制表示的时候只由0或1组成。例如0,1,101,110011都是权势二进制而2,12,900不是。当给定一个n的时候,计算一下最少要多少个权势二进制相加才能得到n。 Input单组测试数据。 第一行给出一个整数n (1&lt;=n&lt;=1,000,000)Output输出答案占一行。Sample Input9Sa...

2018-08-24 20:26:12 170

原创 翻翻棋 FZU - 2230

象棋翻翻棋(暗棋)中双方在4*8的格子中交战,有时候最后会只剩下帅和将。根据暗棋的规则,棋子只能上下左右移动,且相同的级别下,主动移动到地方棋子方将吃掉对方的棋子。将和帅为同一级别。然而胜负在只剩下帅和将的时候已定。Input第一行T,表示T组数据。每组数据共有四行字符串,每行字符串共八个字符’#’表示空格’*’表示红方帅’.’表示黑方将此时红方先走 每组输入之...

2018-08-24 20:24:45 114

原创 0和5 51Nod - 1433

小K手中有n张牌,每张牌上有一个一位数的数,这个字数不是0就是5。小K从这些牌在抽出任意张(不能抽0张),排成一行这样就组成了一个数。使得这个数尽可能大,而且可以被90整除。注意:1.这个数没有前导0,2.小K不需要使用所有的牌。 Input每个测试数据输入共2行。 第一行给出一个n,表示n张牌。(1&lt;=n&lt;=1000) 第二行给出n个整数a00,a11,a...

2018-08-24 20:21:19 122

原创 数据大搜索 UESTC - 59

写一个程序,把一个字符串中的数字子序列找出来并转换成十进制整数输出。Input第一行是整数nn,表示测试的数据组数,下面是nn行无空格的字符串(长度不超过200)。题目保证字符串中含的整数位数小于99位,不考虑负数情形。Output每一行输入对应一行输出,一行中若有多个数据,每个数据后有一个空格。Sample Input100tUrA-Hc:T#7yN`;J0123Y+...

2018-08-24 19:50:45 101

翻译 数组中和等于K的数对 51Nod - 1001

给出一个整数K和一个无序数组A,A的元素为N个互不相同的整数,找出数组A中所有和等于K的数对。例如K = 8,数组A:{-1,6,5,3,4,2,9,0,8},所有和等于8的数对包括(-1,9),(0,8),(2,6),(3,5)。Input第1行:用空格隔开的2个数,K N,N为A数组的长度。(2 &lt;= N &lt;= 50000,-10^9 &lt;= K &lt;= 10^9)...

2018-08-24 19:49:24 124

原创 Catch That Cow POJ - 3278

Farmer John has been informed of the location of a fugitive cow and wants to catch her immediately. He starts at a point N (0 ≤ N ≤ 100,000) on a number line and the cow is at a point K (0 ≤ K ≤ 100,0...

2018-08-24 10:50:30 84

翻译 非常可乐 HDU - 1495

大家一定觉的运动以后喝可乐是一件很惬意的事情,但是seeyou却不这么认为。因为每次当seeyou买了可乐以后,阿牛就要求和seeyou一起分享这一瓶可乐,而且一定要喝的和seeyou一样多。但seeyou的手中只有两个杯子,它们的容量分别是N 毫升和M 毫升 可乐的体积为S (S&lt;101)毫升 (正好装满一瓶) ,它们三个之间可以相互倒可乐 (都是没有刻度的,且 S==N+M,101>S>...

2018-08-24 10:22:54 69

翻译 Oil Deposits

Problem 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...

2018-08-24 09:27:13 122

翻译 迷宫问题 POJ - 3984

定义一个二维数组: int maze[5][5] = { 0, 1, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 0, 0, 0, 0, 1, 0,};它表示一个迷宫,其中的1表示墙壁,0表示可以走的路,只能横着走或竖着走,不能斜着走,要求编程序找出从左上角到右下角的最短路线。Input一个5 ×...

2018-08-24 08:52:45 115

翻译 Uberwatch Gym - 101873I

AC代码(dp 纪念一下第一次做dp的题目)Select Code#include &lt;iostream&gt;#include &lt;map&gt;#include &lt;bits/stdc++.h&gt;#define maxn 300010using namespace std;int dp[maxn];int a[maxn];int mx[maxn]...

2018-08-23 15:37:59 360

翻译 Pants On Fire Gym - 101873D

AC代码(第一次用map感觉map就像是一个很厉害的数组)Select Code#include &lt;iostream&gt;#include &lt;map&gt;#include &lt;bits/stdc++.h&gt;using namespace std;int mp[200][200];map&lt;string, int&gt;id;int ma...

2018-08-23 15:09:44 353

基于Wxpython的可视化教师资源管理系统 python_源码.py

该系统为教师资源管理系统。运用WXpython与mysql实现可视化界面,能够实现基本的增删改查。具有登录界面能够实现管理员与教师的双重身份登录且能顾进行密码校验。

2020-01-08

空空如也

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

TA关注的人

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