线段codeforces version round

题解 P9993【[Ynoi Easy Round 2024] TEST_133】

就硬把 线段树 3 和 数列分块入门 2 揉到一起出。 维护原数组 \(a\) 及其历史最大值 \(hist\),对每个块,维护块内 \(a\) 升序排序后结果 \(p\)、块内 \(a\) 升序排序后历史最大值前缀和 \(prehist\)、块加标记 \(add\)、块历史和加标记 \(hista ......
题解 P9993 Round 9993 2024

codeforces刷题(1100):1904B_div2

B、Collecting Game 跳转原题点击此:该题地址 1、题目大意 获得一个由n位正整数组成的数组。你可以选择选择任意一个数作为你的判断值。然后任意一个 \(\le\) 它的数可以被选中加入你的分数(注意判断值不算在里面),同时该数被移除数组。你的任务是,对于该数组中的每个数,都将其作为判断 ......
codeforces B_div 1100 1904 div

LibreOJ#535. 「LibreOJ Round #6」花火

LibreOJ#535. 「LibreOJ Round #6」花火 \(n\) 个烟火排成一排,从左到右高度分别为 \(h_1,h_2,\cdots,h_n\),这些高度两两不同。 每次 Yoko 可以选择两个相邻的烟火交换,这样的交换可以进行任意多次。 每次 Yoko 还可以选择两个不相邻的烟火交 ......
LibreOJ Round 535

CodeForces 1917E Construct Matrix

洛谷传送门 CF 传送门 \(2 \nmid k\) 显然无解。 若 \(4 \mid k\),发现给一个全 \(2 \times 2\) 子矩形全部异或 \(1\) 不会对行异或和和列异或和造成影响。那么我们找到 \(\frac{k}{4}\) 个全 \(0\) 的 \(2 \times 2\) ......
CodeForces Construct Matrix 1917E 1917

codeforces刷题(1100):1905B_div2

B、Begginer's Zelda 跳转原题点击此:此题地址 1、题目大意 给你一个子树,你可任意选择两个节点\(u、v\),这两个节点之间的所有节点(包括\(u、v\))都将结合变为一个新的节点。要求你通过该操作将所有的节点变为只有一个节点,求最小的操作数。 2、题目解析 由题意可得:当\(u、 ......
codeforces B_div 1100 1905 div

CodeForces 1917F Construct Tree

洛谷传送门 CF 传送门 考虑形式化地描述这个问题。先把 \(l\) 排序。然后相当于是否存在一个 \(\{1, 2, \ldots, n\}\) 的子集 \(S\),使得: \(\sum\limits_{i \in S} l_i = d\)。 \(\exists T \subseteq S, \m ......
CodeForces Construct 1917F 1917 Tree

Codeforces Round 915 (div2) E

E. Tree Queries [题目链接](https://codeforces.com/contest/1904/problem/EProblem - E - Codeforces) 题意概括: 给定一棵大小为 \(n\) 的树,回答如下询问,询问之间相互独立: 给定一个点 \(x\) 与 \( ......
Codeforces Round div2 915 div

codeforces刷题(1100):1917B_div2

模板 B、Erase First or Second Letter 跳转原题点击此:该题地址 1、题目大意 给你一个字符串,可以执行任意次以下操作,生成最终的字符串(不可为空),问你能生成的不重复字符串数为多少。 操作一:删除字符串第一个字符; 操作二:删除字符串第二个字符。 2、题目解析 发现,操 ......
codeforces B_div 1100 1917 div

Codeforces 1909G - Pumping Lemma

这个题思考角度很多,做法也很多。这里介绍一种 @asmend 和我讲的做法。 设 \(d=m-n\),那么我们枚举 \(|x|=i,|y|=j\),设 \(s,t\) 的 LCP 长为 \(l_1\),LCS 长为 \(l_2\),那么可以得到这组 \((i,j)\) 合法的充要条件是: \(i\l ......
Codeforces Pumping 1909G Lemma 1909

Codeforces1917F - Construct Tree

Codeforces1917F - Construct Tree Problems 给一个长度为 \(n\) 的序列 \(l\) 和 \(d\)。 要求判断是否可以构造出一颗节点数为 \(n+1\) 的树,满足 \(l\) 的每一个元素唯一对应为一条边的长度,并使整棵树的直径长度恰好为 \(d\)。 ......
Codeforces Construct 1917F 1917 Tree

CodeForces 1906K Deck-Building Game

洛谷传送门 CF 传送门 UNR #2 黎明前的巧克力。 枚举两个人选的卡的并集 \(S\),那么当 \(\bigoplus\limits_{i \in S} a_i = 0\) 时 \(S\) 有贡献 \(2^{|S|}\)。 考虑将 \(2^{|S|}\) 分摊到每个元素上,也就是每个元素有 \ ......
Deck-Building CodeForces Building 1906K 1906

Windows 10, version 22H2 (updated Dec 2023) 中文版、英文版下载

Windows 10, version 22H2 (updated Dec 2023) 中文版、英文版下载 Windows 10 22H2 企业版 arm64 x64 请访问原文链接:https://sysin.org/blog/windows-10/,查看最新版。原创作品,转载请保留出处。 作者主 ......
英文版 中文版 Windows version updated

Windows 11 version 23H2 中文版、英文版 (x64、ARM64) 下载 (updated Dec 2023)

Windows 11 version 23H2 中文版、英文版 (x64、ARM64) 下载 (updated Dec 2023) Windows 11, version 23H2,2023 年 12 月更新 请访问原文链接:https://sysin.org/blog/windows-11/,查看 ......
英文版 中文版 Windows version updated

Windows 10 on ARM, version 22H2 (updated Dec 2023) ARM64 AArch64 中文版、英文版下载

Windows 10 on ARM, version 22H2 (updated Dec 2023) ARM64 AArch64 中文版、英文版下载 基于 ARM 的 Windows 10 请访问原文链接:https://sysin.org/blog/windows-10-arm/,查看最新版。原创 ......
英文版 ARM 中文版 Windows version

CF1909F1 Small Permutation Problem (Easy Version)

给定一个长度为 \(n\) 的数组 \(a\),其中 \(a_i \in [1, n]\),试计算满足以下条件的 \([1, n]\) 的排列 \(p\) 的个数: \(\forall i \in [1, n], \sum_{1 \le j \le i} [p_j \le i] = a_i\) \( ......
Permutation Problem Version 1909F Small

CF1909F2 Small Permutation Problem (Hard Version)

给定一个长度为 \(n\) 的数组 \(a\),其中 \(a_i \in [-1, n]\),试计算满足以下条件的 \([1, n]\) 的排列 \(p\) 的个数: \(\forall i \in [1, n], \text{有 }\sum_{1 \le j \le i} [p_j \le i] ......
Permutation Problem Version 1909F Small

Codeforces1917E - Construct Matrix

Codeforces1917E - Construct Matrix 首先考虑因为 \(n\) 为偶数,所以 \(k\) 为奇数时不可能满足条件。 其次,如果 \(4|k\),那么实际上在矩阵中一直放 \(2\times 2\) 的全为 \(1\) 的矩阵就可以了。 随后,如果 \(k \equiv ......
Codeforces Construct Matrix 1917E 1917

lazy线段树模板

import java.io.*; import java.util.*; public class Main { static int N = (int)1e5+10; static long[] arr = new long[N]; static long[] sum = new long[N< ......
线段 模板 lazy

Codeforces Round 917 (Div. 2)

基本情况 A题秒了,B题卡了一年。 B. Erase First or Second Letter Problem - B - Codeforces 卡题分析 两方面原因 没有变通,一开始的思路是公式算出总字串数再想办法找重复的减掉,但搞了一个小时都不可行,应该早点换成正着来找的思路。 没有更深入的 ......
Codeforces Round 917 Div

codeforces刷题(1100):1907C_div3

C、Removal of Unattractive Pairs 跳转原题点击此:[该题地址](Problem - 1907C - Codeforces) 1、题目大意 给定一个字符串,可以删除相邻的两个不相等的字符。问你删除后能得到最小的字符串长度为多少。 2、题目解析 因为只要两个不相等的字符相邻 ......
codeforces C_div 1100 1907 div

G2. Light Bulbs (Hard Version)

G2. Light Bulbs (Hard Version) The easy and hard versions of this problem differ only in the constraints on $n$. In the hard version, the sum of value ......
Version Bulbs Light Hard G2

CF contest 1909 Pinely Round 3 (Div. 1 + Div. 2) 题解(Vanilla的掉分赛)

[Pinely Round 3 (Div. 1 + Div. 2) - Codeforces](https://codeforces.com/contest/1909) $$ \color{purple}\large\textbf{世界上只有一种真正的英雄主义,} $$ $$ \color{red}... ......
题解 Div contest Vanilla Pinely

Pinely Round 3 (Div. 1 + Div. 2)

A 构造题,分两种情况考虑 上下都行,左右选一个 左右都行,上下选一个 void solve() { int n; cin >> n; vector<pair<int, int> > a(n); for(auto &t : a) cin >> t.x >> t.y; sort(a.begin(), ......
Div Pinely Round

线段树板子

package ICPC; import java.util.*; import java.math.*; import java.io.*; import java.text.DecimalFormat; import java.text.NumberFormat; class node{ int ......
线段 板子

CodeForces 1909D Split Plus K

洛谷传送门 CF 传送门 设最后每个数都相等时为 \(t\)。那么一次操作变成了合并两个数 \(x, y\),再增加 \(x + y - k\)。于是每个 \(a_i\) 可以被表示成 \(b_i t - (b_i - 1)k\) 的形式,化简得 \(a_i - k = b_i (t - k)\)。 ......
CodeForces 1909D Split 1909 Plus

CodeForces 1909E Multiple Lamps

洛谷传送门 CF 传送门 感觉这个题比较难蚌。 发现按 \(1 \sim n\) 最后可以把 \(1 \sim n\) 中的所有平方数点亮。所以 \(n \ge 20\) 就直接输出 \(1 \sim n\)。 考虑 \(n \le 19\)。猜测合法的方案(即按完后亮灯数 \(\le \left\ ......
CodeForces Multiple 1909E Lamps 1909

CodeForces 1909F2 Small Permutation Problem (Hard Version)

洛谷传送门 CF 传送门 感觉这个题还是挺不错的。 考虑 F1。考察 \(a_i\) 差分后的意义,发现 \(a_i - a_{i - 1}\) 就是 \((\sum\limits_{j = 1}^{i - 1} [p_j = i]) + p_i \le i\)。 考虑将其转化为棋盘问题。在 \(( ......

Pinely Round 3 (Div. 1 + Div. 2) A~D

A. Distinct Buttons // #include <bits/stdc++.h> #include <iostream> #include <string> #include <cstring> #include <vector> #include <algorithm> #inclu ......
Div Pinely Round

Pinely Round 3 (Div. 1 + Div. 2)

\(A.Distinct Buttons\) https://codeforces.com/contest/1909/submission/238508091 \(B.Make Almost Equal With Mod\) https://codeforces.com/contest/1909/s ......
Div Pinely Round

CF1883G2 Dances (Hard Version)

Problem - D2 - Codeforces Dances (Hard Version) - 洛谷 Hint1: 对于 \(C[i]\) 的答案上界和下界分别是多少? Hint1.1: 记 \(C[i]_1\) 时的答案 \(ans\),答案范围显然是 \([ans,ans+1]\) Hint ......
Version Dances 1883G 1883 Hard
共3000篇  :4/100页 首页上一页4下一页尾页