基础算法
文章平均质量分 52
1
梦忆晴天
暖心向阳
展开
专栏收录文章
- 默认排序
- 最新发布
- 最早发布
- 最多阅读
- 最少阅读
-
Sasha and a Bit of Relax K倍区间 (前缀和异或 前缀和计数 思维)
(29条消息) CodeForces - 1109A Sasha and a Bit of Relax(思维+异或和,好题)_Frozen_Guardian的博客-优快云博客 Sasha and a Bit of Relax - CodeForces 1109A - Virtual Judge (csgrandeur.cn) 题意:思路:很容易想到前缀和,且这是一道计数题,不需要知道具体的每对情况,所以这里我选择考虑以区间右端点来记录每一种情况,想要构成r-l+1为偶数,那么区间的左右端点必然是同奇.原创 2022-05-27 09:49:55 · 192 阅读 · 0 评论 -
k-Multiple Free Set(set 二分)
k-Multiple Free Set - CodeForces 274A - Virtual Judge (csgrandeur.cn) 题意:给你一个数组和一个值k,定义一个集合表示的是一组整数,其中没有一个整数等于另一个整数乘以k,求这个整数的最大数量。 思路:集合里如果有x,一定不能有k倍的x。 解法1:set #include<bits/stdc++.h> #define int long long using namespace std; const int N=1e5+1原创 2022-05-10 12:13:04 · 250 阅读 · 0 评论
分享