摘要:
jiangly的板子 // 取模机 // using i64 = long long; template<class T> constexpr T power(T a, i64 b) { T res {1}; for (; b; b /= 2, a *= a) { if (b % 2) { res 阅读全文
摘要:
AtCoder Beginner Contest 363 前言 只出了三题,被 d 卡住了,事实上 e 题应该对我而言更简单,没及时换题。 A - Piling Up (atcoder.jp) 思路 代码 #include<bits/stdc++.h> using namespace std; us 阅读全文
摘要:
2024牛客暑期多校训练营2 E-GCD VS XOR_2024牛客暑期多校训练营2 (nowcoder.com) 题意 给定 x,构造 y < x 使得 gcd(x, y) = x ⊕ y 思路 取 x − lowbit(x) 即可,如果 x 是 2 的整数次幂则无解。 代码 #include<b 阅读全文
摘要:
取分块大小 \(n^\frac{2}{3}\) 最优。 例题:数颜色 #include<bits/stdc++.h> using namespace std; using i64 = long long; const int N = 1e6 + 5; int cnt[N], a[N]; struct 阅读全文