自定义博客皮肤VIP专享

*博客头图:

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

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

博客底图:

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

栏目图:

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

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

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

原创 蓝桥杯双向排序

题目原始序列是一个升序序列,那么第一个有效操作必须是前缀操作,即降序。且有序操作必定是交替进行的。同样是前缀,如果前一次比后一次长,第二次也不需要排了。因为都是降序,它本来就是有序的。如果有两次连续的前缀操作,由于它们都是降序排列,等价于只做第二次排列,忽略掉第一次。线段树和堆栈都可以。,需要将时间复杂度控制在。

2023-11-28 14:41:01 142

原创 linux github下载命令

wget后跟的下载链接为:原http网址+/archive/refs/heads/main.zip。具体的链接地址可以查看页面源码(download zip那一块看到)

2023-01-04 09:08:14 1169

原创 Mac 启动rabbitmq

问题描述(尚医通项目)因为没有启动rabbitmq,所以导致挂号成功后,排班信息没有更新。解决办法

2022-05-12 12:48:04 902

原创 进制转换Java实现

1.利用java里面的api进行进制转换long a=Long.valueOf(str, k);String ans=Long.toString(x,k).toUpperCase();2.实现方法string toAns(ll n, int ne)//10进制转化为任意进制{ if (n == 0)return "0"; string str; while (n) { int tm = n % ne; if (tm <= 9) { str += '0' + tm; }

2021-12-03 21:09:08 137

原创 N皇后问题—Java

import java.util.*;public class Main{ static Scanner sc=new Scanner(System.in); static int n,m,ans; static int []col=new int [12]; // static boolean []line,row,dia;//line:行 row:列 diagonal:对角线 public static void main(String []args) {

2021-03-10 09:07:54 76

原创 Java实现全排列

文章目录一、整型数组全排列二、字符串的全排列一、整型数组全排列示例:pandas 是基于NumPy 的一种工具,该工具是为了解决数据分析任务而创建的。二、字符串的全排列题目描述给定一个由不同的小写字母组成的字符串,输出这个字符串的所有全排列。 我们假设对于小写字母有’a’ < ‘b’ < … < ‘y’ < ‘z’,而且给定的字符串中的字母已经按照从小到大的顺序排列。输入描述输入只有一行,是一个由不同的小写字母组成的字符串,已知字符串的长度在1到6之间。输出描述

2021-03-09 16:30:54 1163

原创 Java对数组降序排序

利用sortInteger []a=new Integer [1010];。。。Arrays.sort(a,Collections.reverseOrder());利用Comparator接口复写compare方法//想要改变默认的排序顺序,不能使用基本类型(int,double,char),而要使用对应的类Integer[]arr=new int [1010];Comparaot cmp=new MyComparator();//定义一个自定义类MyComparator的对象。。。Ar

2021-01-17 13:16:10 1344

原创 快速判断素数

/*大于3的素数只有6N-1和6N+1两种形式,所以只需判定这两种数是素数还是合数即可。 即 质数总是等于6x-1或者6x+1,其中x是大于等于1的自然数。 即 大于等于5的素数与6的倍数相邻 证明:6x不是质数,能被6整除;6x+2能被2整除。+3能被3整除,+4能被2整除。 只剩下6x+1和6x+5 (6x-1)可能是质数了。所以循环步长可以设为6,每次只判断6两侧的数即可。 对于输入的自然数n较小时,也许效果不明显。当n越来越大后,该方法的执行效率就会越来越明显

2021-01-16 20:44:12 104

原创 codeforces 149B-Move and Turn

import java.util.*;public class Main{ static Scanner sc=new Scanner(System.in); static int t,n; public static void main(String []args) { n=sc.nextInt(); if(n%2==1){ /*n=2k+1奇数时,从水平一步开始,总共有k+1水平步骤和k垂直步骤,所以组合个数为(k+1)*

2020-12-20 14:32:21 150

原创 终端进入mysql和退出

sudo su #输入本机密码/usr/local/mysql/bin/mysql -u root -p #输入mysql密码(我的:1234qwer)exit #退出

2020-11-24 10:56:52 456

原创 centos安装OpenStack error1045root访问受限

[root@localhost ~]# mysql -uroot -p000000ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: YES)[root@localhost ~]# su -s /bin/sh -c "nova-manage api_db sync" nova[root@localhost ~]# mysql -uroot -p000000ERROR 1045 (28000):

2020-10-28 18:02:24 437 1

原创 centos系统连网问题

我今天刚在虚拟机上装完centos系统,第一件事打开系统自带的火狐浏览器,一看怎么没有网呢???我想起上一次我装centos后,艰辛的连网过程,实在不想要。就抱着运气从它的(可能是)新手教程中看看有什么解决办法,看到了get online。连网呀!!!一激动,点进去,按着它说明将右上角网络连接开启,问题解决!!!开心!这算是一个连网的解决办法吧 毕竟我之前好像没有看到人讲过这个(可能太基础了)...

2020-10-19 21:07:51 91

原创 Mac idea在plugins中搜不到插件

打开plugins:左上角Intellj IDEA->Preference -> Plugins 。然后再Marketplace 中搜索需要的插件。重点来了。如果你搜不到插件,且网上各种方法都试过了,那么如果你不是连得手机热点,那试试打开手机热点再试试吧。...

2020-09-28 22:36:17 659

原创 hdu4864 Task

Time Limit: 4000/2000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 16172 Accepted Submission(s): 4032Problem DescriptionToday the company has m tasks to complete. The ith task need xi minutes to complete. Meanwhil

2020-09-08 10:42:03 55

原创 Worker HDU - 6576

Avin meets a rich customer today. He will earn 1 million dollars if he can solve a hard problem. There are n warehouses and m workers. Any worker in the i-th warehouse can handle ai orders per day. The customer wonders whether there exists one worker assig

2020-09-03 13:29:10 120

原创 D - Wave HDU - 6570

暴力求解Avin is studying series. A series is called “wave” if the following conditions are satisfied:It contains at least two elements;All elements at odd positions are the same;All elements at even positions are the same;Elements at odd positions are N

2020-09-02 13:32:24 124

原创 Traffic

Avin is observing the cars at a crossroads. He finds that there are n cars running in the east-west direction with the i-th car passing the intersection at time ai . There are another m cars running in the north-south direction with the i-th car passing th

2020-09-02 12:37:06 200

原创 Assign the task

There is a company that has N employees(numbered from 1 to N),every employee in the company has a immediate boss (except for the leader of whole company).If you are the immediate boss of someone,that person is your subordinate, and all his subordinates are

2020-08-30 18:54:47 478

原创 Tunnel Warfare

在抗日战争期间,华北平原广大地区进行了大规模的隧道战。 一般来说,通过隧道连接的村庄排成一列。 除了两端,每个村庄都与两个相邻的村庄直接相连。入侵者经常对一些村庄发动袭击并摧毁其中的部分隧道。 八路军指挥官要求最新的隧道和村庄连接状态。 如果某些村庄严重隔离,必须立即恢复连接!Input输入的第一行包含两个正整数n和m(n,m≤50,000),表示村庄和事件的数量。 接下来的m行中的每一行描述一个事件。以下所示的不同格式描述了三种不同的事件:D x:第x个村庄被毁。Q x:指挥官询问第x个村庄与

2020-08-30 13:38:40 280

原创 Can you answer these queries?

A lot of battleships of evil are arranged in a line before the battle. Our commander decides to use our secret weapon to eliminate the battleships. Each of the battleships can be marked a value of endurance. For every attack of our secret weapon, it could

2020-08-29 22:26:49 130

原创 Count the Colors

Painting some colored segments on a line, some previously painted segments may be covered by some the subsequent ones.Your task is counting the segments of different colors you can see at last.InputThe first line of each data set contains exactly one in

2020-08-29 15:54:26 83

原创 A Simple Problem with Integers

You have N integers, A1, A2, … , AN. You need to deal with two kinds of operations. One type of operation is to add some given number to each number in a given interval. The other is to ask for the sum of numbers in a given interval.InputThe first line c

2020-08-27 23:49:48 116

原创 The Water Problem

In Land waterless, water is a very limited resource. People always fight for the biggest source of water. Given a sequence of water sources with a1,a2,a3,......,ana_{1},a_{2},a_{3},......,a_{n}a1​,a2​,a3​,......,an​ representing the size of the water sourc

2020-08-23 13:49:15 281

原创 Color the ball

N个气球排成一排,从左到右依次编号为1,2,3…N.每次给定2个整数a b(a <= b),lele便为骑上他的“小飞鸽"牌电动车从气球a开始到气球b依次给每个气球涂一次颜色。但是N次以后lele已经忘记了第I个气球已经涂过几次颜色了,你能帮他算出每个气球被涂过几次颜色吗?Input每个测试实例第一行为一个整数N,(N <= 100000).接下来的N行,每行包括2个整数a b(1 <= a <= b <= N)。当N = 0,输入结束。Output每个测试实例输出一

2020-08-19 09:57:28 94

原创 Stars

Astronomers often examine star maps where stars are represented by points on a plane and each star has Cartesian coordinates. Let the level of a star be an amount of the stars that are not higher and not to the right of the given star. Astronomers want to

2020-08-19 09:41:07 140

原创 Nearest Common Ancestors

A rooted tree is a well-known data structure in computer science and engineering. An example is shown below:In the figure, each node is labeled with an integer from {1, 2,…,16}. Node 8 is the root of the tree. Node x is an ancestor of node y if node x is

2020-08-15 20:02:38 249

原创 C - Constructing Roads

There 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 there exists a villag

2020-08-08 16:41:19 123

原创 H - 畅通工程再续

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

2020-08-08 14:06:14 104

原创 G - 还是畅通工程

Description\color{blue}{Description}Description某省调查乡村交通状况,得到的统计表中列出了任意两村庄间的距离。省政府“畅通工程”的目标是使全省任何两个村庄间都可以实现公路交通(但不一定有直接的公路相连,只要能间接通过公路可达即可),并要求铺设的公路总长度为最小。请计算最小的公路总长度。Input\color{blue}{Input}Input测试输入包含若干测试用例。每个测试用例的第1行给出村庄数目N ( < 100 );随后的N(N-1)/2行对应

2020-08-07 15:37:23 85

原创 A-Jungle Roads

Description\color{blue}{Description}DescriptionThe 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, so the lar

2020-08-07 15:25:49 137

原创 spfa算法最短路

介绍SPFA(Shortest Path Faster Algorithm) 算法是 Bellman-Ford算法 的队列优化算法的别称,通常用于求含负权边的单源最短路径,以及判负权环。SPFA 最坏情况下复杂度和朴素 Bellman-Ford 相同,为 O(VE)。为了避免最坏情况的出现,在正权图上应使用效率更高的Dijkstra算法。算法特点1.时间复杂度比Dijkstra和ford低。2.能够计算负权图的问题。3.能够判断是否有负环。4.与bfs算法比较,复杂度相对稳定,但在稠密图中复杂

2020-08-02 23:20:06 351

原创 Wormholes

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 is BEFORE you entered the wormhole! Each of FJ’s farms co

2020-08-02 23:18:28 124

原创 异或运算

异或运算异或,英文为exclusive OR。异或略称为XOR、EOR、EX-OR异或(xor)是一个数学运算符。它应用于逻辑运算。异或的数学符号为“⊕”,计算机符号为“xor”。异或也叫半加运算,其运算法则相当于不带进位的二进制加法:二进制下用1表示真,0表示假,则异或的运算法则为:0⊕0=0,1⊕0=1,0⊕1=1,1⊕1=0(同为0,异为1),这些法则与加法是相同的,只是不带进位,所以异或常被认作不进位加法。按位异或的3个特点:(1) 00=0,01=1 0异或任何数=任何数(2) 1

2020-08-01 21:52:11 1113

原创 兔子的区间密码

题目链接:牛客OI周赛8-普及组 NC20860题目链接:https://ac.nowcoder.com/acm/problem/20860来源:牛客网有一只可爱的兔子被困在了密室了,密室里有两个数字,还有一行字:只有解开密码,才能够出去。可爱的兔子摸索了好久,发现密室里的两个数字是表示的是一个区间[L,R]而密码是这个区间中任意选择两个(可以相同的)整数后异或的最大值。比如给了区间[2,5] 那么就有2 3 4 5这些数,其中 2 xor 5=7最大 所以密码就是7。兔子立马解开了密室

2020-08-01 21:50:37 356

原创 Frogger

Description\color{blue}{Description}DescriptionFreddy 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’ sunscreen,

2020-07-30 23:12:49 138

原创 D - 六度分离

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

2020-07-29 18:42:56 137

原创 C - Til the Cows Come Home

Description\color{blue}{Description}DescriptionBessie is out in the field and wants to get back to the barn to get as much sleep as possible before Farmer John wakes her for the morning milking. Bessie needs her beauty sleep, so she wants to get back as q

2020-07-29 18:19:27 156

原创 B - HDU Today

Description\color{blue}{Description}Description经过锦囊相助,海东集团终于度过了危机,从此,HDU的发展就一直顺风顺水,到了2050年,集团已经相当规模了,据说进入了钱江肉丝经济开发区500强。这时候,XHD夫妇也退居了二线,并在风景秀美的诸暨市浬浦镇陶姚村买了个房子,开始安度晚年了。这样住了一段时间,徐总对当地的交通还是不太了解。有时很郁闷,想去一个地方又不知道应该乘什么公交车,在什么地方转车,在什么地方下车(其实徐总自己有车,却一定要与民同乐,这就是徐总

2020-07-27 21:17:50 115

原创 A - 最短路

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

2020-07-27 20:09:09 193

原创 F - A strange lift (bfs&Dijkstra)

Description\color{blue}{Description}DescriptionThere is a strange lift.The lift can stop can at every floor as you want, and there is a number Ki(0 <= Ki <= N) on every floor.The lift have just two buttons: up and down.When you at floor i,if you pre

2020-07-25 15:38:32 88

空空如也

空空如也

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

TA关注的人

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