自定义博客皮肤VIP专享

*博客头图:

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

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

博客底图:

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

栏目图:

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

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

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

原创 Linux 邮件设置

传送门:linux脚本空间预警,并发送邮件,内含配置邮箱服务器,及报错“Could not resolve host: //smtp.qq.com”、“smtp-server: 502”_Bessssss的博客-CSDN博客

2022-05-04 18:24:32 618

原创 KAA 启动 (Cenot 7)

kaa启动顺序:zookeeper -> MongoDB -> KAAzookeeper./zkServer.sh start./zkServer.sh stop./zkServer.sh status(1)路径问题本人存储路径在 /user/local/zookeeper-3.4.6/bin 仅供参考(2)权限不足解决办法:chmod a+xwr zkServer.sh 给对应文件赋权 zkServer.sh即为想赋权文件...

2022-04-06 19:17:08 2409

原创 c++上机实验

1.声明一个时间类,时间类中有3个私有数据成员(Hour,Minute,Second)和两个公有成员函数(SetTime和PrintTime)。SetTime根据传递的3个参数为对象设置时间;PrintTime负责将对象表示的时间显示输出,输出格式为“Hour:Minute:Second”。  (1)在主函数中,建立一个时间类的对象,设置时间为9点20分30秒并显示该时间。  (2)使用构造函数代替上面的SetTime成员函数,并在主函数中使用构造函数设置时间为10点40分50秒,并显示该时间。

2020-05-28 16:46:53 1453

原创 c++文件操作

#include <iostream>#include <fstream>using namespace std;int main(){ //输入 int a[10]; ofstream outfile1("f1.dat"), outfile2("f2.dat"); cout<<"输入5个数"<<endl; for(int i=0; i<5; i++) { cin&gt...

2020-05-28 16:39:55 246

原创 面向对象程序设计——派生类构造函数

定义基类shape,它有默认的构造函数和析构函数;把点point类声明为shape的派生类,它包含两个数据成员x和y和输出函数display();把圆circle定义为点point类的派生类,它在点point的基础上增加一个数据成员radius;并增加输出成员函数display ()和求面积成员函数area()。#include<iostream>#includ...

2020-04-07 10:45:10 367

原创 面向对象程序设计——函数重载运算符

定义complex类,它包含两个双精度型的数据成员real 和 imag以及两个构造函数:一个是无参函数,一个是有参数的函数。要求:使用类的成员函数 或者友元函数重载运算符+、-、×、÷,使其能够实现complex类对象的相应运算。注(a+bi)÷(c+di)=((ac+bd)÷(c2+d2))+((bc-ad)÷(c2+d2))i#include<iostrea...

2020-04-07 10:42:43 492

原创 js常用项目——小米导航条项目

<!DOCTYPE html><html lang="en"><head> <meta charset="UTF-8"> <meta name="viewport" content="width=, initial-scale=1.0"> <link rel="stylesheet" href="css...

2020-02-14 19:48:31 468

原创 js常用项目——点击弹出点击收回下拉菜单

<!DOCTYPE html><html lang="en"><head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <title>Document&l...

2020-02-12 10:28:24 1746

原创 js常用项目——轮播图

<!DOCTYPE html><html lang="en"><head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <title>Document&l...

2020-02-12 10:14:50 208

原创 根据表达式求出真值表及主析取主合取——离散数学实训

#include<stdio.h>#include<stdlib.h>#include<string.h>#include<math.h>#define N 1005#define ll long longchar str[N];char sta[N];char a[N];void houzhui()//数组模拟栈求后缀表达式...

2020-02-12 10:11:36 1080

原创 哈夫曼树——离散数学实训

#include<stdio.h>#include<stdlib.h>#include<string.h>const int maxn = 1e5 + 5;struct node{ int w, pre, l, r;};struct tree{ int m, root; struct node *ht;};void...

2020-02-12 10:10:11 647

原创 火车车次查询系统——时间最短,价格最优(非空双向循环链表)C语言Linux实训作业

huoche.c#include <stdio.h>#include <stdlib.h>#include <string.h>#include "huoche.h"#define MAX 10001000LLIST *p_checi=NULL;char from[40];char arrive[40];int between;int...

2020-02-12 10:07:10 498

原创 基础的电子词典——单词的增删查找(平衡二叉排序树) c语言Linux实训作业

a.c#include <stdlib.h>#include <stdio.h>#include <string.h>#include "a.h"#include "tree.h"FILE *pf;FILE *tf;struct node_wo *tree = NULL;char *a_to_A(char str[]){ int ...

2020-02-12 10:02:33 237

原创 基础的学生管理系统——增,删,查,找(非空双向循环链表)C语言Linux实训作业

list.c#include<stdio.h>#include<stdlib.h>#include<string.h>#include "llist.h"LLIST *llist_creat(int size){ LLIST *new; new = malloc(sizeof(LLIST)); if(new == NULL) { r...

2020-02-12 09:58:25 244

原创 H - Perfect Ban (模拟)

题目链接:https://vjudge.net/problem/Gym-101341HConstantine and Mike are playing the board game «Wrath of Elves». There arenraces andmclasses of characters in this game. Each character is described b...

2019-09-20 21:12:08 282

原创 A - Abbreviation (模拟)

题目链接:https://cn.vjudge.net/problem/Gym-101190A题目大意:将串中符合首字符大写其余字母小写的单词和其他符合这种情况的只间隔一个空格的单词的首字母提出来,其余字符用括号括起来思路概括:遍历整个串,将符合要求的单词预处理出来,然后在遍历去提取加括号#include<cstdio>#include<iostream&g...

2019-08-23 10:10:32 197

原创 H - Hard Refactoring(巨坑模拟)

题目链接:https://cn.vjudge.net/problem/Gym-101190H题意:简单的区间合并,输出合并后的区间,如果合并后区间为空集输出false,若为(-inf, +inf)则输出true,否则输出合并后的区间范围。#include<cstdio>#include<iostream>#include<cstring>#...

2019-08-23 10:06:18 263

原创 P1553 数字反转(升级版)(字符串 模拟)

题目链接:https://www.luogu.org/problem/P1553思路概括:找到符号的位置标记,先反转前面的部分,再反转后面的部分真的是改bug改到吐血给大家列几个把我卡掉的样例(血与眼泪的经历)0.0000 -> 0.01234567890/1234567890 -> 987654321/987654321...

2019-08-22 09:25:41 177

原创 H - Course recommendation (模拟)

题目链接:https://cn.vjudge.net/problem/Gym-102299H题目大意:n名学生, m门课程,然后给出每个学生学的课程和成绩,然后问跟他最亲密的学生会教他哪一门判断最亲密的条件是 两名学生的共同学习的课程成绩差的平方和开根号如果和你最亲密的学生要教你的课程你已经学过了 输出-1#include<cstdio>#include<...

2019-08-21 20:16:59 278

原创 F - Nearest Common Ancestors(lca + 树上倍增)

题目链接:https://cn.vjudge.net/problem/POJ-1330A 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 ...

2019-08-21 08:38:08 162

原创 D - Bridge Automation (dp)

题目链接:https://vjudge.net/problem/Gym-101490D题目大意:由一个桥,有n艘船需要从桥下面过去,对于桥来说,桥升起来需要60秒,降下去需要60秒,对于每艘船来说,必须等到桥完全升起才能通过,通过时间是20秒,如果桥此刻没有升起来,船最多只能等3分钟,就必须走了。桥上面是通汽车的,桥没有完全落下时,汽车是不能走的,现在告诉你每搜船到达的时间,现在问你汽...

2019-08-20 17:13:31 284

原创 B. Odd Sum Segments(基础数论)

题目地址:http://codeforces.com/contest/1196/problem/BYou are given an arrayaaconsisting ofnnintegersa1,a2,…,an You want to split it into exactlykknon-empty non-intersecting subsegmentssuch that ...

2019-08-17 08:59:54 642 3

原创 E - How far away ?(lca)

There are n houses in the village and some bidirectional roads connecting them. Every day peole always like to ask like this "How far is it if I want to go from house A to house B"? Usually it hard to...

2019-08-16 16:03:52 166

原创 P3379 最近公共祖先(LCA 模板)

题目描述如题,给定一棵有根多叉树,请求出指定两个点直接最近的公共祖先。输入格式第一行包含三个正整数N、M、S,分别表示树的结点个数、询问的个数和树根结点的序号。接下来N-1行每行包含两个正整数x、y,表示x结点和y结点之间有一条直接连接的边(数据保证可以构成树)。接下来M行每行包含两个正整数a、b,表示询问a结点和b结点的最近公共祖先。输出格式输出包含M行,每行包含一个...

2019-08-16 14:28:30 123

原创 A - LCM from 1 to n (欧拉筛 + 快速幂 + LCM )

Given an integern, you have to findlcm(1, 2, 3, ..., n)lcmmeans least common multiple. For example lcm(2, 5, 4) = 20, lcm(3, 9) = 9, lcm(6, 8, 12) = 24.InputInput starts with an integerT (≤...

2019-08-16 09:42:19 356 1

原创 GCD - Extreme (II) (数论,欧拉函数)

题目的来源:https://vjudge.net/problem/UVA-11426 题目大意:求在1-n之间所有任意两个数的的最大公因数的和。思路概括:假设a、b(a<b)互质,那么gcd(a,b)=1,这样当i循环到a、j循环到b时就会向结果中+1,而i循环到2*a、j循环到2*b时就会向结果中+2(gcd(2*a,2*b)=2)...循环到k*a和k*b时就会向结果...

2019-08-14 11:02:17 292

原创 E - Harmonic Number 【调和级数 && 欧拉常数】

In mathematics, thenthharmonic number is the sum of the reciprocals of the firstnnatural numbers:In this problem, you are givenn, you have to findHn.InputInput starts with an integerT...

2019-08-13 20:32:57 311

原创 E - Text Editor (二分 + KMP)

One of the most useful tools nowadays are text editors, their use is so important that the Unique Natural Advanced Language (UNAL) organization has studied many of the benefits working with them.The...

2019-08-13 20:06:16 328

原创 F - Game on Plane (sg函数)

You are givenNNpoints on a plane. These points are precisely the set of vertices of some regularNN-gon. Koosaga, an extreme villain, is challenging you with a game using these points. You and Koosa...

2019-08-12 20:31:55 277

原创 D - Round Numbers(数位dp)

The cows, as you know, have no fingers or thumbs and thus are unable to play Scissors, Paper, Stone' (also known as 'Rock, Paper, Scissors', 'Ro, Sham, Bo', and a host of other names) in order to make...

2019-08-12 20:18:19 126

原创 不要62 (数位dp)

杭州人称那些傻乎乎粘嗒嗒的人为62(音:laoer)。杭州交通管理局经常会扩充一些的士车牌照,新近出来一个好消息,以后上牌照,不再含有不吉利的数字了,这样一来,就可以消除个别的士司机和乘客的心理障碍,更安全地服务大众。不吉利的数字为所有含有4或62的号码。例如:62315 73418 88914都属于不吉利号码。但是,61152虽然含有6和2,但不是62连号,所以不属于不吉利数字之...

2019-08-12 10:54:50 143

原创 B - Tree with Maximum Cost(树形DP)

You are given a tree consisting exactly ofnnvertices. Tree is a connected undirected graph withn−1n−1edges. Each vertexvvof this tree has a valueavavassigned to it.Letdist(x,y)dist(x,y)be t...

2019-08-12 10:32:07 207

原创 H - 着色方案(状压DP)

  有n个木块排成一行,从左到右依次编号为1~n。你有k种颜色的油漆,其中第i种颜色的油漆足够涂ci个木块。所有油漆刚好足够涂满所有木块,即c1+c2+...+ck=n。相邻两个木块涂相同色显得很难看,所以你希望统计任意两个相邻木块颜色不同的着色方案。Input  第一行为一个正整数k,第二行包含k个整数c1, c2, ... , ck。Output  输出一个整数,即方案总数...

2019-08-12 09:59:09 191

原创 A - A Secret(扩展KMP)

Today is the birthday of SF,so VS gives two strings S1,S2 to SF as a present,which have a big secret.SF is interested in this secret and ask VS how to get it.There are the things that VS tell:Suff...

2019-08-10 16:06:38 245

原创 Z - Simpsons’ Hidden Talents(扩展KMP 模板题)

Homer: Marge, I just figured out a way to discover some of the talents we weren’t aware we had.Marge: Yeah, what is it?Homer: Take me for example. I want to find out if I have a talent in politics...

2019-08-10 14:42:56 129

原创 O - Snacks(DFS序2)

百度科技园内有nn个零食机,零食机之间通过n−1n−1条路相互连通。每个零食机都有一个值vv,表示为小度熊提供零食的价值。由于零食被频繁的消耗和补充,零食机的价值vv会时常发生变化。小度熊只能从编号为0的零食机出发,并且每个零食机至多经过一次。另外,小度熊会对某个零食机的零食有所偏爱,要求路线上必须有那个零食机。为小度熊规划一个路线,使得路线上的价值总和最大。Input输入数据第...

2019-08-10 09:08:05 201

原创 N - Apple Tree(DFS序1)

There is an apple tree outside of kaka's house. Every autumn, a lot of apples will grow in the tree. Kaka likes apple very much, so he has been carefully nurturing the big apple tree.The tree hasN...

2019-08-09 20:06:39 227

原创 C - Zhenya moves from parents (线段树 + lazy标记)

Zhenya moved from his parents’ home to study in other city. He didn’t take any cash with him, he only took his father’s credit card with zero balance on it. Zhenya succeeds in studies at the Universit...

2019-08-09 16:07:21 153

原创 树状数组详解

1.什么是树状数组?顾名思义,就是用数组来模拟树形结构呗。那么衍生出一个问题,为什么不直接建树?答案是没必要,因为树状数组能处理的问题就没必要建树。和Trie树的构造方式有类似之处。2.树状数组可以解决什么问题可以解决大部分基于区间上的更新以及求和问题。3.树状数组和线段树的区别在哪里树状数组可以解决的问题都可以用线段树解决,这两者的区别在哪里呢?树状数组的系数要少...

2019-08-09 08:51:16 156

原创 C - A Simple Problem with Integers(树状数组区间修改、区间查询模板)

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-08-09 08:27:58 125

空空如也

空空如也

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

TA关注的人

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