自定义博客皮肤VIP专享

*博客头图:

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

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

博客底图:

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

栏目图:

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

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

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

原创 java实现qq聊天(超详细)

java语言实践课内容:聊天室小程序或QQ功能要求:聊天室:使用图形用户界面,能实现一个聊天室中多人聊天,可以两人私聊,可以发送文件。QQ:实现类似QQ用户注册、登录、聊天等功能。注意:有一定等级。完全照搬别人的代码,不超过70分。提示:使用socket通信准备工作建立包,类,文件插入图片要创建一个文件夹,文件夹里保存的就是所需要的图片啦,比如我创建的文件夹为image;...

2022-05-31 20:05:49 19571 72

原创 E. Breaking the Wall

E. Breaking the Wall

2022-05-03 12:31:49 376

原创 F - Birthday Cake(山东省赛)

F - Birthday Cake(山东省赛)Moca’s birthday is coming up, and her friend Ran is going to the Yamabuki bakery to order a birthday cake for her.

2022-04-28 10:11:16 344

原创 java上机实验(三个) 继承

1.设计一个表示二维平面上点的类Point,包含有表示坐标位置的protected类型的成员变量x和y,获取和设置x和y值的public方法。2定义一个抽象类Printable,其中包括一个方法printItMyWay(),该方法是一个抽象方法,没有形参,返回值为空。3.(1)编写一个java应用程序,除了主类之外,该程序中还有4个类:People, ChinaPeople, AmericanPeople.和BeijingPeople类。要求如下:

2022-04-14 19:57:54 1791

原创 差分(一维,二维,三维) 蓝桥杯三体攻击

如果一维二维已经没问题的可直接跳转*三维查分一维差分首先给定一个原数组a:a[1], a[2], a[3], a[n];然后我们构造一个数组b : b[1] ,b[2] , b[3], b[i];使得 a[i] = b[1] + b[2 ]+ b[3] +, + b[i]a数组是b数组的前缀和数组,反过来我们把b数组叫做a数组的差分数组。考虑构造差分b数组最为直接的方法如下:a[0 ]= 0;b[1] = a[1] - a[0];b[2] = a[2] - a[1];b[3] =a

2022-03-02 14:46:36 435

原创 洛谷P1102 A-B数对(二分,map,双指针)

A-B数对描述这是一道简单题,给出一串数以及一个数字C,要求计算出所有A - B = C的数对的个数(不同位置的数字一样的数对算不同的数对)。

2022-02-25 17:30:00 1430 2

原创 第一讲-------基础算法 ACwing

第一讲-------基础算法快速排序----分治确定分界点 q[l],q[(l+r)/2],q[r],随机调整区间 (三部分)<= x x >=x递归处理左右两端快速排序算法模板 void quick_sort(int q[], int l, int r){ if (l >= r) return; int i = l - 1, j = r + 1, x = q[l + r >> 1]; while (i &

2022-02-17 10:45:12 596

原创 区间和------离散化

离散化满足离散化的性质:值域大,数稀疏a[ ] : { 1 , 3 , 100 , 200 , 500000000 } 映射下标:0 1 2 3 41.a[]中可能有重复的元素 去重2.如何计算出离散化的值 二分(此题有序)区间和假定有一个无限长的数轴,数轴上每个坐标上的数都是 0。现在,我们首先进行 n 次操作,每次操作将某一位置 x上的数加 c。接下来,进行 m 次询问,每个询问包含两个整数 l 和 r,你需要求出在区间 [l,r] 之间的所

2022-02-17 09:46:41 123 1

原创 HDU - 6024 Building Shops(女生赛)

C - Building ShopsHDU’s n classrooms are on a line ,which can be considered as a number line. Each classroom has a coordinate. Now Little Q wants to build several candy shops in these n classrooms.The total cost consists of two parts. Building a candy sh

2021-10-29 17:04:36 115

原创 HDU-6025-Coprime Sequence(女生赛)

Coprime SequenceDo you know what is called "Coprime Sequence’’? That is a sequence consists of nn positive integers, and the GCD (Greatest Common Divisor) of them is equal to 1."Coprime Sequence’’ is easy to find because of its restriction. But we can try

2021-10-29 14:18:11 64

原创 D - Function(HDU - 6546)女生赛

#include <iostream>#include <algorithm>#include <math.h>#include <queue>using namespace std;typedef long long ll;struct node{ ll a,b,c; ll mark; //标记x每次加一函数的增长f(x+1)-f(x); ll x; bool operator<(cons.

2021-10-28 11:19:17 77

原创 B - 代码派对(女生赛)

B - 代码派对Sample Input233 1 3 11 1 2 32 1 3 251 1 4 52 1 3 22 2 3 34 5 4 51 2 2 4Sample Output04//现在时刻,2021年10月28号00:38我终于ac了,,,,呜呜呜呜/*解题思路利用差分和二维前缀和求出每个格子上覆盖的区间数g[i][j]。如果这个时候求C(g[i][j],3)的和,那么会产生很多的重复,因为同样的三个区间可以覆盖多个格子。所以我们只保留覆盖区域左上

2021-10-28 00:47:23 167 1

原创 7-1 懂的都懂 (20 分)

2021 RoboCom 世界机器人开发者大赛-本科组(初赛)7-1 懂的都懂 (20 分)众所周知,在互联网上有很多话是不好直接说出来的,不过一些模糊的图片仍然能让网友看懂你在说什么。然而对这种言论依然一定要出重拳,所以请你实现一个简单的匹配算法。现在我们采集了原图的一些特征数据,由 N 个小于 255 的非负整数组成,假设对于给定的若干张由 M个同样小于 255 的非负整数组成的新图的特征数据,每个数据都可以由原图中任意四个不同数据的平均值计算而来,则称新图为原图的相似图片。对于给出的数据,请你

2021-10-13 15:24:55 261

原创 Find 3-friendly Integers

Find 3-friendly Integers链接:https://ac.nowcoder.com/acm/contest/11166/F来源:牛客网A positive integer is 3-friendly if and only if we can find a continuous substring in its decimal representation, and the decimal integer represented by the substring is a multi

2021-08-13 16:58:11 91

原创 Determine the Photo Position

Determine the Photo Position链接:https://ac.nowcoder.com/acm/contest/11166/D来源:牛客网输入:5 30000001110011100111000000222输出6输入3 210101010122输出0输入3 11010101012输出4#include <iostream>#include <cstdio>#include <algorithm

2021-08-13 16:46:51 59

原创 Ball Dropping

Ball Dropping题目链接:https://ac.nowcoder.com/acm/contest/11166/B来源:牛客网A standard sphere ball is falling in the air, and the center of the sphere is exactly on the centerline of an empty isosceles trapezoidal. The trapezoid is hanging horizontally under the

2021-08-13 16:31:00 83

原创 Alice and Bob (2021牛客暑期多校训练营1)

Alice and Bob2021牛客暑期多校训练营1第一题,当时没做出来,看了这个博主的博客,瞬间懂了题目链接:https://ac.nowcoder.com/acm/contest/11166/A来源:牛客网题目描述Alice and Bob like playing games. There are two piles of stones with numbers n and m. Alice and Bob take turns to operate, each operation can

2021-08-13 16:21:43 126

原创 Borg Maze (BFS+最小生成树)(解题报告)

Borg MazeThe Borg is an immensely powerful race of enhanced humanoids from the delta quadrant of the galaxy. The Borg collective is the term used to describe the group consciousness of the Borg civilization. Each Borg individual is linked to the collectiv

2021-08-12 11:36:23 134

原创 Interesting drink

Interesting drinkVasiliy likes to rest after a hard work, so you may often meet him in some bar nearby. As all programmers do, he loves the famous drink “Beecola”, which can be bought in n different shops in the city. It’s known that the price of one bott

2021-08-11 19:28:23 103

原创 Truck History

Truck HistoryAdvanced Cargo Movement, Ltd. uses trucks of different types. Some trucks are used for vegetable delivery, other for furniture, or for bricks. The company has its own code describing each type of a truck. The code is simply a string of exactl

2021-08-11 17:17:04 93

原创 Is There A Second Way Left?

Is There A Second Way Left?Nasa, being the most talented programmer of his time, can’t think things to be so simple. Recently allhis neighbors have decided to connect themselves over a network (actually all of them want to sharea broadband internet conn

2021-08-11 16:19:36 157

原创 Building a Space Station

You are a member of the space station engineering team, and are assigned a task in the construction process of the station. You are expected to write a computer program to complete the task.The space station is made up with a number of units, called cells

2021-08-11 10:02:06 125

原创 The Unique MST

The Unique MSTGiven a connected undirected graph, tell if its minimum spanning tree is unique.Definition 1 (Spanning Tree): Consider a connected, undirected graph G = (V, E). A spanning tree of G is a subgraph of G, say T = (V’, E’), with the following p

2021-08-10 16:38:22 49

原创 Constructing Roads

Constructing RoadsThere are N villages, which are numbered from 1 to N, and you should build some roads such that every two villages can connect to each other. We say two village A and B are connected, if and only if there is a road between A and B, or th

2021-08-10 10:32:34 86

原创 畅通工程再续

相信大家都听说一个“百岛湖”的地方吧,百岛湖的居民生活在不同的小岛中,当他们想去其他的小岛时都要通过划小船来实现。现在政府决定大力发展百岛湖,发展首先要解决的问题当然是交通问题,政府决定实现百岛湖的全畅通!经过考察小组RPRush对百岛湖的情况充分了解后,决定在符合条件的小岛间建上桥,所谓符合条件,就是2个小岛之间的距离不能小于10米,也不能大于1000米。当然,为了节省资金,只要求实现任意2个小岛之间有路通即可。其中桥的价格为 100元/米。Input输入包括多组数据。输入首先包括一个整数T(T &l

2021-08-10 09:14:37 50

原创 Networking

You are assigned to design network connections between certain points in a wide area. You are given a set of points in the area, and a set of possible routes for the cables that may connect pairs of points. For each possible route between two points, you a

2021-08-09 16:12:35 86

原创 Agri-Net

Farmer John has been elected mayor of his town! One of his campaign promises was to bring internet connectivity to all farms in the area. He needs your help, of course.Farmer John ordered a high speed connection for his farm and is going to share his conn

2021-08-09 15:12:16 65

原创 Navigation Nightmare

Farmer John’s pastoral neighborhood has N farms (2 <= N <= 40,000), usually numbered/labeled 1…N. A series of M (1 <= M < 40,000) vertical and horizontal roads each of varying lengths (1 <= length <= 1000) connect the farms. A map of thes

2021-08-09 10:22:30 99

原创 Telephone Lines

Farmer John wants to set up a telephone line at his farm. Unfortunately, the phone company is uncooperative, so he needs to pay for some of the cables required to connect his farm to the phone system.There are N (1 ≤ N ≤ 1,000) forlorn telephone poles con

2021-08-03 19:43:35 82

原创 P3367 【模板】并查集

#include <iostream>#include <string.h>#include <cstdio>#include <queue>#include <math.h>using namespace std;int fa[1000001],n,m,x,y,z,ans;int find(int x){ if(x!=fa[x]) { fa[x]=find(fa[x]); } re.

2021-08-03 11:21:20 45

原创 P1536 村村通

题目描述某市调查城镇交通状况,得到现有城镇道路统计表。表中列出了每条道路直接连通的城镇。市政府 “村村通工程” 的目标是使全市任何两个城镇间都可以实现交通(但不一定有直接的道路相连,只要相互之间可达即可)。请你计算出最少还需要建设多少条道路?输入格式输入包含若干组测试测试数据,每组测试数据的第一行给出两个用空格隔开的正整数,分别是城镇数目 nn 和道路数目 mm ;随后的 mm 行对应 mm 条道路,每行给出一对用空格隔开的正整数,分别是该条道路直接相连的两个城镇的编号。简单起见,城镇从 11 到 n

2021-08-03 10:52:30 68

原创 C. K-Complete Word

C. K-Complete Wordtime limit per test2 secondsmemory limit per test512 megabytesinputstandard inputoutputstandard outputWord s of length n is called k-complete ifs is a palindrome, i.e. si=sn+1−i for all 1≤i≤n;s has a period of k, i.e. si=sk+i for a

2021-08-02 18:14:18 172 1

原创 Roadblocks 和Two Paths(次短路) -

Bessie has moved to a small farm and sometimes enjoys returning to visit one of her best friends. She does not want to get to her old home too quickly, because she likes the scenery along the way. She has decided to take the second-shortest rather than the

2021-08-02 10:42:09 116

原创 萌新(2021百度之星)

萌新Accepts: 1617 Submissions: 12270Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Problem Description给定两个正整数 a,b,求最小和最大的 c 满足 a mod c=b mod c,满足 c-1 为正整数,且 c≤max(a,b)。其中的 mod 表示取模运算。Input本题有多组测试数据。第一行一个数 T(1≤T≤1000

2021-08-01 16:42:26 217 1

转载 Silver Cow Part

Silver Cow PartyOne cow from each of N farms (1 ≤ N ≤ 1000) conveniently numbered 1…N is going to attend the big cow party to be held at farm #X (1 ≤ X ≤ N). A total of M (1 ≤ M≤ 100,000) unidirectional (one-way roads connects pairs of farms; road i requi

2021-07-31 10:33:29 62

转载 Alphabetical Strings

B. Alphabetical Stringstime limit per test2 secondsmemory limit per test512 megabytesinputstandard inputoutputstandard outputA string s of length n (1≤n≤26) is called alphabetical if it can be obtained using the following algorithm:删除线格式first, write

2021-07-30 18:56:14 156

原创 Six Degrees of Cowvin Bacon (floyd&&Dijkstra算法)

Six Degrees of Cowvin Bacon题意:牛们最近在拍电影,所以他们准备去玩一个游戏——“六度分割”的变体。 游戏是这样进行的:每个牛离自己的距离是0度,如果两个不同的牛同时出现在一个电影里,那么他们之间的距离为1度,如果两只牛从未一起工作,但它们都与第三只牛一起工作,那么他们之间的距离为2度。 这N(2<=N<=300)头牛对找出那只牛与所有牛之间的平均距离最短感兴趣。当然,不算上他自己。这些牛拍了M(1<=M<=10000)部电影,并且保证每两个牛之间都有一定

2021-07-30 16:20:29 171

转载 Wormholes(Floyd和Bellman-Ford算法)

Wormholes(Floyd)In the year 2163, wormholes were discovered. A wormhole is a subspace tunnel through space and time connecting two star systems. Wormholes have a few peculiar properties:Wormholes are one-way only.The time it takes to travel through a wo

2021-07-30 14:56:49 380

原创 Wormholes(Floyd)Dijkstra算法变形

Heavy TransportationDijkstra算法变形BackgroundHugo Heavy is happy. After the breakdown of the Cargolifter project he can now expand business. But he needs a clever man who tells him whether there really is a way from the place his customer has build his gia

2021-07-30 10:20:32 68

原创 A - 最短路 Dijkstra算法(朴素版)

Dijkstra算法(朴素版)A - 最短路在每年的校赛里,所有进入决赛的同学都会获得一件很漂亮的t-shirt。但是每当我们的工作人员把上百件的衣服从商店运回到赛场的时候,却是非常累的!所以现在他们想要寻找最短的从商店到赛场的路线,你可以帮助他们吗?Input输入包括多组数据。每组数据第一行是两个整数N、M(N<=100,M<=10000),N表示成都的大街上有几个路口,标号为1的路口是商店所在地,标号为N的路口是赛场所在地,M则表示在成都有几条路。N=M=0表示输入结束。接下来M行,

2021-07-28 10:07:17 125

空空如也

空空如也

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

TA关注的人

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