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