算法
文章平均质量分 67
playerboythe
前端后端开发,大模型人工智能。
展开
专栏收录文章
- 默认排序
- 最新发布
- 最早发布
- 最多阅读
- 最少阅读
-
C. A-B Palindrome
C. A-B Palindrome You are given a string s consisting of the characters ‘0’, ‘1’, and ‘?’. You need to replace all the characters with ‘?’ in the string s by ‘0’ or ‘1’ so that the string becomes a palindrome and has exactly a characters ‘0’ and exactly b原创 2021-07-14 16:51:37 · 394 阅读 · 1 评论 -
序列自动机
序列自动机 非常好用的算法,可以在O(1)的时间复杂度判断i后面x第一次出现的位置。 #include <iostream> #include <algorithm> #include <string.h> using namespace std; int a[50],nxt[100010][50],pre[50]; int main() { int i,j,n; cin>>n; for(i=0;i<n;i++) { cin>>a原创 2021-07-12 10:29:29 · 213 阅读 · 0 评论 -
有关图的入门讲解
图 什么是图 图在现实生活中非常重要,遍布于诸多学科诸多领域,从285年前的哥尼斯堡的七桥,到现代手机上的智能导航,图论一直在推进着人类的进步,便利人们的生活。可以说是与我们密切相关了。最常见的应用,例如当前城市规模越来越大,交通路线越来越复杂,寻找最短路径或者最优路线等问题都与图论密不可分。而到底什么是一个图,用最简单的话来描述,就是若干节点相连,形成的闭合回路,就是一个图, 图分为有向图和无向图,有向图就是节点与节点之间有着单向路径,例如A能到B但B不一定能到A。而无向图则两点之间有路,两点都到达对方。原创 2021-07-12 10:18:32 · 314 阅读 · 2 评论
分享