div 1870 div1 div2

Educational Codeforces Round 110 (Rated for Div. 2) Array Reodering

给一个长为 \(n\) 的数组 \(a\) 。 定义一对 \(pair(i, j)\) 是 \(good\) 的当且仅当 \(1 \leq i < j \leq n\) 且 \(gcd(a_i, 2 \cdot a_j) > 1\) 。 如果你可以以任意顺序重排数组 \(a\) ,找到最多的 \(g ......
Educational Codeforces Reodering Array Round

Codeforces Round 902 Div 1 (CF 1876)

A. Helmets in Night Light 按花费 sort 一下,\(b<p\) 就让他用 \(b\) 的花费告诉别人,剩下的人一开始用 \(p\) 的花费告诉即可。 B. Effects of Anti Pimples 发现一个数会被所有它的因数贡献,\(O(n\sqrt{n})\) 随 ......
Codeforces Round 1876 902 Div

Educational Codeforces Round 156 (Rated for Div. 2)

Educational Codeforces Round 156 (Rated for Div. 2) A. Sum of Three 解题思路: 如果\(n \leq 6 或 n =9\),无解。 若\(n \% 3 == 0,t = \lfloor\frac{3}{n}\rfloor\): 若\ ......
Educational Codeforces Round Rated 156

Codeforces Round 902 (Div. 2, based on COMPFEST 15 - Final Round)

目录写在前面ABCDE写在最后 写在前面 比赛地址:https://codeforces.com/contest/1877。 呜呜铃果唱歌太好听了、、、 我宣布是第二喜欢的声线,第三喜欢是东北切蒲英,第一喜欢绝赞招募中。 这下不得不成为数码推了、、、 A 答案为 \(-\sum a_i\)。 懒得写 ......
Round Codeforces COMPFEST Final based

Codeforces Round 891 (Div. 3) F. Sum and Product(数论+map)

Codeforces Round 891 (Div. 3) F. Sum and Product 思路:对于x,y:ai+aj=x —> aj=x-ai 因此 ai*(x-ai) = y ——> ai = (x 土 sqr( x^2 - 4y ) ) /2 对应的 ai 就是要的两个值 若两个值不同 ......
数论 Codeforces Product Round 891

Educational Codeforces Round 152 (Div. 2) D. Array Painting(双指针)

Educational Codeforces Round 152 (Div. 2) D. Array Painting //思路:双指针找连续正数段 //若段中出现2,则更新两头的0的情况,若为涂色则改为true //若无2,则优先更新左侧0,若左0已经为true,则更新右侧0 //数组开头结尾特判 ......
指针 Educational Codeforces Painting Array

练习记录-cf-Educational Codeforces Round 156 (Rated for Div. 2)(A-C)

好久没打了 还是就出了三道 不过还好没掉分 A. Sum of Three 就是问能不能把一个数拆成三个不同的 且都不能被三整除的数 我的思路就是拆成1+2+一个大于等于4的数 如果拆了后另一个数是%3==0 那么我拆成1+4它肯定就不被整除 然后判下相同 #include<bits/stdc++. ......

Codeforces Round 902 (Div. 2) C. Joyboard 规律

Codeforces Round 902 (Div. 2) C. Joyboard //思路:在k=1,k=2,k=3 时有解 //当 k=1 时为全0 //当 k=2 时,若 m>=n,则先是 0 然后为 1~n,最后一位可以为n的倍数也符合,即n+m/n-1 //若m<n则为 1~m 即 m / ......
Codeforces Joyboard 规律 Round 902

CSS 将div撑满body

<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <title>测试</title> <style> html, body { height: 100%; margin: 0; overflow: hidden; } .co ......
body CSS div

Codeforces Round 726 (Div. 2) B. Bad Boy

给一个 \(n \times m\) 的平面,一个初始位置 \((i, j)\) 。 需要放两个废弃物在平面上,位置为 \((x_1, y_1), (x_2, y_2)\) 。 使得从 \((i, j)\) 出发,捡起两个废弃物后,回到原位置,所经过的曼哈顿距离最长。 询问一组合法的 \((x_1, ......
Codeforces Round 726 Bad Boy

Codeforces Round 902 (Div. 2, based on COMPFEST 15 - Final

Codeforces Round 902 (Div. 2, based on COMPFEST 15 - Final A. Goals of Victory 解题思路: 答案为所有元素之和的负数。 代码: #include <bits/stdc++.h> using namespace std; u ......
Codeforces COMPFEST Round Final based

Codeforces Round 902 (Div. 2, based on COMPFEST 15 - Final Round)

Preface 难得这么好时间的CF,我直接找来队友组队练题 当然比赛的过程没有三人三机,就跟平时训练一样搞了个新号三人一机的写 中间因为溜去先看F了导致E题留给徐神solo因此出的偏慢,不过后面一起讨论了一下还是出了 最后开F结果好家伙我和祁神双双看错题,对着假题意苦战1h最后无奈投降,今天去再看 ......
Round Codeforces COMPFEST Final based

Codeforces Round 902 (Div. 2, based on COMPFEST 15 - Final Round)

比赛连接 打着打着吃饭去了,又掉分了! A. Goals of Victory 题意: 一场比赛有n个球队,每一个队伍匹配一次,球队的效率等于球队的得分数减去对手的得分数,给出n-1个数据,让你求出未给出的那个数据。 思路: 所有球队的效率和为0 代码: #include<bits/stdc++.h ......
Round Codeforces COMPFEST Final based

CF1877 Div2 A-E 题解

A 显然 \(n\) 个队的得分之和为 \(0\),因此答案为这 \(n-1\) 个数的和的相反数。 赛时代码 B 小贪心。 将所有人按 \(b\) 升序排序,\(b\) 相同时按 \(a\) 降序,对每个人按 \(b\) 进行分类讨论: 若 \(b< p\),那么我们一定要选这个人,因为选了这个人 ......
题解 1877 Div2 A-E Div

Codeforces Round 730 (Div. 2) A. Exciting Bets

给两个正整数 \(a, b\) ,可以执行以下操作之一任意次: \(a = a + 1, b = b + 1\) 。 \(a = a - 1, b = b - 1\) 。 需要保证 \(min(a, b) \geq 0\) 。 询问 \(gcd(a, b)\) 最大是多少,且到达最大 \(gcd(a ......
Codeforces Exciting Round Bets 730

Codeforces Round 902 (Div. 1, based on COMPFEST 15 - Final Round) A~D

A. Helmets in Night Light 首先注意到一个关键性质 \(b_i \geq 1\),这就意味着当我们花 \(p\) 的代价解锁了 \(b_i\) 最小的后,仅凭接下来的“连锁反应”就能解锁全部的点。注意到我们“连锁反应”的一定是按 \(b_i\) 从小到大排序后的一段前缀(因为 ......
Round Codeforces COMPFEST Final based

Codeforces Round 902 (Div. 2) (CF1877) B、C、D 题解

B 题目大意 你要传话给 \(n\) 个人,每传一下话需要花费 \(p\) ,当一个人被传话后,他可以最多传给 \(a_i\) 个人,每次花费 \(b_i\) 。问把话传给 \(n\) 个人的最小花费。 分析 首先传给第一个人只少要 \(p\) 下来贪心,每次让花费最小、且能够传话的人去传话。 考虑 ......
题解 Codeforces Round 1877 902

Codeforces Round 902 Div. 2 - A B C D

目录A. Goals of VictoryB. Helmets in Night Light 传送门 A. Goals of Victory 对给定 n - 1 组队伍的净得分求和取负即为最后一组队伍的净得分 B. Helmets in Night Light 赛时想法假了,赛后更正 对所有人按照传 ......
Codeforces Round 902 Div

Codeforces Round #902 (Div.1)

A 注意到 \(a_i\ge 1\),因此我们先花 \(p\) 的代价买下 \(b\) 最小的,然后一定可以一直用当前可能的最小代价买下后续的人。不难发现这一定是最优的方案。 只需要将序列排序或者用 std::multiset 来维护。单组数据时间复杂度 \(O(n\log n)\)。 https: ......
Codeforces Round 902 Div

实现拖拽整个div到另外一个div中

实现拖拽整个div到另外一个div中 来自你的消息: vue3代码实现div内容拖拽到另外一个siv中 来自WeTab AI的消息: 在Vue 3中,你可以使用Vue的指令和事件处理器来实现将<div>内容拖拽到另一个<div>中。以下是一个使用Vue 3和原生HTML Drag & Drop AP ......
div

Codeforces Round 901 (Div. 2) D. Jellyfish and Mex (DP)

Codeforces Round 901 (Div. 2) D. Jellyfish and Mex //思路:对于大于mex的数不做处理,把0删完为结束 //dp[j]为mex更新到j所需要的最小花费 //用mex=i时更新到j,转移方程为 dp[j] = min(dp[j], dp[i] + i ......
Codeforces Jellyfish Round 901 Div

Codeforces Round 900 (Div. 3) E. Iva & Pav (位运算)

Codeforces Round 900 (Div. 3) E. Iva & Pav //思路:10^9转换为2^32上的位,进行位运算,a[x][i]为到x为止第i位的1个数前缀和 //对于与运算,如果当前i的前缀和不为 r-l+1 ,则这一位的与运算结果为0 //当找到从左往右第一个位置i为1 ......
Codeforces Round 900 Div Iva

Codeforces Round 901 (Div. 2) C. Jellyfish and Green Apple (位运算)

Codeforces Round 901 (Div. 2) C. Jellyfish and Green Apple //思路:浮点数转二进制,a/b的结果为 gcd(a,b)*最简分式(n/m)的结果 //苹果能分的前提是人数得是一个2的次幂数,通过切割只能分为形同0.001的二进制小数 //a/ ......
Codeforces Jellyfish Apple Round Green

Vue3 Div 与 v-for 的配合应用,超出自动带滚动条

效果图 代码 <li > <a href="javascript:;" class="IndRea flexC Huans"><i></i><p>当前会议 [ 0 ]</p></a> <div style="height:80%;overflow:auto;"> <div v-for="(dataI ......
v-for Vue3 Vue Div for

「题解」Codeforces Round 883 (Div. 3)

A. Escalator Conversations Problem [题目](Rudolph and Cut the Rope) Sol & Code 绳子长度大于钉子高度的要剪 #include <bits/stdc++.h> typedef long long ll; int min(int ......
题解 Codeforces Round 883 Div

「题解」Codeforces Round 888 (Div. 3)

A. Escalator Conversations Problem 题目 Sol & Code 签到 #include <bits/stdc++.h> typedef long long ll; int min(int a, int b) { return a < b ? a : b; } int ......
题解 Codeforces Round 888 Div

10.5 Codeforces Round 638 (Div. 2)

Codeforces Round 638 (Div. 2) A - Phoenix and Balance 思路:加的数成等比关系,且第n项大于前n-1项的和,那么最大的一项加上最小的几个即可 #include<bits/stdc++.h> using namespace std; #define ......
Codeforces Round 10.5 638 Div

「题解」Codeforces Round 891 (Div. 3)

A. Array Coloring Problem 题目 Sol & Code 只有数列的和为偶数时才符合要求,即有任意个偶数,偶数个奇数。 将这些数分成两部分,发现两部分初始值 \(0\) 为偶数,偶数不会影响奇偶性,故需要偶数个奇数。 #include <bits/stdc++.h> #defi ......
题解 Codeforces Round 891 Div

CF1249(Div. 3) 题解(A to D)

\(\texttt{E F}\) 忘(不)记(会)写了。 A Yet Another Dividing into Teams 题解 题目大意 有一个长度为 \(n\) 的序列 \(a_1,a_2,\cdots,a_n\),将他们分为若干组,使得每一组没有两个数的差为 \(1\),使分的组数尽可能少。 ......
题解 1249 Div CF to

Codeforces Round 901 (Div. 2) - A B

目录A. Jellyfish and UndertaleB. Jellyfish and Game 题目传送门 A. Jellyfish and Undertale 贪心考虑每次时间减到 1 时能否使用工具加时间,注意总时间上限是 a B. Jellyfish and Game 贪心考虑美每位选手肯 ......
Codeforces Round 901 Div