- 博客(11)
- 收藏
- 关注
原创 Educational Codeforces Round 141 (Rated for Div. 2).题解
Educational Codeforces Round 141 (Rated for Div. 2)
2023-01-20 11:05:28
183
原创 The 2021 ICPC Asia Shanghai Regional Programming Contest.题解
The 2021 ICPC Asia Shanghai Regional Programming Contest.题解
2023-01-10 17:13:08
619
原创 P1032 [NOIP2002 提高组] 字串变换(洛谷)
bfs:经典 二重for循环:1格子(字符串)8方向(选择)while(!q.empty())queue遍历priority_queue优先级void bfs() { int ans = 0; node u, v; u.str = s, u.step = 0; q.push(u); while (!q.empty()) { u = q.front(); q.pop(); if (maps.count(u.str)) continue
2022-05-09 17:38:13
519
原创 P3375 【模板】KMP字符串匹配(洛谷)
P3375 【模板】KMP字符串匹配理解一.求长度string类型:string s;(1) s.length()(2)s.size()char类型:char s[100];(1)strlen(s)(2)sizeof(s) : ‘\0’二.KMP模式匹配/字符串匹配模式串/子串自配 = prefix( & suffix) tablei0 1 2 3 4 51/2_ a b a b cfor (int i = 2, j = 0; i <=
2022-05-06 12:19:57
326
原创 P3956 [NOIP2017 普及组] 棋盘
P3956 [NOIP2017 普及组] 棋盘理解read() 快读函数:(1)强类型语言C++ => 泛型汇编template <typename Tp>void read(Tp &x)(2)&x 引用:实参 => 形参actual parameter(3)getchar() :遇 ’\n’ 止步template <typename Tp>void read(Tp &x) { x = 0; int f = 1;
2022-05-04 20:56:04
358
原创 P1443 马的遍历(洛谷)
提示:文章写完后,目录可以自动生成,如何生成可参考右边的帮助文档文章目录P1443 马的遍历一、Question二、MY CODE2.读入数据总结P1443 马的遍历(1)BFS(breadth first search) 2)Queue一、Question题目描述有一个 n \times mn×m 的棋盘,在某个点 (x, y)(x,y) 上有一个马,要求你计算出马到达棋盘上任意一个点最少要走几步。输入格式输入只有一行四个整数,分别为 n, m, x, yn,m,x,y。输出格.
2022-05-01 12:23:58
366
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人