2025年10月27日
摘要: a^b的1的数量= a的1的数量+b的1的数量-2*(a&b)的1的数量 所以a^b的奇偶性 只与 a的1的数量和b的1的数量有关 阅读全文
posted @ 2025-10-27 11:50 下头小美 阅读(2) 评论(0) 推荐(0)
  2025年10月22日
摘要: //最小 #include <bits/stdc++.h> using i64 = long long; struct Line { i64 m, b; Line(i64 _m = 0, i64 _b = LLONG_MAX) : m(_m), b(_b) {} i64 eval(i64 x) co 阅读全文
posted @ 2025-10-22 19:17 下头小美 阅读(3) 评论(0) 推荐(0)
  2025年10月9日
摘要: 用树状数组求逆序对 struct BIT { int c[N]; BIT(){ memset(c, 0, sizeof(c)); } void add(int pos, int val) { while(pos <= n) c[pos] += val, pos += (pos & -pos); } 阅读全文
posted @ 2025-10-09 11:19 下头小美 阅读(6) 评论(0) 推荐(0)
  2025年10月5日
摘要: https://codeforces.com/gym/105386/problem/J #include <bits/stdc++.h> using i64 = long long; struct STList { int n, k; std::vector<std::vector<int>> Ma 阅读全文
posted @ 2025-10-05 18:40 下头小美 阅读(12) 评论(0) 推荐(0)
  2025年10月1日
摘要: x+y=(x⊕y)+2⋅(x&y) 阅读全文
posted @ 2025-10-01 21:51 下头小美 阅读(5) 评论(0) 推荐(0)
摘要: #include <iostream> #include <cstring> #include <algorithm> using namespace std; const int N = 50005, M=2*N; int h[N], to[M], ne[M], tot; int dep[N],f 阅读全文
posted @ 2025-10-01 21:49 下头小美 阅读(7) 评论(0) 推荐(0)
  2025年9月30日
摘要: https://codeforces.com/gym/105657/problem/M #include<bits/stdc++.h> using namespace std; #define vcoistnt ios_base::sync_with_stdio(false); cin.tie(NU 阅读全文
posted @ 2025-09-30 23:17 下头小美 阅读(5) 评论(0) 推荐(0)
  2025年9月22日
摘要: https://www.cnblogs.com/dx123/p/18113577 // 普通莫队 O(n*sqrt(n)) #include <iostream> #include <cstring> #include <algorithm> #include <cmath> using names 阅读全文
posted @ 2025-09-22 21:03 下头小美 阅读(3) 评论(0) 推荐(0)
  2025年8月23日
摘要: #include <iostream> #include <cstring> #include <algorithm> using namespace std; const int N=12; int a[N]; //把整数的每一位数字抠出来,存入数组 int f[N][N]; //f[i][j]表 阅读全文
posted @ 2025-08-23 16:07 下头小美 阅读(8) 评论(0) 推荐(0)
  2025年8月8日
摘要: https://atcoder.jp/contests/abc412/tasks/abc412_e #include <bits/stdc++.h> #define int long long using namespace std; const int N =1e6 + 10; const int 阅读全文
posted @ 2025-08-08 22:44 下头小美 阅读(8) 评论(0) 推荐(0)