atcoder equal 100d arc

Atcoder ARC163C Harmonic Mean

首先考虑到分数裂项:$\frac{1}{x} - \frac{1}{x + 1} = \frac{1}{x\times (x + 1)}$,那就有 $\frac{1}{x} = \frac{1}{x + 1} + \frac{1}{x\times (x + 1)}$。 于是构造方法就很明显了啊,首先 ......
Harmonic Atcoder 163C Mean ARC

Atcoder ARC119D Grid Repainting 3

看到方格图,便想到把行和列当成图上的点,把红点当作连接行列的边,这样就能构造出二分图。 考虑把每个连通的二分图单独拎出来考虑,能发现对其建一个生成树,只要 $u$ 节点的操作与 $son_u$ 的操作相反,则 $son_u$ 是不会干扰到 $u$ 的。 这则说明每个连通的二分图消完后肯定是只剩一行或 ......
Repainting Atcoder 119D Grid ARC

Atcoder ARC162C Mex Game on Tree

发现如果子树内如果存在 $k$ 则 $mex$ 的值必定不为 $k$,所以 Bob 的策略即为在空位填上 $k$。 Alice 的决策便可以知道是在 Bob 出手前就要让这个子树满足条件,不让 Bob 破坏这个子树,考虑需满足哪些条件: - 至多 $1$ 个空位,否则 Bob 可以把 $k$ 填在子 ......
Atcoder 162C Game Tree ARC

Atcoder ARC161C Dyed by Majority (Odd Tree)

首先能发现对于树的叶子节点,与其连边的只有其父节点,所以该节点最终状态为 $\text{B/W}$ 其父节点的状态就一定为 $\text{B/W}$。 然后考虑它自己是什么状态,因为同样的与其连边的只有其父节点,所以其父节点最终状态为 $\text{B/W}$ 其状态就为 $\text{B/W}$。 ......
Majority Atcoder 161C Dyed Tree

Atcoder AGC043C Giant Graph

首先能由 $10^{18(x + y + z)}$ 发现 $x + y + z$ 肯定越大越好。 于是就能想到贪心,从大到小枚举 $h = x + y + z$,若 $(x, y, z)$ 没有相连的点被选,那就选这个点。 考虑对于每条边 $(u, v)$,令 $u u, a = a, b = b$ ......
Atcoder Giant Graph 043C AGC

Object.equals 和 String.equals的区别

一. 源码展示: 1. Object.equals: ①引用类型地址值比较,直接返回结果:true || false public class Object { public boolean equals(Object obj) { return (this == obj); } } 2. Stri ......
equals Object String

AtCoder Beginner Contest 309

> 感觉F写了个乱搞做法 ## [A - Nine (abc309 A)](https://atcoder.jp/contests/abc309/tasks/abc309_a) ### 题目大意 给定一个$3 \times 3$的网格,以及两个数字。 ![tu](https://img.atcode ......
Beginner AtCoder Contest 309

Java字符串比较 == 和 equals方法的区别

今天在排除一个bug的时候出现了一个很低级但是也很容易被忽视的错误,在此写了一个小例子做记录。 首先我先说一下错误的场景,我读取了一段json数据,并使用JSONObject的实例对象的getString方法去拿到了一个value数据,由于我忽视了getString方法的返回值是一个String对象 ......
字符串 字符 方法 equals Java

AtCoder Beginner Contest 178(E,F)

# AtCoder Beginner Contest 178(E,F) ## E(计算几何) 给出$n$个点坐标,我们需要知道两个不同的点之间的曼哈顿的最大的那一个,求$max(abs(x_i-x_j)+abs(y_i-y_j))$ 题意很好懂,就是如果按照最简单的想法,可以一个一个找,我们枚举不同 ......
Beginner AtCoder Contest 178

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

AtCoder Beginner Contest 308 题解

https://atcoder.jp/contests/abc308/tasks_print # A - New Scheme 过水已隐藏。 代码: ```cpp #include #include #include #include using namespace std; using names ......
题解 Beginner AtCoder Contest 308

AtCoder Beginner Contest 264 ABCDE

# [AtCoder Beginner Contest 264](https://atcoder.jp/contests/abc264) ## **A - "atcoder".substr()** ### Problem Statement 题意:截取字符串 `atcoder`的[L,R]一段并输出 ......
Beginner AtCoder Contest ABCDE 264

【DS】【AtCoder】Pakencamp 2022 Day2 H

2023.6.30 [Problem Link](https://atcoder.jp/contests/pakencamp-2022-day2/tasks/pakencamp_2022_day2_h) 有 $n$ 个帮派在打架,每个帮派有一个大小 $a_i$,每相邻两个帮派有一个仇恨度 $b_i$ ......
Pakencamp AtCoder 2022 Day2 Day

AtCoder Regular Contest 163

### [A](https://atcoder.jp/contests/arc163/tasks/arc163_a) 只需暴力判断能否分成两部分即可。 时间复杂度 $\mathcal{O}(n^2)$。 ### [B](https://atcoder.jp/contests/arc163/tasks ......
AtCoder Regular Contest 163

【ARC104E】Random LIS 题解(期望)

[LG 传送门](https://www.luogu.com.cn/problem/AT_arc104_e) | [AtC 传送门](https://atcoder.jp/contests/arc104/tasks/arc104_e)。 期望。 ## Solution - 显然我们会发现 $n$ 非 ......
题解 Random 104E ARC 104

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

AtCoder Beginner Contest 304

A: 1 #include<cstdio> 2 #include<cstring> 3 #include<algorithm> 4 #include<iostream> 5 #include<string> 6 #include<vector> 7 #include<stack> 8 #includ ......
Beginner AtCoder Contest 304

AtCoder Grand Contest 033 D Complexity

[洛谷传送门](https://www.luogu.com.cn/problem/AT_agc033_d "洛谷传送门") [AtCoder 传送门](https://atcoder.jp/contests/agc033/tasks/agc033_d "AtCoder 传送门") 这题感觉实在太 e ......
Complexity AtCoder Contest Grand 033

[ARC096F] Sweet Alchemy

# [ARC096F] Sweet Alchemy [洛谷:[ARC096F] Sweet Alchemy](https://www.luogu.com.cn/problem/AT_arc096_d) [Atcoder:[ARC096F] Sweet Alchemy](https://atcoder ......
Alchemy Sweet 096F ARC 096

ARC063F题解

[ARC063F](https://www.luogu.com.cn/problem/AT_arc063_d) 白色区域一定是一个矩形。 假设我们已经知道了矩形的两个分界线 ![](https://cdn.luogu.com.cn/upload/image_hosting/d98y1jzi.png? ......
题解 063F ARC 063

AtCoder Beginner Contest 308 - E

题目链接:[abc 308](https://atcoder.jp/contests/abc308) 前四题简单就不放了 #### [E - MEX](https://atcoder.jp/contests/abc308/tasks/abc308_e) 阿巴阿巴,比赛的时候想复杂了,一直在想怎么快速 ......
Beginner AtCoder Contest 308

Atcoder Beginer Contest 306 D ~ E

vp中途突然拉肚子>_ using namespace std; using ll = long long; int main() { ios::sync_with_stdio(false); cin.tie(nullptr); int n; cin >> n; array dp; for(int ......
Atcoder Beginer Contest 306

AtCoder Regular Contest 163

# Preface 补题,这场比赛的时候被拉去开科研组会了,所以就没现场打了 这两天军训在伤病连划水,白天可以好好想题目舒服的一批 这场D题确实很妙,需要一些竞赛图相关的知识才能想到转化,不过也算是学到一个重要trick了吧 # **A - Divide String** 显然只要考虑能否分成两个串 ......
AtCoder Regular Contest 163

AtCoder Beginner Contest 308 ABCDEF

# [AtCoder Beginner Contest 308]([AtCoder Beginner Contest 308 - AtCoder](https://atcoder.jp/contests/abc308)) ## **A - New Scheme** ### Problem State ......
Beginner AtCoder Contest ABCDEF 308

AtCoder Regular Contest 163 D Sum of SCC

[洛谷传送门](https://www.luogu.com.cn/problem/AT_arc163_d "洛谷传送门") [AtCoder 传送门](https://atcoder.jp/contests/arc163/tasks/arc163_d "AtCoder 传送门") 怎么连这种相对传统 ......
AtCoder Regular Contest 163 Sum

AtCoder Regular Contest 153 E Deque Minimization

[洛谷传送门](https://www.luogu.com.cn/problem/AT_arc153_e "洛谷传送门") [AtCoder 传送门](https://atcoder.jp/contests/arc153/tasks/arc153_e "AtCoder 传送门") 我们考虑给定 $X ......
Minimization AtCoder Regular Contest Deque

ARC133E 题解

# [ARC133E] Cyclic Medians 题解 ## Links [Luogu](https://www.luogu.com.cn/problem/AT_arc133_e) [AtCoder](https://atcoder.jp/contests/arc133/tasks/arc133 ......
题解 133E ARC 133

AtCoder ABC168C : (Colon) 题解

## AtCoder ABC168C : (Colon) 题解 ### 前置知识 本题主要考察的是高中知识——余弦定理。 具体的相关信息可以参考知乎的一片文章:《[余弦定理及推理证明过程](https://zhuanlan.zhihu.com/p/359951716)》。 简单的说,就是如果两个线段 ......
题解 AtCoder Colon 168C ABC

题解 ARC163C【Harmonic Mean】

没想出来什么优美的解法,来个乱搞。 特判平凡情况 $n\le 2$,其中 $n=1$ 显然有 $1=\frac{1}{1}$,$n=2$ 无解。 众所周知 $1=\frac{1}{2}+\frac{1}{4}+\frac{1}{8}+\cdots+\frac{1}{2^k}+\frac{1}{2^k ......
题解 Harmonic 163C Mean ARC

AtCoder Beginner Contest 308 G Minimum Xor Pair Query

[洛谷传送门](https://www.luogu.com.cn/problem/AT_abc308_g "洛谷传送门") [AtCoder 传送门](https://atcoder.jp/contests/abc308/tasks/abc308_g "AtCoder 传送门") 考虑没有删除操作怎 ......
Beginner AtCoder Contest Minimum Query