harumakigohan686

< 2025年3月 >
23 24 25 26 27 28 1
2 3 4 5 6 7 8
9 10 11 12 13 14 15
16 17 18 19 20 21 22
23 24 25 26 27 28 29
30 31 1 2 3 4 5

统计

01 2023 档案

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

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

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 阅读(49) 评论(3) 推荐(0) 编辑

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 阅读(25) 评论(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 阅读(10) 评论(0) 推荐(0) 编辑

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

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

#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 阅读(18) 评论(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 阅读(16) 评论(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 阅读(22) 评论(0) 推荐(0) 编辑

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

posted @ 2023-01-05 22:55 harumakigohan 阅读(73) 评论(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 阅读(25) 评论(0) 推荐(0) 编辑

CP1042 阶乘的尾数
摘要:本想做个小题,没想到牵扯出了大数阶乘(悲 本质上还是极限 俺的做法: #include <stdio.h> int change(int m); int main() { int a[20001]; int m,u; int temp,digit,n,i,j=0; int sum=0; scanf( 阅读全文

posted @ 2023-01-04 14:38 harumakigohan 阅读(23) 评论(0) 推荐(0) 编辑

#ACM2021_25. 有关2022
摘要:今天整了个小题,但可惜超时了(悲 我之前的做法(暴力枚举,但超时) #include <stdio.h> #include <string.h> int main(int argc, const char *argv[]) { int a,b,c,d,e,sum,k; int count=0; sc 阅读全文

posted @ 2023-01-04 12:20 harumakigohan 阅读(30) 评论(0) 推荐(0) 编辑

CP1250 猜数魔术 CP1239 字符串反向
摘要:我的做法: #include <stdio.h> int Magic(int m); int main() { int m, ret; printf("Input a sum:"); scanf("%d", &m); ret = Magic(m); if (ret != 1) { printf("T 阅读全文

posted @ 2023-01-04 01:36 harumakigohan 阅读(27) 评论(0) 推荐(0) 编辑

今日破防
摘要:P100 输出倒三角形图案 #include <stdio.h> #define MAX_LEN 10 #define N 150 #include<string.h> #include<stdlib.h> #include <stdio.h> int main() { int n, i, j; s 阅读全文

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

平方加1的最大素因子
摘要:我的做法: #include <stdio.h> #define MAX_LEN 10 #define N 150 #include<string.h> #include<stdlib.h> int main() { int n,m,j=0,l=0; int a[100]; int b[100]; 阅读全文

posted @ 2023-01-02 13:22 harumakigohan 阅读(32) 评论(0) 推荐(0) 编辑

一到n的素数和
摘要:循环嵌套法: #include <stdio.h>#define MAX_LEN 10#define N 150#include<string.h>#include<stdlib.h>int judge(int i);int main(){ int n,i,k; int sum=0; scanf(" 阅读全文

posted @ 2023-01-02 00:35 harumakigohan 阅读(29) 评论(0) 推荐(0) 编辑

点击右上角即可分享
微信分享提示