上一页 1 ··· 4 5 6 7 8 9 10 11 12 ··· 15 下一页
摘要: 一、题目描述 二、解题思路 tarjan求割边模板题,用个答案数组存答案,求出来后排序就可以了。 三、代码实现 1 #include "bits/stdc++.h" 2 using namespace std; 3 int G[200][200]; 4 int low[200],dfn[200],t 阅读全文
posted @ 2022-02-13 19:30 RKevinR 阅读(85) 评论(0) 推荐(0)
摘要: 一、题目描述 二、解题思路 Dijkstra模板题,套模板即可。 三、代码实现 1 #include "bits/stdc++.h" 2 using namespace std; 3 const int inf = 1e9; 4 int dis[210],vis[210]; 5 int graph[ 阅读全文
posted @ 2022-02-13 19:28 RKevinR 阅读(56) 评论(0) 推荐(0)
摘要: 一、项目名称 五子棋 二、项目思路 1、搜集图片材料 2、绘制棋盘 3、实现鼠标下棋 4、用dfs判断输赢 5、实现双方下棋 6、实现AI下棋 (1)使用AI估分函数 (2)设计AI计算深度 (3)优化AI算法(α-β算法) 三、代码实现 1 #include <stdio.h> 2 //加载图形库 阅读全文
posted @ 2022-02-10 19:53 RKevinR 阅读(168) 评论(0) 推荐(0)
摘要: 一、题目描述 二、解题思路 这个题目思路不难,但是容易坑你,就是中间为了防止特殊情况发生需要加上1个特殊字符,防止判断错误。(等会再说) 这个题目要我们求拼接后的单词,但是前一个单词的后缀和后一个单词的前缀的相重合的部分不再相加,所以我们想到了kmp算法,用string把输入串接上目前答案串,写个k 阅读全文
posted @ 2022-02-08 20:43 RKevinR 阅读(70) 评论(0) 推荐(0)
摘要: 一、题目描述 二、解题思路 数据量不大,直接暴力枚举即可,计算最大的答案。 三、代码实现 1 #include "bits/stdc++.h" 2 using namespace std; 3 int main() 4 { 5 char s1[110],s2[110]; 6 cin >> s1 >> 阅读全文
posted @ 2022-02-08 20:33 RKevinR 阅读(143) 评论(0) 推荐(0)
摘要: 一、解题思路 哈希模板题,我用map解决了 二、代码实现 1 #include "bits/stdc++.h" 2 using namespace std; 3 map <string,int> ans; 4 string temp; 5 int cnt; 6 int main() 7 { 8 in 阅读全文
posted @ 2022-02-08 20:31 RKevinR 阅读(49) 评论(0) 推荐(0)
摘要: 一、题目描述 二、解题思路 给出了c是已知,然我们求A和B是否存在,把等式变换一下,A = C + B,然后用hash判断即可,当然我用的是map(stl大法好),防止重复的没有被加到。 三、代码实现 1 #include <bits/stdc++.h> 2 using namespace std; 阅读全文
posted @ 2022-02-08 20:29 RKevinR 阅读(133) 评论(0) 推荐(0)
摘要: 一、题目描述 二、解题思路 这个题的数据量有点大,考虑hash,然后就用了set,(stl大法好) 三、代码实现 1 #include "bits/stdc++.h" 2 using namespace std; 3 set <string> ans; 4 set <string> ans2; 5 阅读全文
posted @ 2022-02-08 20:25 RKevinR 阅读(74) 评论(0) 推荐(0)
摘要: 代码实现 1 #include "bits/stdc++.h" 2 using namespace std; 3 const int maxn = 1e6; 4 char s1[maxn + 10],s2[maxn + 10]; 5 int nextval[maxn + 10]; 6 int ans 阅读全文
posted @ 2022-02-08 20:22 RKevinR 阅读(84) 评论(0) 推荐(0)
摘要: 一、关键路径算法 关键路径算法是在工程能完成的情况下找出关键的几个活动,达到工程更早完成的效果。 二、算法分析 这个算法中我们需要用到etv,ltv,ete,lte这几个变量,还需要用到确保工程能完成的算法,也就是拓扑排序算法 在这个算法中我们把顶点看作是事件,边权看作是活动持续时间,边看作是活动 阅读全文
posted @ 2022-02-04 15:36 RKevinR 阅读(1607) 评论(0) 推荐(0)
上一页 1 ··· 4 5 6 7 8 9 10 11 12 ··· 15 下一页