03 2023 档案
摘要:题目 https://codeforces.com/contest/1804/problem/D 题意 给 n 个长度为 m 的 01 字符串,m mod 4 = 0 把字符串切割成 m/2 个单个字符和 m/4 个连续的两个字符 切割后的字符串中存在 1 ,价值 +1 问最大切割价值和最小切割价值
阅读全文
摘要:题目 https://codeforces.com/problemset/problem/1054/D 题意 输入正整数 n(≤2e5) k(≤30) 和长为 n 的数组 a(0≤a[i]≤pow(2,k)-1)。 设 mask = (1<<k)-1,每次操作你可以把任意 a[i] 修改为 a[i]
阅读全文
摘要:模板题目 https://www.acwing.com/problem/content/907/ 题意是给一些区间,问至少取多少个点,让所有区间里至少有一个点 上面这个是区间选点的模板贪心 按照右端点排序,可以发现相邻的区间只有三种情况 $L_2 \leq L_1 \leq R_1 \leq R_2
阅读全文
摘要:题目 https://codeforces.com/contest/1379/problem/C 题意 输入 t(≤1e4) 表示 t 组数据。所有数据的 m 之和 ≤1e5。 每组数据输入 n(≤1e9) m(≤1e5) 表示有 m 种物品,每种物品有无限个,你需要选择 n 个。 然后输入 m 行
阅读全文
摘要:#include <bits/stdc++.h> #define debug1(a) cout << #a << '=' << a << endl; #define debug2(a, b) cout << #a << " = " << a << " " << #b << " = " << b <<
阅读全文
摘要:题目 https://leetcode.cn/problems/number-of-ways-to-earn-points/description/?orderBy=most_votes https://codeforces.com/problemset/problem/148/E 题意(仅第二题)
阅读全文
摘要:题目 https://codeforces.com/problemset/problem/219/D https://leetcode.cn/problems/count-number-of-possible-root-nodes/ https://leetcode.cn/problems/mini
阅读全文
摘要:## 题目 - https://leetcode.cn/problems/triples-with-bitwise-and-equal-to-zero/description/?orderBy=most_votes ## 思路 - *[参考灵神题解,非常易懂,总结一些方法](https://leet
阅读全文
摘要:题目 https://codeforces.com/problemset/problem/1554/C 题意 输入 t(≤3e4) 表示 t 组数据,每组数据输入两个整数 n 和 m,均在 [0,1e9] 范围内。 定义数组 a = [n xor 0, n xor 1, n xor 2, ...,
阅读全文