自定义博客皮肤VIP专享

*博客头图:

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

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

博客底图:

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

栏目图:

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

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

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

原创 C++实现的五子棋

第一步:先创建一个Chessman.h主要作用是用于表示棋盘上的每一个棋子。其实现的cpp文件不需要(内容为空)。enum ChessmanType{ BLACK, WHITE, NONE};class Chessman{ public: ChessmanType type = ChessmanType::NONE;};第二部则需要创建一个棋盘类Chessman.h:#include "Chessman.h"class Check

2022-05-01 16:51:28 2301 1

原创 linux Centos7 配置静态IP 联网。

centos7 没有enth0 所以直接配置ens33就可以了如图先进入到该目录下:看到有ifcfg-ens33然后 viifcfg-ens33 进入到如下页面:我的是配置好的:具体怎么配置呢(要把虚拟机和本地机配置在一个网段下)具体参照个人的本地机除了ip不一样外,网关,dns,和掩码要一样(直接抄宿主机的就行了)然后 运行service network...

2020-02-28 20:57:04 280

原创 对于linux Centos7(ifconfig 没有eth0,或eth0没有ip)

1.进入/etc/sysconfig/network-scripts该目录下有ifcfg-ens33(我的时改过后的)。2.将文件ifcfg-ens33重命名为ifcfg-eth0;这步在普通用户需要权限,可以在root用户下完成。3.在root下:vi ifcfg-eth0修改下面两个地方4.4.修改grub文件      目录:/etc/default...

2020-02-26 11:08:20 755 1

原创 解决低版本的Navicat for MySQL 连接 Mysql 8.0 出现1251- Client does not support authentication protocol

https://blog.csdn.net/seventopalsy/article/details/80195246上面的博客写的很清楚最好的办法是下载一个高版本的Navicat for MySQL

2020-02-17 17:06:10 386

原创 Spring框架jar包下载教程

请点这里:https://blog.csdn.net/qq_35661171/article/details/86165467

2019-11-28 11:14:03 137

原创 关于腾讯云数据库的一些部署

1.https://www.cnblogs.com/caofanqi/p/10757765.html--->安装mysql;2.https://blog.csdn.net/Endlessnight7/article/details/97527894--->安装mysql并远程操作。3.https://cloud.tencent.com/developer/article/105...

2019-11-15 16:25:50 383

原创 c bitset用法

点击这里-------->https://www.cnblogs.com/magisk/p/8809922.html这位博主的博客讲解的非常清楚。

2019-10-15 10:43:59 389

原创 状态压缩

富豪凯匹配串https://ac.nowcoder.com/acm/contest/1114/C简单题意有n个长度为m的文本串,每个串只含有'0'和'1'。接下来有Q次询问,每次给出一个长度为m的字符串,且只含有'0','1'和'_'。如10_1_1。下划线可以匹配'0'或'1'。即10_1_1可以匹配101111,101101,100111,100101四种串。每次询问求出n个文本串中...

2019-10-15 10:39:37 97

原创 牛客练习赛53:A(简单dp)

链接:https://ac.nowcoder.com/acm/contest/1114/A来源:牛客网题目描述超越学姐非常喜欢自己的名字,以至于英文字母她只喜欢“c”和“y”。因此超越学姐喜欢只含有“c”和“y”的字符串,且字符串中不能出现两个连续的“c”。请你求出有多少种长度为n的字符串是超越学姐喜欢的字符串。答案对1e9+7取模。输入描述:链接:https://ac.no...

2019-10-15 10:06:22 125

原创 子串查询1083/B

链接:https://ac.nowcoder.com/acm/contest/1083/B来源:牛客网题目描述给出一个长度为n的字符串s和q个查询。对于每一个查询,会输入一个字符串t,你需要判断这个字符串t是不是s的子串。子串的定义就是存在任意下标a<b<c<d<e,那么”s[a]s[b]s[c]s[d]s[e]”就构成s的一个子串。如”abc”的子串有”a”...

2019-09-17 20:18:17 103

原创 求数组中第k小的元素

方法一:分治:#include<iostream>using namespace std;int a[100];int f(int left,int right){ if(left==right) { if(a[left]>0)return a[left]; else return 0; }...

2019-09-11 16:37:15 248

原创 找第k小的数

#include<bits/stdc++.h>using namespace std;int a[100];int select(int left,int right,int k){ if(left>=right)return a[left]; int i=left; int j=right; int prior=a[left]; ...

2019-09-11 15:13:21 589

原创 s中子串”abc”的个数

链接:https://ac.nowcoder.com/acm/contest/1083/A来源:牛客网题目描述给出一个字符串s,你需要做的是统计s中子串”abc”的个数。子串的定义就是存在任意下标a<b<c,那么”s[a]s[b]s[c]”就构成s的一个子串。如”abc”的子串有”a”、”b”、”c”、”ab”、”ac”、”bc”、”abc”。输入描述:一个字符...

2019-09-10 11:00:22 656

原创 四维dp

链接:https://ac.nowcoder.com/acm/contest/1072/A来源:牛客网题目描述设有N*N的方格图(N ≤ 10,我们将其中的某些方格中填入正整数,而其他的方格中则放入数字0。如下图所示(见样例):某人从图的左上角的A 点出发,可以向下行走,也可以向右走,直到到达右下角的B点。在走过的路上,他可以取走方格中的数(取走后的方格中将变为数字0)。此...

2019-09-03 10:44:26 371 1

原创 循环赛日程表

#include<bits/stdc++.h>using namespace std;int a[1000][1000];void f(int k){ a[1][1]=1; a[1][2]=2; a[2][1]=2; a[2][2]=1; int n=2; for(int w=2; w<=k; w++) {...

2019-09-03 09:48:13 171

原创 并查集 牛客1080/B

链接:https://ac.nowcoder.com/acm/contest/1080/B来源:牛客网题目描述tokitsukaze有n个数,需要按顺序把他们插入哈希表中,哈希表的位置为0到n-1。插入的规则是:刚开始哈希表是空的。对于一个数x,在哈希表中,如果(x mod n)的位置是空的,就把x放在(x mod n)的位置上。如果不是空的,就从(x mod n)往右开始找...

2019-09-02 20:43:30 112

原创 牛客1080/A

链接:https://ac.nowcoder.com/acm/contest/1080/A来源:牛客网题目描述tokitsukaze有一个长度为n,只包含小写字母的字符串S。对于每一种字母,若同种字母都连在一起,tokitsukaze会感到心情愉悦。若tokitsukaze会感到心情愉悦,请输出"YES",否则输出"NO"。(均不含引号。)输入描述:第一行输入一个正整数...

2019-09-02 19:33:16 217

原创 整数划分问题

#include<bits/stdc++.h>using namespace std;int sum(int n,int m)//把正整数n划分成最大项为m的方法数。{ if(n==1||m==1)return 1; else if(n==m)return 1+sum(n,m-1); else if(m>n)return sum(n,n); ...

2019-09-02 19:13:59 148

原创 全排列问题

#include<bits/stdc++.h>using namespace std;int b[100];int vis[3000];int n;//求1到n的全排列void dfs(int t){ if(t>n) { for(int i=1;i<=n;i++) { cout<&l...

2019-09-02 19:12:16 81

原创 D - Grid Coloring(思维)

题目链接:https://atcoder.jp/contests/arc080/tasks/arc080_bProblem StatementWe have a grid withHHrows andWWcolumns of squares. Snuke is painting these squares in colors11,22,......,NN. Here, th...

2019-06-19 18:41:34 280

原创 C - 4-adjacent(思维题)

题目链接:https://atcoder.jp/contests/arc080/tasks/arc080_a题意:给你n个数,问你能不能找到一种排列使相邻两个数的乘积为4的倍数。是输出“Yes”否则输出“No”;思路:两个数的乘积为4的倍数 1是两个数其中有一个为4的倍数;2是两个数都是偶数;代码:#include<bits/stdc++.h>using n...

2019-06-19 18:16:57 230

原创 D - Decrease (Contestant ver.)(思维好题)

Problem StatementWe have a sequence of lengthNconsisting of non-negative integers. Consider performing the following operation on this sequence until the largest element in this sequence becomesN...

2019-06-16 22:01:36 262

原创 C - Cat Snuke and a Voyage(dfs)

题目链接:https://atcoder.jp/contests/arc079/tasks/arc079_a题意:给你n个点m条边;问你是否存在一条从1到n的长度为2的边;代码:#include<iostream>#include<cstring>#include<cmath>#include<cstdio>using...

2019-06-14 19:14:20 176

原创 C - Splitting Pile(前缀和)

题意:给你长度为n的数组。A选前面连续的几个,剩余全部的给B。(每个人有1个数)求:A怎么选才能选才能使A中所有数的和与B中所有数的和差值最小,输出该差值的绝对值。代码:#include<bits/stdc++.h>#define ll long longusing namespace std;ll sum[200009];ll a[200009];int...

2019-06-12 16:02:31 172

原创 D - 11(组合数学)

Problem StatementYou are given an integer sequence of lengthn+1n+1,a1,a2,...,an+1a1,a2,...,an+1, which consists of thennintegers1,...,n1,...,n. It is known that each of thennintegers1,...,n1...

2019-06-12 15:04:28 208

原创 C - pushpush(找规律水题)

题目链接:https://atcoder.jp/contests/arc077/tasks/arc077_aProblem StatementYou are given an integer sequence of lengthnn,a1,...,ana1,...,an. Let us consider performing the followingnnoperations o...

2019-06-11 20:12:55 259

原创 D - Built?(最小生成树)

题目链接:https://atcoder.jp/contests/arc076/tasks/arc076_bProblem StatementThere areNNtowns on a plane. Theii-th town is located at the coordinates(xi,yi)(xi,yi). There may be more than one town a...

2019-06-10 22:03:49 266

原创 C - Reconciled?(组合数学)

Problem StatementSnuke hasNNdogs andMMmonkeys. He wants them to line up in a row.As a Japanese saying goes, these dogs and monkeys are on bad terms.("ken'en no naka", literally "the relations...

2019-06-10 21:14:12 170

原创 codeforces144a(水题)

A Ministry for Defense sent a general to inspect the Super Secret Military Squad under the command of the Colonel SuperDuper. Having learned the news, the colonel ordered to allnsquad soldiers to li...

2019-06-09 16:32:57 300

原创 Help Farmer(思维+暴力)

Once upon a time in the Kingdom of Far Far Away lived Sam the Farmer. Sam had a cow named Dawn and he was deeply attached to her. Sam would spend the whole summer stocking hay to feed Dawn in winter. ...

2019-06-09 15:32:00 252

原创 poj2018(二分+最大连续子段最大平均值)

DescriptionFarmer John's farm consists of a long row of N (1 <= N <= 100,000)fields. Each field contains a certain number of cows, 1 <= ncows <= 2000.FJ wants to build a fence around a...

2019-06-09 11:08:43 802

原创 poj2229(dp)

Farmer John commanded his cows to search for different sets of numbers that sum to a given number. The cows use only numbers that are an integer power of 2. Here are the possible sets of numbers that ...

2019-06-08 21:14:20 82

原创 poj3660(传递背包)

N(1 ≤N≤ 100) cows, conveniently numbered 1..N, are participating in a programming contest. As we all know, some cows code better than others. Each cow has a certain constant skill rating that is un...

2019-06-08 19:57:55 131

原创 POJ1151 (HDU 1542) Atlantis【矩形面积并,线段树+离散化+扫描线模板】

DescriptionThere are several ancient Greek texts that contain descriptions of the fabled island Atlantis. Some of these texts even include maps of parts of the island. But unfortunately, these maps ...

2019-06-07 21:21:13 184

原创 poj3277(扫面线)

Farmer John has taken his cows on a trip to the city! As the sun sets, the cows gaze at the city horizon and observe the beautiful silhouettes formed by the rectangular buildings.The entire horizon ...

2019-06-07 21:19:27 184

原创 D - Simple Knapsack(思维+讨论)

Problem StatementYou haveNNitems and a bag of strengthWW. Theii-th item has a weight ofwiwiand a value ofvivi.You will select some of the items and put them in the bag. Here, the total weig...

2019-06-05 16:31:18 349

原创 C - Sentou(思维)

https://atcoder.jp/contests/arc073/tasks/arc073_aProblem StatementIn a public bath, there is a shower which emits water forTTseconds when the switch is pushed.If the switch is pushed when the...

2019-06-05 15:14:41 278

原创 D - Alice&Brown(博弈,找规律)

Problem StatementAlice and Brown loves games. Today, they will play the following game.In this game, there are two piles initially consisting ofXXandYYstones, respectively. Alice and Bob alter...

2019-06-05 14:41:35 590 1

原创 C - Sequence(思维+贪心)

Problem StatementYou are given an integer sequence of lengthNN. Theii-th term in the sequence isaiai. In one operation, you can select a term and either increment or decrement it by one.At leas...

2019-06-05 09:14:16 476

原创 E - Frequency(思维好题)

Problem StatementSnuke loves constructing integer sequences.There areNNpiles of stones, numbered11throughNN. The pile numberediiconsists ofaiaistones.Snuke will construct an integer seq...

2019-06-02 22:20:58 307

空空如也

空空如也

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

TA关注的人

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