摘要: A. Problemsolving Log 签到题,对于给出的字符串,记录每个字母出现的次数,然后遍历一遍,如果对应的字母出现的次数大于它的位次,则说明该题被解出来了,最后输出解题数量即可 点击查看代码 #include<iostream> #include<cstdio> #include<alg 阅读全文
posted @ 2024-07-10 09:00 什么时候才能不困 阅读(63) 评论(0) 推荐(0) 编辑
摘要: 题目传送门 题目 跳转看吧 题解 哈希,字典树 对字符串的前缀进行哈希处理,转换为数字,用 map ,然后为了避免重复,可以将每一种公共字符串前缀的权重都设置为1 例如: a , ab , aba 权重都为1,因为 ab 是2,但是有一种包含在 a阅读全文
posted @ 2024-07-05 15:36 什么时候才能不困 阅读(10) 评论(0) 推荐(0) 编辑
摘要: 简介 深度优先搜索算法DepthFirstSearch 简称 DFS 一种用于遍历或搜索树或图的算法。 沿着树的深度遍历树的节点,尽可能深的搜索树的分支。当节点 v 的所在边都己被探寻过或者在搜寻时结点不满足条件,搜索将回溯到发现节点 v 的那条边的起始节 阅读全文
posted @ 2023-11-26 20:33 什么时候才能不困 阅读(24) 评论(0) 推荐(0) 编辑
摘要: 第一关: 第一关 #pragma once # include <bits/stdc++.h> using namespace std; namespace exa{ struct bnode { struct bnode * lchild, * rchild; char data; }; type 阅读全文
posted @ 2023-11-06 08:17 什么时候才能不困 阅读(44) 评论(0) 推荐(0) 编辑
摘要: 第一关 #include <stdio.h> #include <stdlib.h> #include "SeqQueue.h" SeqQueue* SQ_Create(int maxlen) // 创建顺序队列, 队列最多存储maxlen个队列元素。 { SeqQueue* sq=(SeqQueu 阅读全文
posted @ 2023-10-09 09:13 什么时候才能不困 阅读(52) 评论(0) 推荐(0) 编辑
摘要: 第一关 #include <stdio.h> #include <stdlib.h> #include "SeqStack.h" /*创建一个栈*/ SeqStack* SS_Create(int maxlen) { SeqStack* ss=(SeqStack*)malloc(sizeof(Seq 阅读全文
posted @ 2023-10-09 09:11 什么时候才能不困 阅读(23) 评论(0) 推荐(0) 编辑
摘要: d数位dp #include <iostream> #include <cstring> #include <algorithm> #include <string> #include <cmath> #include <vector> using namespace std; const int 阅读全文
posted @ 2023-09-25 09:31 什么时候才能不困 阅读(7) 评论(0) 推荐(0) 编辑
摘要: 第一题 #include "linearList.h" node *insertTail(node *h, node *t) { // 请在此添加代码,补全函数insertTail /********** Begin *********/ if(h==NULL) { t->next=NULL; re 阅读全文
posted @ 2023-09-25 09:09 什么时候才能不困 阅读(72) 评论(0) 推荐(0) 编辑
摘要: 第一题 /************************************************************* date: April 2017 copyright: Zhu En DO NOT distribute this code without my permissio 阅读全文
posted @ 2023-09-25 09:05 什么时候才能不困 阅读(34) 评论(0) 推荐(0) 编辑
摘要: 我们首先来看一下什么是前向星. 前向星是一种特殊的边集数组,我们把边集数组中的每一条边按照起点从小到大排序,如果起点相同就按照终点从小到大排序, 并记录下以某个点为起点的所有边在数组中的起始位置和存储长度,那么前向星就构造好了. 建图 int e[N], ne[N], h[N], idx; int 阅读全文
posted @ 2023-07-18 09:56 什么时候才能不困 阅读(19) 评论(0) 推荐(0) 编辑
// /* */
点击右上角即可分享
微信分享提示