codeforces inequality satisfying another
CF1020 Codeforces Round 503 (by SIS, Div. 2)
CF1020A New Building for SIS 分类讨论 \(a,b\) 两个端点的几种情况就好了,特判 \(t_a=t_b\) 的情况。 #include<iostream> #include<cstdio> #include<cmath> #include<algorithm> usi ......
CF1036 Educational Codeforces Round 50 (Rated for Div. 2)
CF1036A Function Height 答案为 \(\lceil \frac{k}{n}\rceil\)。 #include<iostream> #include<cstdio> using namespace std; long long n,k; int main() { scanf(" ......
CF1072 Codeforces Round 517 (Div. 2, based on Technocup 2019 Elimination Round 2)
CF1072A Golden Plate 第 \(i\) 个矩形的周长为 \(2(w - 4(i - 1))+2(h - 4(i - 1))-4\),枚举 \(i\) 求和。 #include<iostream> #include<cstdio> using namespace std; int n ......
CF1079 Codeforces Round 522 (Div. 2, based on Technocup 2019 Elimination Round 3)
CF1079A Kitchen Utensils 令 \(c_i\) 表示餐具 \(i\) 出现的数量,最小的餐具套数为 \(t=\lceil \frac{\max\{c_i\}}{k}\rceil\),按照这个计算就好了。 #include<iostream> #include<cstdio> # ......
CF1162 Codeforces Round 557 (Div. 2) [based on Forethought Future Cup - Final Round]
CF1162A Zoning Restrictions Again 每个位置越高越好,暴力模拟即可。 #include<iostream> #include<cstdio> using namespace std; const int N=55; int n,h,m; int a[N]; int m ......
CF957 Codeforces Round 472 (rated, Div. 2, based on VK Cup 2018 Round 2)
CF957A Tritonic Iridescence 如果原序列中有两个相同的字符,显然不合法。 如果开头或者结尾为 ?,或者有两个连续的 ?,或者一个 ? 两边的字符不同显然合法。 否则一定不合法。 #include<iostream> #include<cstdio> using namesp ......
CF992 Codeforces Round 489 (Div. 2)
CF992A Nastya and an Array 答案为非零数的个数。 #include<iostream> #include<cstdio> #include<map> using namespace std; const int N=100005; int n; int a[N]; map< ......
CF996 Codeforces Round 492 (Div. 2) [Thanks, uDebug!]
CF996A Hit the Lottery 直接贪心尽可能的分配到 \(k_5\),剩下的依次分配给 \(k_4,k_3,k_2,k_1\)。 #include<iostream> #include<cstdio> using namespace std; int n; int k[6]; int ......
Codeforces Round 900 (Div. 3) - A B C D E
目录A. How Much Does Daytona Cost?B. Aleksa and Stack A. How Much Does Daytona Cost? 判断数 k 包不包含在数组里面即可 B. Aleksa and Stack 选定初始数为2, 3,后面的遍历 法二:全奇数即可,因为奇 ......
[题解] Codeforces Round 900(Div.3) E~F
Codeforces Round 900(Div.3) E~F E. Iva & Pav 因为按位与的结果不会随着越多数字的增加而增加,因此我们可以利用这个性质二分出右端点,只需要一个可以查询区间的数据结构即可。 或者是按位考虑第 \(i\) 个数字的第 \(k\) 位,后缀最近的 \(0\) 的位 ......
Redis可视化工具:Another Redis Desktop Manager
Redis可视化工具:Another Redis Desktop Manager 一、介绍 Another Redis Desktop Manager(简称:RedisDesktopManager或RDM)是一个Redis数据库的可视化管理工具。它是一个跨平台的桌面应用程序,能够让用户更轻松地与Re ......
Codeforces Round 900 (Div. 3)
昨天晚上生病,没比(血亏) A: 就是看k有没有在序列里 B: 随便放一个大的号码然后加 i,应该就可以过了 C: 就是我们最少要拿 k*(k+1)/2, 最多可以拿 k*(n+n-k+1)/2。 啊,你问我怎么证明在这两个值里就一定可以拿到(当然是猜的!!) D: 让f[x]表示当前出了多少次。然 ......
Codeforces Round 742 Div2 A-D题解
Codeforces Round 742 Div2 A-D题解 A. Domino Disaster 这题就是说给出一些2x1 tile,然后给出2xn的第一行构造,问第二行 这个刚开始想着是啥dp,一看那么多人过了果断改思路,发现这题就是个模拟题,就是把U换成D,D换成U,L和R不影响,然后输出就 ......
Codeforces Round 899 (Div. 2)
Preface 好久没现场打CF了(玩CC玩的.jpg),但这场久违的打的还不错,把Kusanagi_Misuzu这个小号也打上橙了 虽然开场的时候状态不佳写的巨慢,但后面还是靠着ztc带我做出E1成功题数反超上大分 接下来要考虑启动第三个小号了,只敢打Div2的FW是这样的 A. Increasi ......
Codeforces Round 738 (Div. 2) A. Mocha and Math
给一个数组 \(a_1, a_2, \cdots, a_n\) 。可以执行以下操作任意次: 选择 \(l, r (1 \leq l < r \leq n)\) ,对于任意 \(l \leq i \leq r\) ,同时执行所有 \(a_{l + i} = a_{l + i} \& a_{r - i} ......
Codeforces Round 899 (Div. 2) 记录
Codeforces Round 899 (Div. 2) A. Increasing Sequence 点击查看代码 #include<bits/stdc++.h> using namespace std; const int maxn=105; int t,n; //map<int,bool> ......
Codeforces Round 898 (Div. 4)
这是我的vp,不是正真的contest. A: 不想多说,读者应该可以做到的!!! B: 让g=product(移除掉0的a): 如果有多过1个0答案肯定是0。 如果只是有1个0答案就是g。 没有0,答案就是max(g/a[i]*(a[i]+1)) 任何 i。 C: 没有仔细想那个profit的fo ......
Codeforces Round 899 (Div. 2)
赛后四题 B题直接枚举不存在的元素即可 C题的trick有点像之前abc的某道题,对于奇数位置它一定可以贡献,对于偶数位置,如果它有数选了,那么它就能够贡献。 \(f[i]\)表示到前i个且至少选了一个的最大答案。 #include<cstdio> #include<algorithm> #incl ......
Codeforces Round 738 (Div. 2) B. Mocha and Red and Blue
给一个字符串,包含字符 \(B\) , \(R\) ,\(?\) 。其中 \(?\) 可能为 \(B\) 或 \(R\) 。 规定不完美数为字符串中相同字符连续出现的次数,询问一个字符串的最少可能不完美数。 观察到 \(BR\) 或 \(RB\) 需要尽可能多,于是考虑尽可能让相邻字符不同。 容易证 ......
Codeforces Round 750 (Div. 2) B. Luntik and Subsequences
给一个数组 \(a_1, a_2, \cdots, a_n\) ,定义 \(s = \sum_{i = 1}^{n} a_i\) 。 询问有多少个 \(a\) 的子序列满足 \(\sum a_{i_k} = s - 1\) 。 显然要选出一个 \(1\) 不加入子序列,任意一个 \(0\) 可以加入 ......
ERROR: Could not find a version that satisfies the requirement selunium (from versions: none)
错误信息 ERROR: Could not find a version that satisfies the requirement selenium (from versions: none) ERROR: No matching distribution found for selenium ......
Codeforces Round 899 (Div. 2)
Codeforces Round 899 (Div. 2) A. Increasing Sequence 解题思路: 从左往右一个个看,从1开始,如果当前位相同\(+2\),否则\(+1\)。 代码: #include <bits/stdc++.h> using namespace std; usi ......
Educational Codeforces Round 155 D (CF1879_D)
题目大意 给一个长度为 \(n\) 的数组,求 \(\Sigma_{i=1}^{n} \Sigma_{j=i}^{n} 区间异或和 \times (j-i+1)\) 其中 \(n\leq 3e5,~a[i]\leq 1e9\) 分析 首先注意到由 \(l\) 到 \(r\) 的区间异或和可以转化为 ......
Codeforces Round 898 (Div. 4)
A. Short Sort #include<bits/stdc++.h> using namespace std; int main() { ios::sync_with_stdio(0), cin.tie(0); int t; cin >> t; for( string s ; t ; t -- ......
Educational Codeforces Round 155 (Rated for Div. 2)
Educational Codeforces Round 155 (Rated for Div. 2) A. Rigged! 解题思路: 若存在\(s[i] >= s[1]\)并且\(e[i] >= e[i]\),那么答案为\(-1\). 否则,答案为\(s[1]\). 代码: #include < ......
Educational Codeforces Round 155 (Rated for Div. 2)
比赛链接 A. Rigged! 题目链接 就是一个比较简单的模拟就可以解决,如何判断能不能第一只需要考虑比他力量大的耐力是不是也比他大就行,而只要比他大,他就不可能第一,否则输出他的力量作为标杆就行,这样也可以避免比他力量小的也可以举起来。 #include<bits/stdc++.h> using ......
Codeforces463-E.Team Work-组合数、DP
Codeforces463-E.Team Work 题意:求 \[\sum_{i=1}^n \binom{n}{i} i^k \]其中\(1\leq n\leq 10^9\),\(1\leq k \leq 5000\)。 题解: 其实这个题\(k\)的数据范围就已经暗示了做法的复杂度——应该是要去考 ......
她是 Codeforces 第四名,也是知名视频平台bilibili的“网红”
在2023年9月24日~9月25日举办的Educational Codeforces Round 155 (Rated for Div. 2)上,以优秀成绩拿下第四名仅学了ACM一年的Nanani,成为最夺目的选手之一。 而且虽然是仅学了一年的选手,但她取得优异成绩后,不少网友并不感到陌生,纷纷留言 ......
Codeforces Round 895 (Div. 3) 题解集
CF1872 题解集,包含 CF1872B The Corridor or There and Back Again,CF1872C Non-coprime Split,CF1872D Plus Minus Permutation。 ......
CodeForces 715E Complete the Permutations
洛谷传送门 CF 传送门 最小交换次数等于 \(n - \text{环数}\)。所以题目要我们统计把 \(p, q\) 补全成排列,连边 \(p_i \to q_i\),环数 \(= i\) 的方案数。 考虑把边根据 \(p_i, q_i\) 的是否已知状态分成四类: \(p \to q\) \(p ......