蓝桥杯
未言笑
这个作者很懒,什么都没留下…
展开
-
蓝桥杯第七届国赛-机器人塔
深搜回溯剪枝加简单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 · 167 阅读 · 0 评论 -
蓝桥杯猜灯谜
#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 阅读 · 0 评论 -
蓝桥杯连续奇数和
#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 · 198 阅读 · 0 评论 -
蓝桥杯调手表
//做题时,题目的意思一定想清楚,要多看几遍题目,搞清楚题意,直达想清楚,可以抽象出题目的模型便于解决。/*标题:调手表小明买了块高端大气上档次的电子手表,他正准备调时间呢。在 M78 星云,时间的计量单位和地球上不同,M78 星云的一个小时有 n 分钟。大家都知道,手表只有一个按钮可以把当前的数加一。在调分钟的时候,如果当前显示的数是 0 ,那么按一下按钮就会变成 1,再按一次变成 ...原创 2019-05-10 13:17:33 · 759 阅读 · 0 评论 -
蓝桥杯空白格式化
#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 · 258 阅读 · 0 评论 -
蓝桥杯第六届决赛积分之谜
#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 · 140 阅读 · 0 评论 -
蓝桥杯第六届完美正方形
参考博客#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 · 203 阅读 · 0 评论 -
蓝桥杯第六届关联账户
/*标题:关联账户为增大反腐力度,某地警方专门支队,对若干银行账户展开调查。如果两个账户间发生过转账,则认为有关联。如果a,b间有关联, b,c间有关联,则认为a,c间也有关联。对于调查范围内的n个账户(编号0到n-1),警方已知道m条因转账引起的直接关联。现在希望知道任意给定的两个账户,求出它们间是否有关联。有关联的输出1,没有关联输出0小明给出了如下的解决方案:*/...原创 2019-05-11 21:10:53 · 160 阅读 · 0 评论 -
蓝桥杯密文匹配
#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 · 162 阅读 · 0 评论 -
蓝桥杯高僧斗法
快速了解算法中的博弈#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 · 311 阅读 · 0 评论 -
蓝桥杯第五届决赛年龄巧合
#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 · 186 阅读 · 0 评论 -
蓝桥杯格子刷油漆
/*标题:格子刷油漆 X国的一段古城墙的顶端可以看成 2*N个格子组成的矩形(如图1所示),现需要把这些格子刷上保护漆。 你可以从任意一个格子刷起,刷完一格,可以移动到和它相邻的格子(对角相邻也算数),但不能移动到较远的格子(因为油漆未干不能踩!) 比如:a d b c e f 就是合格的刷漆顺序。 c e f d a b 是另一种合适的方案。 当已知 N...翻译 2019-05-17 23:40:15 · 247 阅读 · 0 评论 -
蓝桥杯星期几
#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 · 307 阅读 · 0 评论 -
蓝桥杯数据压缩
/*【代码填空】(满分16分) 某工业监控设备不断发回采样数据。每个数据是一个整数(0到1000之间)。各个数据间用空白字符(空格,TAB或回车换行)分隔。这些数据以文本形式被存储在文件中。 因为大多数时候,相邻的采样间隔数据是相同的,可以利用这个特征做数据的压缩存储。其方法是:对n(n>1)个连续相同的数字只记录n和该数字本身; 对m(m>0)个连续不...原创 2019-05-18 16:27:45 · 293 阅读 · 0 评论 -
蓝桥杯发现环
#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 · 262 阅读 · 0 评论 -
蓝桥杯第七届国赛希尔伯特曲线
/*标题:希尔伯特曲线希尔伯特曲线是以下一系列分形曲线 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 · 259 阅读 · 0 评论 -
蓝桥杯第八届国赛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 · 134 阅读 · 0 评论 -
蓝桥杯出栈次序
#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 · 301 阅读 · 0 评论 -
蓝桥杯对局匹配
这篇博客讲解的不错这篇是原理/*标题:对局匹配小明喜欢在一个围棋网站上找别人在线对弈。这个网站上所有注册用户都有一个积分,代表他的围棋水平。小明发现网站的自动对局系统在匹配对手时,只会将积分差恰好是K的两名用户匹配在一起。如果两人分差小于或大于K,系统都不会将他们匹配。现在小明知道这个网站总共有N名用户,以及他们的积分分别是A1, A2, ... AN。小明想了解最...转载 2019-05-09 13:23:52 · 287 阅读 · 0 评论 -
蓝桥杯拼音字母
#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 · 192 阅读 · 0 评论 -
蓝桥杯生物芯片
#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 · 245 阅读 · 0 评论 -
蓝桥杯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 · 546 阅读 · 0 评论 -
蓝桥杯组合数
组合数性质:若表示在 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 · 1074 阅读 · 0 评论 -
蓝桥杯自守数
#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 · 178 阅读 · 0 评论 -
蓝桥杯第九届国赛换零钞
#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 · 180 阅读 · 0 评论 -
蓝桥杯第九届决赛激光样式
#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 · 98 阅读 · 0 评论 -
蓝桥杯猜算式
#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 · 278 阅读 · 0 评论 -
蓝桥杯信号匹配
/*标题:信号匹配 从X星球接收了一个数字信号序列。 现有一个已知的样板序列。需要在信号序列中查找它首次出现的位置。这类似于串的匹配操作。 如果信号序列较长,样板序列中重复数字较多,就应当注意比较的策略了。可以仿照串的KMP算法,进行无回溯的匹配。这种匹配方法的关键是构造next数组。 next[i] 表示第i项比较失配时,样板序列向右滑动,需要重新比较的项的序...原创 2019-05-14 17:14:51 · 158 阅读 · 0 评论 -
蓝桥杯第九届格雷码
/*标题:格雷码格雷码是以n位的二进制来表示数。与普通的二进制表示不同的是,它要求相邻两个数字只能有1个数位不同。首尾两个数字也要求只有1位之差。有很多算法来生成格雷码。以下是较常见的一种:从编码全0开始生成。当产生第奇数个数时,只把当前数字最末位改变(0变1,1变0)当产生第偶数个数时,先找到最右边的一个1,把它左边的数字改变。用这个规则产生的4位格雷码序列如下:0000 ...原创 2019-05-09 21:31:37 · 152 阅读 · 0 评论 -
第十届蓝桥杯B组C++国赛总结来啦
1.题量变大啦,10道题。2.我做了六道半,二等奖中下水平。3.推测一等奖至少得八道以上的题。4.面包会有的,牛奶也会有的。5.建议多刷题,早准备。6.希望大赛越办越好。7.不说啦,有点心累呀。...原创 2019-05-28 21:03:52 · 1372 阅读 · 0 评论