- 博客(11)
- 收藏
- 关注
原创 Educational Codeforces Round 141 (Rated for Div. 2).题解
Educational Codeforces Round 141 (Rated for Div. 2)
2023-01-20 11:05:28 85
原创 The 2021 ICPC Asia Shanghai Regional Programming Contest.题解
The 2021 ICPC Asia Shanghai Regional Programming Contest.题解
2023-01-10 17:13:08 507
原创 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 357
原创 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) table i 0 1 2 3 4 5 1/2 _ a b a b c for (int i = 2, j = 0; i <=
2022-05-06 12:19:57 231
原创 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 286
原创 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 295
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人