摘要: [C++ priority_queue的自定义比较方式] #include<queue> #include<vector> #include<iostream> using namespace std; struct node { int x, y; node(int x, int y) :x(x) 阅读全文
posted @ 2022-09-06 17:05 风早&爽子 阅读(99) 评论(0) 推荐(0)
摘要: lowbit 在计算数字二进制表示中有多少个1的时候,可以使用lowbit来表示。每次找到数的最后一个1的大小。 x&(-x) 具体代码为 int num1count(int x) { int m = 0; for (; x; x -= x & (-x)) { m++; } return m; } 阅读全文
posted @ 2022-09-06 16:58 风早&爽子 阅读(36) 评论(0) 推荐(0)
摘要: 学习与记录。 阅读全文
posted @ 2022-09-06 16:49 风早&爽子 阅读(156) 评论(0) 推荐(0)