harumakigohan686

2023年1月17日

蓝桥杯真题初探:CP1102. 完美的代价

摘要: 题目描述: 回文串,是一种特殊的字符串,它从左往右读和从右往左读是一样的。崔学长认为回文串才是完美的(但吕学弟不这样认为)。现在给你一个串,它不一定是回文的,请你计算最少的交换次数使得该串变成一个完美的回文串。 交换的定义是:交换两个相邻的字符 例如mamad 第一次交换 ad : mamda 第二 阅读全文

posted @ 2023-01-17 22:41 harumakigohan 阅读(43) 评论(0) 推荐(0) 编辑

2023年1月15日

CP1242. 将字符数组中第m个字符开始的n个字符逆序存放

摘要: 只是打卡: #include <stdio.h> #include <ctype.h> #include <string.h> #include <math.h> int y=0; void inverse(char str[1000],char b[1000],int m,int n,int k) 阅读全文

posted @ 2023-01-15 14:13 harumakigohan 阅读(45) 评论(3) 推荐(0) 编辑

2023年1月14日

CP1067 模拟洗牌

摘要: 考到了函数的递归+回溯,很有意思 俺的做法: #include <stdio.h> #include <ctype.h> #include <string.h> #include <math.h> char b[1000]; char c[1000]; char d[1000]; char a[10 阅读全文

posted @ 2023-01-14 16:21 harumakigohan 阅读(23) 评论(1) 推荐(0) 编辑
CP1061 小车去哪儿了

摘要: 一道很有趣的题目,考了小车的行动,同时要设置方向号来进行偏移方向 俺的做法: #include <stdio.h> #include <ctype.h> #include <string.h> #include <math.h> int main() { int x=0,y=0; int dirto 阅读全文

posted @ 2023-01-14 14:40 harumakigohan 阅读(8) 评论(0) 推荐(0) 编辑

2023年1月9日

近几日的算法学习(背包问题+回溯递归算法)附例题

摘要: 最近两天都没有更新博客力( 其实是去学了些算法,算是对计算机科学有了全新的认识吧(我之前在课本学的是什么勾八玩意儿) CP1055 有多少个数的和是素数(经典的回溯算法,暴力枚举) 俺的做法:#include <stdio.h> #include <ctype.h> #include <string 阅读全文

posted @ 2023-01-09 08:43 harumakigohan 阅读(24) 评论(1) 推荐(0) 编辑

2023年1月6日

#CP1046. 离5的倍数最远的因子

摘要: 练了练双向搜索,很有意义的尝试 俺的做法: #include <stdio.h> #include<stdlib.h> #include <ctype.h> #include <string.h> int main() { int n,m=0,x=0; int p; int a[100]; int 阅读全文

posted @ 2023-01-06 21:55 harumakigohan 阅读(13) 评论(0) 推荐(0) 编辑
这里先埋个坑(

摘要: #CP1025. 陈述句变成疑问句 还是有点小bug后面再调吧 #include <stdio.h> #include <ctype.h> #include <string.h> int main() { char a[100]; char b[100]; //第一个单词 char c[100]; 阅读全文

posted @ 2023-01-06 11:08 harumakigohan 阅读(15) 评论(0) 推荐(0) 编辑
#ACM2021_23. 摘柿子 and#ACM2021_34. 幸运数字

摘要: #ACM2021_23. 摘柿子:一道很简单的排序题,估计是送分题( 俺的做法: #include <stdio.h> #include <stdlib.h> #define N 100 #define M 100 int main() { int n;//n为柿子个数 int a[100];//敲 阅读全文

posted @ 2023-01-06 10:31 harumakigohan 阅读(16) 评论(0) 推荐(0) 编辑

2023年1月5日

CP1024 单词切分以及一些拓展题

摘要: 又是一道小题,(但是也不是空格作为分割符,范围更广)本质上还是连续字符串,又考了判断嵌套啊 俺的做法: #include <stdio.h> #include <ctype.h> #include <string.h> int main() { char a[100];//用于存储刚开始的字符串 c 阅读全文

posted @ 2023-01-05 22:55 harumakigohan 阅读(66) 评论(0) 推荐(0) 编辑
CP1023 单词首字母大写

摘要: 一道卡了我好几天的题目(题干绝不是你看起来的这么简单,因为并不是简单的空格判定) 我的做法: #include <stdio.h> #include <ctype.h> #include <string.h> #define MAX_NUM 128 int main() { char s[MAX_N 阅读全文

posted @ 2023-01-05 18:01 harumakigohan 阅读(20) 评论(0) 推荐(0) 编辑