atcoder equal 100d arc

Atcoder Beginner Contest 301

*** ### A - [Overall Winner](https://atcoder.jp/contests/abc301/tasks/abc301_a) #### 题目大意 >A和T两人玩游戏, 给定一串只由A和T组成的字符串, 如果第i个字符是A, 则A赢得第i轮的胜利, 反之则T赢; 当遍 ......
Beginner Atcoder Contest 301

AtCoder Beginner Contest 278 ABCDE

# [AtCoder Beginner Contest 278](https://atcoder.jp/contests/abc278) ## A - Shift ### Problem Statement 题意:给你一个长度为n的序列,让你移走前面k个后面补k个0。 ### Solution 思路 ......
Beginner AtCoder Contest ABCDE 278

UNIQUE VISION Programming Contest 2023 New Year (AtCoder Beginner Contest 287) ABCDE

# [UNIQUE VISION Programming Contest 2023 New Year (AtCoder Beginner Contest 287)](https://atcoder.jp/contests/abc287) ## A - Majority ### Problem Sta ......
Contest Programming Beginner AtCoder UNIQUE

AtCoder Beginner Contest 284 ABCDE

# [AtCoder Beginner Contest 284](https://atcoder.jp/contests/abc284/tasks) ## A - Sequence of Strings ### Problem Statement 题意:给你n个字符串,让你倒序输出 ### Solv ......
Beginner AtCoder Contest ABCDE 284

Atcoder-AGC033C

看到这道题,是个博弈论,没见过树上的,于是想到在数列里的博弈论,又联想到树的特殊形式————链。 于是我们来讨论一下链的情况(对于没有硬币的点,我们就视为它被删掉了): 讨论链的情况 发现若是选择两端的点,顶点数会减一;若是选择中间的点,顶点数会减二。 现在我们站在链的角度来思考在树上选择的情况,一 ......
Atcoder-AGC Atcoder AGC 033

AtCoder Beginner Contest 302

*** ### A - [Attack](https://atcoder.jp/contests/abc302/tasks/abc302_a) #### 题目大意 >给定两个数a和b, 问我们需要进行多少次a-b, 才能让a小于等于0 #### 解题思路 >签到题不多嗦了 #### 神秘代码 ``` ......
Beginner AtCoder Contest 302

AtCoder Beginner Contest 218 H Red and Blue Lamps

[洛谷传送门](https://www.luogu.com.cn/problem/AT_abc218_h "洛谷传送门") [AtCoder 传送门](https://atcoder.jp/contests/abc218/tasks/abc218_h "AtCoder 传送门") wqs 二分。 设 ......
Beginner AtCoder Contest Lamps Blue

AtCoder Beginner Contest 305 题解

https://atcoder.jp/contests/abc305/tasks_print # E - Art Gallery on Graph 冷知识:md 这题赛时没做出来 /cy 刚看到题:这是什么题啊,$K, h$ 都 $1e5$ 能做吗 /fn 确实能做。 考虑类似 SPFA 的操作。 ......
题解 Beginner AtCoder Contest 305

AtCoder Beginner Contest 258 F Main Street

[洛谷传送门](https://www.luogu.com.cn/problem/AT_abc258_f "洛谷传送门") [AtCoder 传送门](https://atcoder.jp/contests/abc258/tasks/abc258_f "AtCoder 传送门") 发现这题有个远古的 ......
Beginner AtCoder Contest Street Main

AtCoder Beginner Contest 305

## [A - Water Station (abc305 a)](https://atcoder.jp/contests/abc305/tasks/abc305_a) ### 题目大意 给定一个数字$x$,输出一个数字,它是最接近$x$的 $5$的倍数。 ### 解题思路 令$y = x \% 5 ......
Beginner AtCoder Contest 305

Codeforces 1188D Make Equal

设最终所有数变为的值为 $u$,$\operatorname{bitcount}(x)$ 为 $x$ 二进制上为 $1$ 的位数,由题可得答案即为 $\sum\limits_{i = 1}^n \operatorname{bitcount}(u - a_i)$。 此时让 $a_i$ 从小到大排序,答 ......
Codeforces 1188D Equal 1188 Make

ATCoder [ABC167D] Teleporter

# 题目解析 这段代码的目标是处理一个含有 $n$ 个元素的整数序列,根据一定的规则,重复操作 $k$ 次后,确定操作结束时位于序列哪个位置。 ## 解题思路 1. **读取输入**:首先,我们读取输入的整数 $n$ 和 $k$ ,以及整数序列 `a`。我们需要对序列的每个元素减一,以适应从 0 开 ......
Teleporter ATCoder 167D ABC 167

AtCoder Beginner Contest 290 Ex Bow Meow Optimization

[洛谷传送门](https://www.luogu.com.cn/problem/AT_abc290_h "洛谷传送门") [AtCoder 传送门](https://atcoder.jp/contests/abc290/tasks/abc290_h "AtCoder 传送门") 考虑观察答案形态。 ......
Optimization Beginner AtCoder Contest Meow

Atcoder ARC100D Equal Cut

发现是 $3$ 个断点且数据范围的 $n\le 2\times 10^5$,根据 2022CSP-S A 留下的心理阴影不难想到可以枚举中间的那个点的同时移动左右两个端点。 考虑如何移动,已知现在在枚举中间的断点 $i$,则现在被分为了两部分 $1\sim i$ 和 $i\sim n$,因为要使极差 ......
Atcoder Equal 100D ARC 100

Atcoder ABC221G Jumping sequence

发现这个 $(x, y)$ 对应的是曼哈顿距离不太好求,那直接逆时针旋转 $45$ 度(其实应该还要伸长 $\sqrt{2}$ 倍,但是可以当做 $d_i$ 也伸长 $\sqrt{2}$ 倍不用去管)转化成切比雪夫距离 $(x - y, x + y)$。 同时对应的 $4$ 个方向在旋转后对应的方向 ......
sequence Atcoder Jumping 221G ABC

题解:【CF1610I】 Mashtali vs AtCoder

[题目链接](https://www.luogu.com.cn/problem/CF1610I) 从 $k = 1$ 开始考虑,即为[这道题](https://www.luogu.com.cn/problem/AT_agc017_d)。 > 记点 $u$ 的 SG 函数为 $f_u$,$v$ 为点 ......
题解 Mashtali AtCoder 1610I 1610

Atcoder ABC221F Diameter set

不难。 第一步肯定是求出直径 $d$。 然后能发现 $d\bmod 2 = 0$ 时很好求。 可以先任意找到一条直径,再找到这个直径的中点,则容易知道以这个中点为根,其中的每个子树的节点与中点经过的边数最大值为 $\frac{d}{2}$。 所以能够得到每个子树内选两个点距离最大值也为 $d - 2 ......
Diameter Atcoder 221F ABC 221

ARC132E

由于一旦走到头那么这一个后缀/前缀就一定是对应的颜色,所以最终答案形如一段左脚印,一段保留原来的,一段右脚印。 保留原来的段一定是在两个洞之间的一段完整段,考虑枚举这个段,左脚印的数量是确定的,转化成算概率的问题。 这实际上等价于这样一个问题:给 $n$ 个点,每次随机一个点向左/向右,问一直触碰不 ......
132E ARC 132

equals方法

//Student3类public class Student3 { private String name; private int age; public Student3() { super(); } public Student3(String name, int age) { this.n ......
方法 equals

AtCoder Beginner Contest 240 D

[**D - Strange Balls**](https://atcoder.jp/contests/abc240/tasks/abc240_d) tag:栈模拟 发现自己隔了快半年再做此题看错相同数字的球消失的条件,不是 $k \geq 2$ 而是 $k = a_i$ ~~电子竞技不需要视力~~ ......
Beginner AtCoder Contest 240

8.19 对象比较 equals

## demo1 equals 实例化参数内容相同才相等-- 类外对比 ``` class Person { private String name; private int age; public Person(String name,int age){ this.name = name; thi ......
对象 equals 8.19 19

AtCoder Beginner Contest 304 G Max of Medians

[洛谷传送门](https://www.luogu.com.cn/problem/AT_abc304_g "洛谷传送门") [AtCoder 传送门](https://atcoder.jp/contests/abc304/tasks/abc304_g "AtCoder 传送门") 首先显然二分答案, ......
Beginner AtCoder Contest Medians 304

为什么重写 equals 时同时还要重写 hashCode?

## 为什么重写 equals 时同时还要重写 hashCode? ![img](https://ask.qcloudimg.com/http-save/yehe-1740031/e2e547d616d4817f0f86789b249e1d13.png?imageView2/2/w/1200) > ......
hashCode 同时 equals

AtCoder Beginner Contest 150 E Change a Little Bit

[洛谷传送门](https://www.luogu.com.cn/problem/AT_abc150_e "洛谷传送门") [AtCoder 传送门](https://atcoder.jp/contests/abc150/tasks/abc150_e "AtCoder 传送门") 令 $S_i \g ......
Beginner AtCoder Contest Change Little

Atcoder-AGC033C

看到这道题,是个博弈论,没见过树上的,于是想到在数列里的博弈论,又联想到树的特殊形式————链。 于是我们来讨论一下链的情况(对于没有硬币的点,我们就视为它被删掉了): 讨论链的情况 发现若是选择两端的点,顶点数会减一;若是选择中间的点,顶点数会减二。 现在我们站在链的角度来思考在树上选择的情况,一 ......
Atcoder-AGC Atcoder AGC 033

题解:【ARC142D】 Deterministic Placing

[题目链接](https://www.luogu.com.cn/problem/AT_arc142_d) 大佬讲解的太精简了,做点蒟蒻视角的思考补充。下面记摆放棋子的点为黑点,没有摆放棋子的为白点。 因为进行无数次操作后,占据节点集合总是唯一,所以黑点一定是在反复横跳;每个位置上只能存在一个黑点,所 ......
题解 Deterministic Placing 142D ARC

AtCoder Beginner Contest 149 F Surrounded Nodes

[洛谷传送门](https://www.luogu.com.cn/problem/AT_abc149_f "洛谷传送门") [AtCoder 传送门](https://atcoder.jp/contests/abc149/tasks/abc149_f "AtCoder 传送门") 不错的题。 考虑题 ......
Surrounded Beginner AtCoder Contest Nodes

==和equals的区别

在JAVA中,==与equals都有比较判断对象是否相等的作用,但具体用法却并不相同。 ==是运算符号,而equals则属于方法。 当==两边的对象属于基本类型时,==的作用仅是比较对象的值是否相等,如果相等返回true,否则返回false; 当两边的对象属于引用数据类型时,==的作用是判断对象的内 ......
equals

你还在用Object.equals()方法吗?

当《阿里巴巴Java开发手册》发布后,我也是仔细进行了阅读,想从中找出一些“标准”,让自己的代码质量提高。手册中对 Object 的 equals 方法的使用进行了强制,而且推荐使用 JDK7 中工具类 Objects 的 equals 方法,至此之后我就很少使用 Object.equals() 方... ......
方法 Object equals

AtCoder Beginner Contest 225 F String Cards

[洛谷传送门](https://www.luogu.com.cn/problem/AT_abc225_f "洛谷传送门") [AtCoder 传送门](https://atcoder.jp/contests/abc225/tasks/abc225_f "AtCoder 传送门") 这题是真的强。。 ......
Beginner AtCoder Contest String Cards