摘要: #include <iostream> #include <vector> #include <string> using namespace std; // 三元组结构体 struct Triple { int row, col; // 行号、列号(从0开始) int val; // 非零元素值 阅读全文
posted @ 2025-11-05 14:27 ouyeye 阅读(13) 评论(0) 推荐(0)
摘要: #include <iostream> #include <string> using namespace std; // 构建KMP的next数组 void getNext(const string& t, int next[]) { int len = t.size(); next[0] = - 阅读全文
posted @ 2025-11-05 13:47 ouyeye 阅读(6) 评论(0) 推荐(0)
摘要: #include <iostream> #include <string> using namespace std; // 简单模式匹配,判断从主串s的pos位置开始,是否有与子串sub匹配的子串 bool simpleMatch(const string& s, const string& sub 阅读全文
posted @ 2025-11-05 13:44 ouyeye 阅读(8) 评论(0) 推荐(0)
摘要: #include <iostream> #include <string> using namespace std; string plain = "abcdefghijklmnopqrstuvwxyz"; string cipher = "ngzqtcomuhelkpdawxfyivrsj"; / 阅读全文
posted @ 2025-11-05 13:35 ouyeye 阅读(8) 评论(0) 推荐(0)