自定义博客皮肤VIP专享

*博客头图:

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

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

博客底图:

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

栏目图:

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

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

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

原创 禾望逆变器两三事

再说一下这个wifi棒,这个东西设计的外形是个手柄一样的,接口处还是圆形,一眼看上去就给人一种直接转圈就能拧下来的感觉,实际上他的接口处是4个针脚插进去,安装方式是单独转动接口处的圆环。但是这个逆变器的本地后台只有通过禾望那边的特殊串口线才能在本地接入,也就是说如果wifi棒坏了你自己就没有办法控制及检测逆变器的数据了,这点就很恶心。这个wifi棒里面内置4G流量卡也就是说不管你机器所在地有没有网络都可以直接用的,且设备本身防水防尘做的很不错。最近接触到了禾望70KW的光伏逆变器2台,总结一下遇到的事情。

2023-12-26 10:33:24 403

原创 RS232通讯转485通讯接线心得

232转485

2023-11-08 17:01:49 1965

原创 卡特兰数(catalan数(卡特兰大数、卡特兰大数取模、卡特兰数应用)

什么是卡特兰数呢?卡特兰数无非是一组有着某种规律的序列。重要的是它的应用。卡特兰数前几项为 : 1, 1, 2, 5, 14, 42, 132, 429, 1430, 4862, 16796, 58786, 208012, 742900, 2674440, 9694845, 35357670, 129644790, 477638700, 1767263190, 6564120420, 244662...

2020-03-20 10:11:13 522 1

原创 最短路板子

Dijkstra算法#include<stdio.h>#include<string.h>#include<algorithm>#include<queue>#include<vector>using namespace std;typedef pair<int,int> P;//定义P为pair型cons...

2020-03-16 12:11:03 167

原创 快速排序

平时我们在排序的时候是直接用STL的,sort()一遍就行了,但是我们要掌握快速排序的精髓。以下看到一个大神的讲解。快速排序的基本思想是1、先从数列中取出一个数作为基准数2、分区过程,将比这个数大的数全放到它的右边,小于或等于它的数全放到它的左边3、再对左右区间重复第二步,直到各区间只有一个数概括来说为挖坑填数+分治法下面举例来进行说明,主要有三个参数,i为区间的...

2020-03-03 16:12:23 239

原创 Hyperset(思维) codeforce1287 B

题目链接:http://codeforces.com/contest/1287/problem/B题意:给你n张牌,每张牌有k种特征,每一种特征只会有三种情况:S,T,E,现在把这些牌按一定规则组成一组,有多少种组发规则:1.一组有且仅有3张牌2,一组中的牌两两之间他们的每一种特征都不同或者他们有一种或者多种特征相同这一题做法实在是太巧妙了,代码旁边有详细注释#include...

2020-01-06 19:04:03 398

原创 River Hopscotch POJ - 3258(二分)

题意:从起点石头到终点石头之间有N块石头,给出每个石头到起点的距离(每个石头的位置不相同),现在你可以移除m个石头,使石头之间的最小距离最大对于这种情况我们可以二分找答案,然后判断答案是否符合条件,具体判断方法代码旁边有注释#include<stdio.h>#include<string.h>#include<algorithm>using na...

2020-01-04 17:58:24 129

原创 Bound Found POJ - 2566 (尺取法+前缀和)

题意:求所给的一串数的一个区间使得这个区间内的所有的数相加后的绝对值和所给的数之间的差距尽量小刚开始看的时候啥思路都没有,最后想到了前缀和,由于这题要输出区间,所以开一个结构体把区间和与其相应位置储存起来,之后按照区间和从小到大排序#include<cstdio> #include<cstring> #include<cstdlib> #i...

2020-01-03 19:19:52 106

原创 最小流板子

#include<stdio.h>#include<string.h>#include<algorithm>#include<vector>#include<queue>using namespace std;const int maxn=255;const int inf=0x3f3f3f3f;int N,M,K,b[...

2019-12-20 11:51:37 80

原创 最大流板子

isap算法时间复杂度:O(n^2m)#include <iostream>#include <stdio.h>#include <string.h>#include <stdlib.h>#include <math.h>#include <ctype.h>#include <queue>#...

2019-12-16 20:06:08 118

原创 Treasure Exploration POJ - 2594(二分图匹配+传递闭包Floyd+最小路径覆盖)

Have you ever read any book about treasure exploration? Have you ever see any film about treasure exploration? Have you ever explored treasure? If you never have such experiences, you would never know...

2019-11-16 16:44:02 107

原创 Strategic Game HDU - 1054(二分图匹配+最小点覆盖)

Bob enjoys playing computer games, especially strategic games, but sometimes he cannot find the solution fast enough and then he is very sad. Now he has the following problem. He must defend a medieva...

2019-11-16 16:24:03 166

原创 Rain on your Parade HDU - 2389(二分图匹配 HK算法)

You’re giving a party in the garden of your villa by the sea. The party is a huge success, and everyone is here. It’s a warm, sunny evening, and a soothing wind sends fresh, salty air from the sea. Th...

2019-11-16 16:13:42 220 1

原创 棋盘游戏 HDU - 1281(二分图匹配)

小希和Gardon在玩一个游戏:对一个N*M的棋盘,在格子里放尽量多的一些国际象棋里面的“车”,并且使得他们不能互相攻击,这当然很简单,但是Gardon限制了只有某些格子才可以放,小希还是很轻松的解决了这个问题(见下图)注意不能放车的地方不影响车的互相攻击。所以现在Gardon想让小希来解决一个更难的问题,在保证尽量多的“车”的前提下,棋盘里有些格子是可以避开的,也就是说,不在这些格子上放车,...

2019-11-16 15:57:49 101

原创 Courses HDU - 1083(二分图匹配)

Consider a group of N students and P courses. Each student visits zero, one or more than one courses. Your task is to determine whether it is possible to form a committee of exactly P students that sa...

2019-11-16 15:47:32 165 1

原创 过山车 HDU - 2063 (二分图匹配)

RPG girls今天和大家一起去游乐场玩,终于可以坐上梦寐以求的过山车了。可是,过山车的每一排只有两个座位,而且还有条不成文的规矩,就是每个女生必须找个个男生做partner和她同坐。但是,每个女孩都有各自的想法,举个例子把,Rabbit只愿意和XHD或PQK做partner,Grass只愿意和linle或LL做partner,PrincessSnow愿意和水域浪子或伪酷儿做partner。考虑...

2019-11-16 15:30:34 70

原创 The Parade CodeForces - 1250J(二分)

The Berland Army is preparing for a large military parade. It is already decided that the soldiers participating in it will be divided intokkrows, and all rows will containthe samenumber of soldie...

2019-11-16 15:18:01 128

原创 欧拉函数

欧拉函数的作用就是找到小于n的范围内,有多少个数与n互为质数(如果不存在n=x*y,m=x*z,x>1.y,z>0,那么就说n与m互质)欧拉函数的通式:φ(n)=n*(1-1/p1)*(1-1/p2)*(1-1/p3)*(1-1/p4)…..(1-1/pn),其中p1, p2……pn为n的所有质因数,n是不为0的整数。φ(1)=0。int er(int n) { ...

2019-10-14 21:22:56 167

原创 Codeforces Round #581 (Div. 2) A. BowWow and the Timetable

A. BowWow and the Timetabletime limit per test1 secondmemory limit per test256 megabytesinputstandard inputoutputstandard outputIn the city of Saint Petersburg, a day lasts for21002...

2019-08-22 17:12:28 90

转载 差分标记算法

差分有:一维差分、多维差分、树上差分 差分标记一般求离线区间问题!(修改完后不再修改,然后修改结束后查询)对于带有“将一段区间内的每个数全部加上某个值”这种操作的题目,通常考虑差分原数列以简化情况,将对一段区间的操作转化为对某两个特定数的操作。我们可以用树状数组来维护一个差分序列。差分序列的本质是通过前缀和使区间修改转换为单点修改。所以在查询的时候只要输出前缀和就可以了。首先,给...

2019-07-20 09:42:07 241

转载 最小(大)表示法模板及详解

算法解释我们这里要i = 0,j = 1,k = 0,表示从i开始k长度和从j开始k长度的字符串相同(i,j表示当前判断的位置)当我们str[i] == str[j]时,根据上面k的定义,我们的需要进行k+1操作当str[i] > str[j]时,我们发现i位置比j位置上字典序要大,那么不能使用i作为开头了,我们要将i向后移动,移动多少呢?有因为i开头和j开头的有k个相同的字符,那...

2019-07-19 10:55:22 132

原创 Cyclic Nacklace (字符串循环)

CC always becomes very depressed at the end of this month, he has checked his credit card yesterday, without any surprise, there are only 99.9 yuan left. he is too distressed and thinking about how to...

2019-07-19 10:50:23 218

原创 M - Corporate Identity (多个字符串查找相同的子串)

Beside other services, ACM helps companies to clearly state their “corporate identity”, which includes company logo but also other signs, like trademarks. One of such companies is Internet Building Ma...

2019-07-19 10:41:31 211

原创 KMP

由本人喜欢用题来进行讲解所以就在这里用题进行相关的讲解这里放一两个大神的讲解1:https://blog.csdn.net/v_july_v/article/details/7041827 2:https://blog.csdn.net/Dch19990825/article/details/82764195相...

2019-07-19 10:30:08 75

原创 KiKi's K-Number HDU - 2852 (树状数组+二分)

For the k-th number, we all should be very familiar with it. Of course,to kiki it is also simple. Now Kiki meets a very similar problem, kiki wants to design a container, the container is to support t...

2019-06-06 20:25:37 129

原创 Disharmony Trees  HDU - 3015(树状数组+离散)

One day Sophia finds a very big square. There are n trees in the square. They are all so tall. Sophia is very interesting in them.She finds that trees maybe disharmony and the Disharmony Value b...

2019-06-05 20:26:45 141

原创 树状数组理解

C[i]代表 子树的叶子结点的权值之和如图可以知道C[1]=A[1];C[2]=A[1]+A[2];C[3]=A[3];C[4]=A[1]+A[2]+A[3]+A[4];C[5]=A[5];C[6]=A[5]+A[6];C[7]=A[7];C[8]=A[1]+A[2]+A[3]+A[4]+A[5]+A[6]+A[7]+A[8];再将其转化为二进制看一下:...

2019-05-28 21:19:38 97

原创 树状数组讲解

转载一位大牛的树状数组讲解,讲的非常通俗、仔细:https://blog.csdn.net/bestsort/article/details/80796531

2019-05-28 20:44:44 103

原创 麦森数(大数)

麦森数题目描述形如2P-1的素数称为麦森数,这时P一定也是个素数。但反过来不一定,即如果P是个素数,2P-1不一定也是素数。到1998年底,人们已找到了37个麦森数。最大的一个是P=3021377,它有909526位。麦森数有许多重要应用,它与完全数密切相关。任务:从文件中输入P(1000<P<3100000),计算2P-1的位数和最后500位数字(用十进制高精度数表示)...

2019-05-02 21:04:53 858

原创 编码问题

设有一个数组A:ARRAY[0..N-1] OF INTEGER;数组中存放的元素为0~N-1之间的整数,且A[i]≠A[j](当i≠j时)。例如: N=6时,有:A=(4,3,0,5,1,2) 此时,数组A的编码定义如下: A[0]的编码为0; A[i]的编码为:在A[0],A[1],……A[i-1]中比A[i]的值...

2019-05-01 21:24:04 687 3

转载 什么是离散化?

转载:http://www.matrix67.com/blog/archives/108Matrix67原创 如果说今年这时候OIBH问得最多的问题是二分图,那么去年这时候问得最多的算是离散化了。对于“什么是离散化”,搜索帖子你会发现有各种说法,比如“排序后处理”、“对坐标的近似处理”等等。哪个是对的呢?哪个都对。关键在于,这需要一些例子和不少的讲解才能完全解释清楚。 ...

2019-04-29 21:16:39 768

原创 A Simple Problem with Integers POJ - 3468(线段树+区间修改)

You haveNintegers,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 ...

2019-04-29 17:42:39 72

转载 sscanf与%n

sscanf非常的重要刚进研究生阶段,发现曾经学习的c语言真的好少好少,很少能够看见scanf printf等。。。。。以后实验的80%以上都是在linux下面 老师让我看看关于一个日志会聚的一个项目模块 发现基本上都是格式化的输入输出网上就找了一篇来看了看 也就记录在这了。%n说明: %n 可以将所输出字符串的长度值赋绐一个变量, 见下例:int slen;printf(...

2019-04-29 16:40:23 1180

原创 I - I HRBUST - 2322(模拟)

Kim正在玩一款手游,在这款游戏中,Kim可以选择若干个角色编成一队作战。为了挑战不同的关卡,Kim需要不断的调整编队阵容。然而随着游戏不断更新,队伍成员变得越来越多,Kim已经记不清哪些角色在队伍中,哪些角色不在队伍中了。请你写一个程序来帮助他。具体来说,Kim有三种可以执行的操作。1x:把x号角色加入队伍。如果x号角色已经在队伍中,什么都不会发生。2x:把x号...

2019-04-26 15:35:16 261

原创 Carries SCU - 4437(公式)

frog hasnnintegersa1,a2,…,ana1,a2,…,an, and she wants to add them pairwise.Unfortunately, frog is somehow afraid of carries (进位). She defineshardnessh(x,y)h(x,y)for addingxxandyythe number ...

2019-04-24 20:56:59 210

原创 H - H HDU - 5547(模拟)

Yi Sima was one of the best counselors of Cao Cao. He likes to play a funny game himself. It looks like the modern Sudoku, but smaller.Actually, Yi Sima was playing it different. First of all, he tr...

2019-04-16 19:27:15 161

原创 D - WE POJ - 3273(二分)

Farmer John is an astounding accounting wizard and has realized he might run out of money to run the farm. He has already calculated and recorded the exact amount of money (1 ≤moneyi≤ 10,000) that h...

2019-04-10 21:12:09 84

原创 A. The Useless Toy(模拟)

题目链接题意:v<^>代表上下左右四个方向,输入的数字表示转动的时间,每秒转动一次,求所给出的是顺时针旋转还是逆时针,如果无法判断,输出undefined。思路:直接暴力,分别列举上下左右为起始点的情况,把顺时针逆时针的四个符号按转动次序分别存入两个字符数组中,按输入的数字%4与其下标进行对比,判断是哪种旋转方式,如果数字既符合顺时针,又符合逆时针,则是第三种情况....

2019-04-05 09:20:38 123

原创 D - SPY NBUT - 1220(模拟)

The National Intelligence Council of X Nation receives a piece of credible information that Nation Y will send spies to steal Nation X’sconfidential paper. So the commander ofThe National Intelligen...

2019-03-29 21:18:32 294

原创 M - Lisp em SCU - 4490(模拟)

Time Limit: 1000 MS Memory Limit: 131072 K DescriptionThere are two lists and they may be intersected with each other. You must judge if they are intersected and find the first node the...

2019-03-29 20:22:52 130

空空如也

空空如也

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

TA关注的人

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