algorithm
MyTHicMyuu
突然想着拾起这个账号写点什么,希望能坚持下去吧
展开
专栏收录文章
- 默认排序
- 最新发布
- 最早发布
- 最多阅读
- 最少阅读
-
通过位运算实现大小写互转与单向转换
通过位运算实现大小写互转与单向转换 字母大小写转换一般都是通过一些库函数来实现,比如C++的tolower和toupper。但实际上不依赖库函数,只需要位运算也能实现快速的大小写转换。 大小写互相转换 ch^0x20 统一转为大写 ch & 0b11011111 简写:ch & 0xDF 统一转为小写 ch | 0b00100000 简写:ch | 0x20 ...原创 2021-03-02 10:59:32 · 200 阅读 · 0 评论 -
求最长回文字串DP
之前看到另一篇博客的dp很简洁但是是错的,略作修改#include <cstdio>#include <algorithm>#include <iostream>#include <string>#include <cstring>using namespace std;int dp[205][205];int n;int main(){...原创 2018-05-05 13:04:01 · 258 阅读 · 0 评论
分享