MccreeHero
MccreeHero
全部文章
分类
题解(7)
归档
标签
去牛客网
登录
/
注册
MccreeHero的博客
全部文章
(共7篇)
自定义大整数类BigInt数据结构
面向对象 #include <bits/stdc++.h> using namespace std; class BigInt { private: string num; public: #define proces() do { \ if (t >...
2021-07-03
0
420
静态链表(理论上最优解,有兴趣可以看看)
插入节点时间复杂度,因为是静态链表,所以查找插入节点的时间复杂度为 删除节点需要头节点开始查找, 再删除优点是高效的同时不需要手动释放内存,缺点是 如果很小,空间浪费比较大,为 a[p] => p->next && p->val; 下标就是指针,里面的值既代表...
2021-06-21
2
587
重点:判断掩码非法
判断掩码非法m + (m & (-m)) || !(m + 1) exp: 合法mask: 255.255.128.0m = 11111111 11111111 10000000 00000000(-m) = 00000000 00000000 10000000 00000000 (补码取...
2021-06-21
8
845
递归逻辑比较清晰
1963020one million nine hundred and sixty three thousand and twenty这种情况,到底是and twenty 还是 twenty,测试用例没有覆盖1538088one million five hundred and thirty eig...
2021-06-21
2
440
简单就是美
#include <bits/stdc++.h> using namespace std; typedef struct { union { struct { uint8_t p4; uint8_t p3; ...
2021-06-20
4
619
暴力解法
# 暴力解法 #include <bits/stdc++.h> using namespace std; int main() { ios::sync_with_stdio(false); cin.tie(0); cout.tie(0); &nbs...
2021-06-20
2
450
目前最干净的代码,大家可以参考一下
要点 scanf输入uint8_t, 使用宏 "%" SCNu8 自定义结构体,方便阅读 判断IP失效 (ms + (ms & (-ms))) || !(ms + 1) (ms表示掩码) 基本的IP类型判断 #include <bits/stdc++.h...
IP
结构体
2021-06-18
1
527