second 140e abc sum

abc072d <贪心>

[D - Derangement](https://atcoder.jp/contests/abc072/tasks/arc082_b) ``` // https://atcoder.jp/contests/abc072/tasks/arc082_b // // 令0表示p[i]!=i, 1表示p[ ......
072d abc 072 lt gt

abc071d <递推>

[D - Coloring Dominoes](https://atcoder.jp/contests/abc071/tasks/arc081_b) ``` // https://atcoder.jp/contests/abc071/tasks/arc081_b // #include #inclu ......
071d abc 071 lt gt

abc070d <简单树上dfs>

[D - Transit Tree Path](https://atcoder.jp/contests/abc070/tasks/abc070_d) ``` // https://atcoder.jp/contests/abc070/tasks/abc070_d // #include #inclu ......
070d abc 070 dfs lt

abc069d <构造>

[D - Grid Coloring](https://atcoder.jp/contests/abc069/tasks/arc080_b) ``` // https://atcoder.jp/contests/abc069/tasks/arc080_b // #include #include # ......
069d abc 069 lt gt

abc068d <思维 + 构造>

[D - Decrease (Contestant ver.)](https://atcoder.jp/contests/abc068/tasks/arc079_b) 逆向构造(操作)思维 ~ ``` // https://atcoder.jp/contests/abc068/tasks/arc07 ......
思维 068d abc 068 lt

【计数,DP】ABC306Ex Balance Scale

[Problem Link](https://atcoder.jp/contests/abc306/tasks/abc306_h) 现在有 $n$ 个球,每个球有一个重量,重量未知。接下来会进行 $m$ 次称重,每次给定 $a_i$ 和 $b_i$,比较这两个球的重量,结果可能是 $>,=, 点击查 ......
Balance Scale ABC 306 Ex

abc067d <博弈 + dfs>

[D - Fennec VS. Snuke](https://atcoder.jp/contests/abc067/tasks/arc078_b) ``` // https://atcoder.jp/contests/abc067/tasks/arc078_b // // 关键点: 双方的最优策略一 ......
067d abc 067 dfs lt

abc066d <组合>

[D - 11](https://atcoder.jp/contests/abc066/tasks/arc077_b) ``` // https://atcoder.jp/contests/abc066/tasks/arc077_b // // 总组合数减去重复部分 // 对于本题求组合数方法: / ......
066d abc 066 lt gt

abc065d <贪心+最小生成树> [lambda表达式]

[D - Built?](https://atcoder.jp/contests/abc065/tasks/arc076_b) ``` // https://atcoder.jp/contests/abc065/tasks/arc076_b // 贪心+最小生成树 // 关键在于意识到, 连接x或y ......
表达式 lambda 065d abc 065

abc309e <dfs>

[E - Family and Insurance](https://atcoder.jp/contests/abc309/tasks/abc309_e) ``` // https://atcoder.jp/contests/abc309/tasks/abc309_e // // 关键在于意识到, ......
309e abc 309 dfs lt

abc309f <线段树 + 离散化 + 双指针>

[F - Box in Box](https://atcoder.jp/contests/abc309/tasks/abc309_f) ``` // https://atcoder.jp/contests/abc309/tasks/abc309_f // [unique + lower_bound ......
线段 指针 309f abc 309

ABC276F

设 $b_x$ 表示第 $x$ 次操作的期望权值,由题意可得: $$b_x=x^{-2}\times \sum\limits_{1 \leq i,j \leq x}\max(a_i,a_j)$$ 前面的部分可通过求逆元直接获得。设后面那部分为 $c_x$,递推计算 $c_x$ 的值,只需要计算新增添 ......
276F ABC 276

ABC276E

由于路径除起点外不能重复经过一点且需要回到起点,那么出发时和结束时一定会经过与起点 $\text{S}$ 相邻的不同的点。如果存在两个这样的点联通,那么就存在这样一条从起点出发返回起点的回路。 但题目中有对路径长大于等于 $4$ 的限制,可以发现走一个 $2\times2$ 的矩阵回到原点是满足条件 ......
276E ABC 276

[ABC200F] Minflip Summation

## 题意简述: 给定一个字符串 $S$ ($ 1\ \le\ |S|\ \le\ 10^5 $), $S$ 仅包含 $0$ , $1$ , $?$。将该字符串复制 $K$ ($ 1\ \le\ |K|\ \le\ 10^9 $) 遍,得到字符串 $S'$,$S'$ 中的 $?$ 可随意替换成 $0 ......
Summation Minflip 200F ABC 200

ABC309

## T1:[Nine](https://atcoder.jp/contests/abc309/tasks/abc309_a) 当 $A+1 = B$ 且 $A \% 3 = 1$ 时,说明 $A$ 和 $B$ 相邻 代码实现 ``` a, b = map(int, input().split()) ......
ABC 309

abc064d <贪心/前缀和>

[D - Insertion](https://atcoder.jp/contests/abc064/tasks/abc064_d) > [另一种做法](https://www.bilibili.com/read/cv24447317),注意这两种写法: >1. `max_element` >2. ......
前缀 064d abc 064 lt

abc063d <二分答案>

[D - Widespread](https://atcoder.jp/contests/abc063/tasks/arc075_b) 对二分答案的特点要敏感!!! ``` // https://atcoder.jp/contests/abc063/tasks/arc075_b // 二分答案 #i ......
答案 063d abc 063 lt

abc062d <优先队列>

[D - 3N Numbers](https://atcoder.jp/contests/abc062/tasks/arc074_b) [参考](https://blog.csdn.net/awow80285/article/details/101550652) ``` // https://atc ......
队列 062d abc 062 lt

AtCoder Grand Contest 058 D Yet Another ABC String

[洛谷传送门](https://www.luogu.com.cn/problem/AT_agc058_d "洛谷传送门") [AtCoder 传送门](https://atcoder.jp/contests/agc058/tasks/agc058_d "AtCoder 传送门") Orz H6_6Q ......
AtCoder Another Contest String Grand

[ABC218G] Game on Tree 2 树上游戏

# [ABC218G] Game on Tree 2 树上游戏 [TOC] ## 题面翻译 给定一棵树,以及树各节点的点权(点权为偶数)。起初有一个棋子在树的根结点(结点 $1$)处。 - $A$ 与 $B$ 两人轮流操作:将棋子移动到其所在节点的某个叶子节点。 - 到某个节点的得分定义为:棋子经过 ......
218G Game Tree ABC 218

CF1817E Half-sum

`greedy` 把数分成两个集合 $A,B$,且 $A 定理 $1$ > > $A$ 集合合并的顺序一定是从大往小的,$B$ 集合是从小往大的。 应该很好猜到,但是证明需要一点推导。 大概可以局部到 $x,y,z,w$ 四个数的情况。 几种情况分别是 $\frac{x+y}{8}+\frac{z} ......
Half-sum 1817E 1817 Half sum

多线程知识:三个线程如何交替打印ABC循环100次

本文博主给大家讲解一道网上非常经典的多线程面试题目。关于三个线程如何交替打印ABC循环100次的问题。 > 下文实现代码都基于Java代码在单个JVM内实现。 ## 问题描述 给定三个线程,分别命名为A、B、C,要求这三个线程按照顺序交替打印ABC,每个字母打印100次,最终输出结果为: ``` A ......
线程 三个 知识 ABC 100

ABC196E 题解

## 前言 [题目传送门!](https://www.luogu.com.cn/problem/AT_abc196_e) [更好的阅读体验?](https://www.cnblogs.com/liangbowen/p/17531887.html) 很有趣的题,取决于思考方向。 ## 思路 如果你一开 ......
题解 196E ABC 196

ARC107F Sum of Abs

# ARC107F Sum of Abs **[题目传送门——洛谷](https://www.luogu.com.cn/problem/AT_arc107_f)** **[题目传送门——AtCoder](https://atcoder.jp/contests/arc107/tasks/arc107_ ......
107F ARC 107 Sum Abs

[LeetCode] 2600. K Items With the Maximum Sum

There is a bag that consists of items, each item has a number 1, 0, or -1 written on it. You are given four non-negative integers numOnes, numZeros, n ......
LeetCode Maximum Items 2600 With

920 F. SUM and REPLACE

[toc] # F. SUM and REPLACE 题目[传送门](https://codeforces.com/contest/920/problem/F) ## 题意: 给你n个数,按照顺序排列,再进行m次操作。每次操作要么是问你区间[l,r]的和,要么是让你将区间[l,r]的所有数$a_i= ......
REPLACE 920 SUM and

[LeetCode] 2679. Sum in a Matrix

You are given a 0-indexed 2D integer array nums. Initially, your score is 0. Perform the following operations until the matrix becomes empty: From eac ......
LeetCode Matrix 2679 Sum in

elasticsearch group sum top 10

``` { "version": true, "size": 0, "sort": [ { "request_length": { "order": "desc", "unmapped_type": "boolean" } } ], "stored_fields": [ "*" ], "script ......
elasticsearch group sum top 10

ABC306F 题解

## [题目链接](https://www.luogu.com.cn/problem/AT_abc306_f) ## 题目大意 对于 $S_1 \cap S_2 = \emptyset$, 定义长度为 $|S_1|+|S_2|$ 的序列 $A$,为 $S_1\cup S_2$ 排序后的结果。 定义二 ......
题解 306F ABC 306

ABC306E 题解

## [题目链接](https://www.luogu.com.cn/problem/AT_abc306_e) ## 题目大意 维护一个数据结构,数列长度为 $n$,$q$ 次操作,每次操作修改一个位置上的值,每次操作后输出数列里前 $k$ 小的数的和($k$ 是给定的)。 $n,k,q\leq 5 ......
题解 306E ABC 306