自定义博客皮肤VIP专享

*博客头图:

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

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

博客底图:

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

栏目图:

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

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+

咲のblog

email: liwenlvgudu@gmail.com

  • 博客(44)
  • 收藏
  • 关注

原创 第十届蓝桥杯B组C++国赛总结来啦

1.题量变大啦,10道题。2.我做了六道半,二等奖中下水平。3.推测一等奖至少得八道以上的题。4.面包会有的,牛奶也会有的。5.建议多刷题,早准备。6.希望大赛越办越好。7.不说啦,有点心累呀。...

2019-05-28 21:03:52 1392

原创 深搜-组合数

//组合数,深搜入门#include <iostream>#include <cstdio>#include <cstring>using namespace std;/* run this program using the console pauser or add your own getch, system("pause") or input...

2019-05-20 20:22:16 295

原创 深搜-全排列

//求1~5的全排列#include <iostream>#include <cstdio>using namespace std;/* run this program using the console pauser or add your own getch, system("pause") or input loop */int a[5],book[5...

2019-05-20 20:20:33 263

原创 蓝桥杯猜算式

#include <iostream>#include <map>#include <set>using namespace std;/* run this program using the console pauser or add your own getch, system("pause") or input loop */int book[...

2019-05-19 20:14:59 279

原创 蓝桥杯自守数

#include <iostream>#include <cstdio>using namespace std;/* run this program using the console pauser or add your own getch, system("pause") or input loop *///。。。。void zishou(){...

2019-05-19 17:39:43 179

原创 蓝桥杯组合数

组合数性质:若表示在 n 个物品中选取 m 个物品,则如存在下述公式:C(n,m)=C(n,n-m)=C(n-1,m-1)+C(n-1,m)。#include <iostream>using namespace std;/* run this program using the console pauser or add your own getch, system("pa...

2019-05-19 17:16:56 1080

转载 蓝桥杯dna比对-两字符串的最小编辑距离

#include <iostream>#include <cstdio>#include <algorithm>using namespace std;/* run this program using the console pauser or add your own getch, system("pause") or input loop *//...

2019-05-19 17:02:52 551

原创 蓝桥杯拼音字母

#include <iostream>#include <string>using namespace std;/* run this program using the console pauser or add your own getch, system("pause") or input loop *///把题目的意思搞清楚之后,发现这道题还是不难地...

2019-05-18 23:12:31 198

原创 蓝桥杯数据压缩

/*【代码填空】(满分16分) 某工业监控设备不断发回采样数据。每个数据是一个整数(0到1000之间)。各个数据间用空白字符(空格,TAB或回车换行)分隔。这些数据以文本形式被存储在文件中。 因为大多数时候,相邻的采样间隔数据是相同的,可以利用这个特征做数据的压缩存储。其方法是:对n(n>1)个连续相同的数字只记录n和该数字本身; 对m(m>0)个连续不...

2019-05-18 16:27:45 296

原创 蓝桥杯星期几

#include <iostream>using namespace std;/* run this program using the console pauser or add your own getch, system("pause") or input loop */int main(int argc, char *argv[]) { int sum=...

2019-05-18 15:15:50 309

原创 随笔—怎样的我

我以为我是一个如诗如画般优雅的人,谁知还是落入了这庸俗的世间追名逐利,被裹挟地不得不向前奔跑我以为我是一个意志如钢铁般坚硬的人谁知还是流连于纸醉金迷贪慕美色,爱慕虚荣快乐是本质还是现象...

2019-05-18 13:16:12 119

翻译 蓝桥杯格子刷油漆

/*标题:格子刷油漆 X国的一段古城墙的顶端可以看成 2*N个格子组成的矩形(如图1所示),现需要把这些格子刷上保护漆。 你可以从任意一个格子刷起,刷完一格,可以移动到和它相邻的格子(对角相邻也算数),但不能移动到较远的格子(因为油漆未干不能踩!) 比如:a d b c e f 就是合格的刷漆顺序。 c e f d a b 是另一种合适的方案。 当已知 N...

2019-05-17 23:40:15 249

原创 蓝桥杯高僧斗法

快速了解算法中的博弈#include <iostream>#include <cstdio>#include <cstring>using namespace std;/* run this program using the console pauser or add your own getch, system("pause") or input...

2019-05-16 21:41:15 324

转载 算法竞赛中常见的博弈算法

本文的讲解是让你快速了解竞赛中几种常见的博弈以及处理方式,建议看完本文后再看文中的两篇参考博客。想要真正较为全面的了解博弈论:请看书,看这里(历史及分类),或者看这里。或者移步网易公开课(以上内容都只能大概了解)没兴趣具体了解,请看下面,(差不多足够应付竞赛中需要的相关知识了)参考博客1(易懂)参考博客2(比较全面的解释)理解前提:1.博弈论有一个默认的前提就是每个人做的都...

2019-05-15 23:35:16 1883

原创 蓝桥杯空白格式化

#include <iostream>using namespace std;/* run this program using the console pauser or add your own getch, system("pause") or input loop */void f(char* from, char* to){ char* p_from = f...

2019-05-15 16:35:50 263

原创 蓝桥杯连续奇数和

#include <iostream>#include <cmath>using namespace std;/* run this program using the console pauser or add your own getch, system("pause") or input loop */int main(int argc, char *arg...

2019-05-15 13:38:16 202

原创 蓝桥杯猜灯谜

#include <iostream>using namespace std;/* run this program using the console pauser or add your own getch, system("pause") or input loop */int main(int argc, char *argv[]) { for(int ...

2019-05-15 13:22:57 199

转载 负数取模

先来段维基百科的解释(英语好的可以去看),反正我没有看。百度百科的取模对于这种网上有很多解答的问题,我也懒得再写了,找到了几个觉得还不错的博客,可以去看一下。1.看了立马懂2.几道例子。...

2019-05-14 20:55:59 369

原创 c/cpp中的对数运算的简单归纳

对数的百科#include<iostream>#include<cstdio>#include<algorithm>#include<cmath>using namespace std;#define log2(n) log(n)/log(2) //可以把以其他数为底的写成宏或函数。int main(){//lo...

2019-05-14 17:52:28 2449

原创 蓝桥杯信号匹配

/*标题:信号匹配 从X星球接收了一个数字信号序列。 现有一个已知的样板序列。需要在信号序列中查找它首次出现的位置。这类似于串的匹配操作。 如果信号序列较长,样板序列中重复数字较多,就应当注意比较的策略了。可以仿照串的KMP算法,进行无回溯的匹配。这种匹配方法的关键是构造next数组。 next[i] 表示第i项比较失配时,样板序列向右滑动,需要重新比较的项的序...

2019-05-14 17:14:51 168

原创 蓝桥杯生物芯片

#include <iostream>#include <cstdio>#include <cmath>using namespace std;/* run this program using the console pauser or add your own getch, system("pause") or input loop *//*思...

2019-05-14 16:48:37 264

原创 蓝桥杯出栈次序

#include <iostream>using namespace std;/* run this program using the console pauser or add your own getch, system("pause") or input loop *///注意递归函数有返回值时,每一个分支都要有return,不然会陷入卡死的地步int digui(i...

2019-05-13 21:17:23 309

原创 蓝桥杯第五届决赛年龄巧合

#include <iostream>using namespace std;/* run this program using the console pauser or add your own getch, system("pause") or input loop */int main(int argc, char *argv[]) { for(int i=196...

2019-05-13 16:01:21 188

原创 蓝桥杯密文匹配

#include <iostream>#include <string>#include <map>#include <algorithm>using namespace std;/* run this program using the console pauser or add your own getch, system("paus...

2019-05-11 23:06:20 163

原创 蓝桥杯第六届关联账户

/*标题:关联账户为增大反腐力度,某地警方专门支队,对若干银行账户展开调查。如果两个账户间发生过转账,则认为有关联。如果a,b间有关联, b,c间有关联,则认为a,c间也有关联。对于调查范围内的n个账户(编号0到n-1),警方已知道m条因转账引起的直接关联。现在希望知道任意给定的两个账户,求出它们间是否有关联。有关联的输出1,没有关联输出0小明给出了如下的解决方案:*/...

2019-05-11 21:10:53 161

翻译 蓝桥杯第六届完美正方形

参考博客#include <iostream>#include <cstring>#include <cstdio>using namespace std;/* run this program using the console pauser or add your own getch, system("pause") or input loop...

2019-05-11 19:02:20 208

原创 蓝桥杯第六届决赛积分之谜

#include <iostream>using namespace std;/* run this program using the console pauser or add your own getch, system("pause") or input loop */int main(int argc, char *argv[]) { fo...

2019-05-11 10:21:12 142

原创 c/cpp输入输出简单归纳。

竞赛或本地调试中的重定向输入输出:freopen("D:\\abc.txt","r",stdin); //输入重定向,输入数据将从D盘根目录下的in.txt文件中读取freopen("D:\\abc.txt","w",stdout); //输出重定向,输出数据将保存在D盘根目录下的out.txt文件中对于多数据时,调试很方便。如果不可用,可能是版本不支持,需要用freopen_s()自...

2019-05-10 14:53:55 462

原创 蓝桥杯调手表

//做题时,题目的意思一定想清楚,要多看几遍题目,搞清楚题意,直达想清楚,可以抽象出题目的模型便于解决。/*标题:调手表小明买了块高端大气上档次的电子手表,他正准备调时间呢。在 M78 星云,时间的计量单位和地球上不同,M78 星云的一个小时有 n 分钟。大家都知道,手表只有一个按钮可以把当前的数加一。在调分钟的时候,如果当前显示的数是 0 ,那么按一下按钮就会变成 1,再按一次变成 ...

2019-05-10 13:17:33 764

原创 蓝桥杯第九届格雷码

/*标题:格雷码格雷码是以n位的二进制来表示数。与普通的二进制表示不同的是,它要求相邻两个数字只能有1个数位不同。首尾两个数字也要求只有1位之差。有很多算法来生成格雷码。以下是较常见的一种:从编码全0开始生成。当产生第奇数个数时,只把当前数字最末位改变(0变1,1变0)当产生第偶数个数时,先找到最右边的一个1,把它左边的数字改变。用这个规则产生的4位格雷码序列如下:0000 ...

2019-05-09 21:31:37 152

原创 c/cpp二进制运算的简单归纳

&按位与,双目运算符。特点:二进制位上有0,那么该位就是0,都为1才为1| 按位或二进制位上有1,那该位就是1^ 按位异或 该位和0异或,该位不变,该位和1异或,该位必变。~ 按位取反单目。要左移的数<<左移多少位,左移多少位相当于乘以2的多少次方要右移的数<<右移多少位,右移多少位相当于除以2的多少次方lowbit(x)...

2019-05-09 21:30:28 1339

原创 蓝桥杯第九届决赛激光样式

#include <iostream>#include <cstdio>#include <cstring>using namespace std;/* run this program using the console pauser or add your own getch, system("pause") or input loop */int...

2019-05-09 19:12:35 100

原创 蓝桥杯第九届国赛换零钞

#include <iostream>using namespace std;/* run this program using the console pauser or add your own getch, system("pause") or input loop */int main(int argc, char *argv[]) { int n=200;...

2019-05-09 18:09:02 185

转载 蓝桥杯对局匹配

这篇博客讲解的不错这篇是原理/*标题:对局匹配小明喜欢在一个围棋网站上找别人在线对弈。这个网站上所有注册用户都有一个积分,代表他的围棋水平。小明发现网站的自动对局系统在匹配对手时,只会将积分差恰好是K的两名用户匹配在一起。如果两人分差小于或大于K,系统都不会将他们匹配。现在小明知道这个网站总共有N名用户,以及他们的积分分别是A1, A2, ... AN。小明想了解最...

2019-05-09 13:23:52 291

原创 蓝桥杯发现环

#include <stdio.h>#include <string.h>#include <vector>#include <algorithm>using namespace std;const int maxn = 100000+5;int f[maxn]; //并查集的数组int book[maxn]; ...

2019-05-07 18:42:18 265

原创 蓝桥杯第七届国赛希尔伯特曲线

/*标题:希尔伯特曲线希尔伯特曲线是以下一系列分形曲线 Hn 的极限。我们可以把 Hn 看作一条覆盖 2^n × 2^n 方格矩阵的曲线,曲线上一共有 2^n × 2^n 个顶点(包括左下角起点和右下角终点),恰好覆盖每个方格一次。[p1.png]Hn(n > 1)可以通过如下方法构造:1. 将 Hn-1 顺时针旋转90度放在左下角2. 将 Hn-1 逆时针旋转90度放在右...

2019-05-07 14:53:35 265

原创 蓝桥杯第八届国赛36进制

#include <iostream>#include <cmath>#include <cstdio>using namespace std;/* run this program using the console pauser or add your own getch, system("pause") or input loop */in...

2019-04-27 23:54:35 135

原创 蓝桥杯第七届国赛-机器人塔

深搜回溯剪枝加简单dp/*机器人塔X星球的机器人表演拉拉队有两种服装,A和B。他们这次表演的是搭机器人塔。类似:AB BA B AA A B BB B B A BA B A B B A队内的组塔规则是: A 只能站在 AA 或 BB 的肩上。 B 只能站在 AB 或 BA 的肩上。你的任务是帮助拉拉队计算一下,在给定A与B的人数时,可以组成多少...

2019-04-27 23:08:49 170

翻译 蓝桥杯棋子换位

这个帖子十分详细!!!棋子换位有n个棋子A,n个棋子B,在棋盘上排成一行。它们中间隔着一个空位,用“.”表示,比如:AAA.BBB现在需要所有的A棋子和B棋子交换位置。移动棋子的规则是:1. A棋子只能往右边移动,B棋子只能往左边移动。2. 每个棋子可以移动到相邻的空位。3. 每个棋子可以跳过相异的一个棋子落入空位(A跳过B或者B跳过A)。AAA.BBB 可以走法:移...

2019-04-26 23:44:37 277

原创 蓝桥杯凑平方数

#include <iostream>#include <algorithm>#include <cstring>#include <string>#include <sstream>#include <cmath>#include <set>using namespace std;int a[]=...

2019-04-26 00:32:26 224

空空如也

空空如也

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

TA关注的人

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