![](https://img-blog.csdnimg.cn/20201014180756757.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
笔记
文章平均质量分 66
是小张张呀 zsy
这个作者很懒,什么都没留下…
展开
-
java实现qq聊天(超详细)
java语言实践课内容:聊天室小程序或QQ功能要求:聊天室:使用图形用户界面,能实现一个聊天室中多人聊天,可以两人私聊,可以发送文件。QQ:实现类似QQ用户注册、登录、聊天等功能。注意:有一定等级。完全照搬别人的代码,不超过70分。提示:使用socket通信准备工作建立包,类,文件插入图片要创建一个文件夹,文件夹里保存的就是所需要的图片啦,比如我创建的文件夹为image;...原创 2022-05-31 20:05:49 · 19562 阅读 · 72 评论 -
E. Breaking the Wall
E. Breaking the Wall原创 2022-05-03 12:31:49 · 376 阅读 · 0 评论 -
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 阅读 · 0 评论 -
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 阅读 · 0 评论 -
差分(一维,二维,三维) 蓝桥杯三体攻击
如果一维二维已经没问题的可直接跳转*三维查分一维差分首先给定一个原数组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 · 434 阅读 · 0 评论 -
洛谷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 阅读 · 0 评论 -
区间和------离散化
离散化满足离散化的性质:值域大,数稀疏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 阅读 · 0 评论 -
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 · 85 阅读 · 0 评论 -
畅通工程再续
相信大家都听说一个“百岛湖”的地方吧,百岛湖的居民生活在不同的小岛中,当他们想去其他的小岛时都要通过划小船来实现。现在政府决定大力发展百岛湖,发展首先要解决的问题当然是交通问题,政府决定实现百岛湖的全畅通!经过考察小组RPRush对百岛湖的情况充分了解后,决定在符合条件的小岛间建上桥,所谓符合条件,就是2个小岛之间的距离不能小于10米,也不能大于1000米。当然,为了节省资金,只要求实现任意2个小岛之间有路通即可。其中桥的价格为 100元/米。Input输入包括多组数据。输入首先包括一个整数T(T &l原创 2021-08-10 09:14:37 · 50 阅读 · 0 评论 -
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 阅读 · 0 评论 -
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 阅读 · 0 评论 -
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 阅读 · 0 评论 -
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 阅读 · 0 评论 -
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 阅读 · 0 评论 -
P1536 村村通
题目描述某市调查城镇交通状况,得到现有城镇道路统计表。表中列出了每条道路直接连通的城镇。市政府 “村村通工程” 的目标是使全市任何两个城镇间都可以实现交通(但不一定有直接的道路相连,只要相互之间可达即可)。请你计算出最少还需要建设多少条道路?输入格式输入包含若干组测试测试数据,每组测试数据的第一行给出两个用空格隔开的正整数,分别是城镇数目 nn 和道路数目 mm ;随后的 mm 行对应 mm 条道路,每行给出一对用空格隔开的正整数,分别是该条道路直接相连的两个城镇的编号。简单起见,城镇从 11 到 n原创 2021-08-03 10:52:30 · 68 阅读 · 0 评论 -
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 · 171 阅读 · 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 · 115 阅读 · 0 评论 -
萌新(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 · 215 阅读 · 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 阅读 · 0 评论 -
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 阅读 · 0 评论 -
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 阅读 · 0 评论 -
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 阅读 · 0 评论 -
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 阅读 · 0 评论 -
最短路算法模板4种算法
最短路算法模板以下模板全部依据 此模板题 给出,一定要理解模板,具体题目请具体分析,不要死搬硬套另外,图论(最短路问题只是图论的一小部分)中一般有如下约定:nn 表示顶点数,mm 表示边数V/v(vertex)V/v(vertex) 表示顶点,E/e(edge)E/e(edge) 表示边uu 表示起点(也叫源点),vv 表示终点(也叫汇点),ww 表示边权最短路算法模板目录Dijkstra算法(包括朴素版和堆优化版)Bellman-Ford算法SPFA算法(Shortest Path Fa原创 2021-07-28 09:14:00 · 167 阅读 · 0 评论 -
大数据分析-data
大数据分析-data小x在做大数据分析。第一天分析的数据量为1个单位,此后计算机每天都会进行升级,因此每天能分析的数据量都会不同,设第ii天分析的数据量为AA,第i+1天分析的数据量为A*(A+5)。现在小x计划做30大数据分析,想知道三十天总计分析的数据量为多少。由于答案会很大,故只需要输出对1e9+7取模的结果即可;#include<bits/stdc++.h>using namespace std;const int mod=1e9+7;typedef long long l原创 2021-06-03 19:26:15 · 139 阅读 · 0 评论 -
计算几何
1.4.5 计算几何Descriptionuncle-lu对计算几何有着浓厚的兴趣。他经常对着平面直角坐标系发呆,思考一些有趣的问 题。今天,他想到了一个十分有意思的题目:首先,uncle-lu会在x轴正半轴和y轴正半轴分别挑选nn个点。随后,他将x轴的点与y轴 的点一一连接,形成nn条线段,并保证任意两条线段不相交。uncle-lu确定这种连接方式有且仅有一种。最后,uncle-lu会给出mm个询问。对于每个询问,将会给定一个点P (x_p, y_p)P(xp ,yp ),问线段OP原创 2021-06-02 18:59:05 · 226 阅读 · 0 评论 -
汉诺塔
标题汉诺塔递归#include<stdio.h>//uncle-lu//汉诺塔问题是将问题化简为更简单的问题。当你需要从A到B挪n(n>=2)个的时候,你应该先把上面n-1个挪到C上,然后再把第n个挪到B上,再把C上的n-1个挪回B//可以发现这是有边界的,当n==1时直接移动就可以了。所以我们直接找出一个挪n个的方法就可以了,然后处理好边界。void han(int n,char A,char B,char C){ if (n==1) { _______//obj原创 2021-06-01 20:39:46 · 56 阅读 · 0 评论 -
- Oil Deposits
标题A - Oil Deposits问题描述GeoSurvComp地质勘测公司负责检测地下油藏。GeoSurvComp一次处理一个大矩形区域的土地,并创建一个将土地划分为多个正方形图的网格。然后,它使用传感设备分别分析每个地块,以确定该地块是否包含油。包含油的地块称为矿穴。如果两个凹坑相邻,则它们是同一油藏的一部分。积油可能很大,可能包含许多凹穴。您的工作是确定网格中包含多少种不同的油藏。。输入值输入文件包含一个或多个网格。每个网格均以包含m和n的行开始,网格中的行和列数为m和n,并用单个空格原创 2021-05-27 20:32:58 · 43 阅读 · 0 评论 -
献给杭电五十周年校庆的礼物
献给杭电五十周年校庆的礼物Problem Description或许你曾经牢骚满腹或许你依然心怀忧伤或许你近在咫尺或许你我天各一方对于每一个学子母校永远航行在生命的海洋今年是我们杭电建校五十周年,这是一个值得祝福的日子。我们该送给母校一个怎样的礼物呢?对于目前的大家来说,最好的礼物当然是省赛中的好成绩,我不能参赛,就送给学校一个DOOM III球形大蛋糕吧,这可是名牌,估计要花掉我半年的银子呢。想象着正式校庆那一天,校长亲自操刀,把这个大蛋糕分给各地赶来祝贺的校友们,大家一定很高兴,呵转载 2021-05-19 14:46:07 · 175 阅读 · 2 评论 -
2021-05-03
er#include <bits/stdc++.h>#define ll long longusing namespace std;int const N=9e5+12;ll f[N],n,m,i,ans,cnt;struct edge{ll u,v,w;}e[N];bool cmp(edge a,edge b){return a.w<b.w;}ll find(ll x){if(f[x]!=x)f[x]=find(f[x]);return f[x];}原创 2021-05-03 10:56:43 · 38 阅读 · 0 评论 -
Tian Ji -- The Horse Racing
G - Tian Ji – The Horse Racing Here is a famous story in Chinese history. “That was about 2300 years ago. General Tian Ji was a high official in the country Qi. He likes to play horse racing with the king and others.”“Both of Tian and the king hav原创 2021-03-20 20:00:04 · 207 阅读 · 0 评论 -
pta出生年
团体程序设计天梯赛-练习集公告原PAT网站用户可在 https://www.patest.cn/bind_old_pat_user 页面绑定至拼题A账号。绑定后,原PAT网站的提交将被合并至拼题A网站用户的对应题目集中。L1-033 出生年 (15 分)以上是新浪微博中一奇葩贴:“我出生于1988年,直到25岁才遇到4个数字都不相同的年份。”也就是说,直到2013年才达到“4个数字都不相同”的要求。本题请你根据要求,自动填充“我出生于y年,直到x岁才遇到n个数字都不相同的年份”这句话。输入格式:原创 2021-03-11 15:27:50 · 217 阅读 · 0 评论 -
本题要求你计算A−B。不过麻烦的是,A和B都是字符串 ——
本题要求你计算A−B。不过麻烦的是,A和B都是字符串 —— 即从字符串A中把字符串B所包含的字符全删掉,剩下的字符组成的就是字符串A−B。输入格式:输入在2行中先后给出字符串A和B。两字符串的长度都不超过104 ,并且保证每个字符串都是由可见的ASCII码和空白字符组成,最后以换行符结束。输出格式:在一行中打印出A−B的结果字符串。输入样例:I love GPLT! It’s a fun game!aeiou输出样例:I lv GPLT! It’s fn gm!#incl原创 2021-03-10 16:53:28 · 4368 阅读 · 0 评论 -
Welcome to HDU to take part in the first CCPC girls‘ competition!
Welcome to HDU to take part in the first CCPC girls’ competition!As a pretty special competition, many volunteers are preparing for it with high enthusiasm.One thing they need to do is blowing the balloons.Before sitting down and starting the competitio原创 2021-03-09 16:16:49 · 120 阅读 · 0 评论 -
2021-01-28
让我们定义一个字符串a和正整数x之间的乘法运算:a⋅x是一个接一个地写x个副本的结果。例如,“ABC”⋅2 =“ABCABC”,“a”⋅5 =“aaaaa”。如果存在一个整数x,比如b⋅x=a.,那么一个字符串a可以被另一个字符串b整除,那么“ababab”可以被“ab”整除,但是不能被“ababab”或“aa”整除。两个字符串s和t的LCM(定义为LCM(s,t))是可被s和t除尽的最短非空字符串。给你两个字符串s和t,找到LCM(s,t)或者报告它不存在。可以证明,如果LCM(s,t)存在,则是唯原创 2021-01-28 23:38:42 · 75 阅读 · 0 评论 -
有一只经过训练的蜜蜂只能爬向右侧相邻的蜂房
有一只经过训练的蜜蜂只能爬向右侧相邻的蜂房,不能反向爬行。请编程计算蜜蜂从蜂房a爬到蜂房b的可能路线数。其中,蜂房的结构如下所示。Input输入数据的第一行是一个整数N,表示测试实例的个数,然后是N 行数据,每行包含两个整数a和b(0<a<b<50)。Output对于每个测试实例,请输出蜜蜂从蜂房a爬到蜂房b的可能路线数,每个实例的输出占一行。Sample Input21 23 6Sample Output13#include <stdio.h>#i原创 2021-01-21 19:02:51 · 734 阅读 · 1 评论 -
2021-01-21
今年的ACM暑期集训队一共有18人,分为6支队伍。其中有一个叫做EOF的队伍,由04级的阿牛、XC以及05级的COY组成。在共同的集训生活中,大家建立了深厚的友谊,阿牛准备做点什么来纪念这段激情燃烧的岁月,想了一想,阿牛从家里拿来了一块上等的牛肉干,准备在上面刻下一个长度为n的只由"E" “O” "F"三种字符组成的字符串(可以只有其中一种或两种字符,但绝对不能有其他字符),阿牛同时禁止在串中出现O相邻的情况,他认为,"OO"看起来就像发怒的眼睛,效果不好。你,NEW ACMer,EOF的崇拜者,能帮阿牛转载 2021-01-21 18:30:58 · 46 阅读 · 0 评论 -
2021-01-20
Alice and Bob received n candies from their parents. Each candy weighs either 1 gram or 2 grams. Now they want to divide all candies among themselves fairly so that the total weight of Alice’s candies is equal to the total weight of Bob’s candies.Check if原创 2021-01-20 21:42:01 · 65 阅读 · 0 评论