atcoder equal 100d arc

Practice on Codeforces and Atcoder in July

## [$1844E$](https://codeforces.com/problemset/problem/1844/E) 题意: 定义一个矩形 $a$ 是好的,当且仅当其满足以下条件: 1. 矩形中每一个元素 $x$ 都为 $A,B,C$ 其中之一 2. 每一个 $2\times 2$ 的子矩形 ......
Codeforces Practice Atcoder July and

Practice on Codeforces and Atcoder in June

# $Practice$ $on$ $codeforces$ $in$ $June$ wk,误删了4个题,但我不想补了 ## [$CF1839D$](https://codeforces.com/contest/1839/problem/D) 题意:给一个正整数序列 $a$,给定 $k$ 个 0,将 ......
Codeforces Practice Atcoder June and

Practice on Codeforces and Atcoder in May

# CF补题题解2023.5 说明:CF题直接去luogu看翻译,AT题会附上简要题意 ## [CF1821E](https://codeforces.com/contest/1821/problem/E) 先考虑如何高速计算权值 一个显而易见的贪心是尽量在右边取括号消除,设右括号为 1,左括号为 ......
Codeforces Practice Atcoder May and

UNIQUE VISION Programming Contest 2023 Summer(AtCoder Beginner Contest 312)

# Preface 最唐氏的一集,尽情欣赏ABC E题战俘的丑态 这场打的时候就很抽象,各种傻逼错误频发,从B题一路WA到G题 还好发现E后面的题更简单后马上把FG写了,不然要爆炸了 # A - Chord 签到 ```cpp #include #include #include #include ......
Contest Programming Beginner AtCoder UNIQUE

ARC157

## ARC157 ### A 简单分讨即可 ```cpp #include using namespace std; int Abs(int x) { return x>0?x:-x; } int n; int A,B,C,D; int main() { scanf("%d %d %d %d %d ......
ARC 157

AtCoder Beginner Contest 165

# AtCoder Beginner Contest 165 https://atcoder.jp/contests/abc165 ## C - Many Requirements dfs ```CC #include using namespace std; const int N = 15, M ......
Beginner AtCoder Contest 165

AtCoder Beginner Contest 312

# A - Chord ```cpp #include using namespace std; int32_t main() { ios::sync_with_stdio(false), cin.tie(nullptr), cout.tie(nullptr); string s; cin >> s ......
Beginner AtCoder Contest 312

ARC154

## ARC154 ### A 似乎是均值反着用,直接最大乘最小即可 ```cpp #include using namespace std; const int MOD=998244353; int n; string A,B; int main() { // freopen("date.in", ......
ARC 154

[UNIQUE VISION Programming Contest 2023 Summer(AtCoder Beginner Contest 312) - AtCoder](https://atcoder.jp/contests/abc312)

# [UNIQUE VISION Programming Contest 2023 Summer(AtCoder Beginner Contest 312) - AtCoder](https://atcoder.jp/contests/abc312) ## [A - Chord (atcoder.j ......
Contest AtCoder Programming 312 Beginner

[ARC119F] AtCoder Express 3

有简单做法,但是pb大神讲了自动机做法。 这么有趣的自动机不去做?亏大发。 有两个重要的观察。 当你出现长度大于 $4$ 的连续段时,一定会向后走一次并跳过这一段。 某些时候,当你能用同样的步数走到最后的两个格子,且中一个是 $\rm A$,一个是 $B$ 时,可以看作你处于一个既能是 $\rm A ......
AtCoder Express 119F ARC 119

Java 中 == 与 equals() 的区别

# Java 中 == 与 equals() 的区别 # 1. == ## == 是一个比较运算符,在使用时有可以判断两种情况 > ## 在用于基本类型时,即判断两边数据的值是否相等。 > > ## 在用于引用类型时,即判断两边是否为同一个对象即有相同的地址。 # 2. equals() 方法 ## ......
equals Java

ARC154 E

非常好题目!!! 求和不好搞的话,我们先把他转成期望!最后再乘上 $(\frac{n(n+1)}{2})^m$。 然后拆贡献,考虑 $i$ 的系数: $$ \sum_{j\lt i}[P_j\gt P_i]-\sum_{j\gt i}[P_j\lt P_i] $$ 然后是特别波特的一步!这个东西对于 ......
ARC 154

Atcoder-Beginner-Contest-312 A~Ex

# [$Atcoder-Beginner-Contest-312$](https://atcoder.jp/contests/abc312/) AB过于简单,在此略去。 ## [$C-Invisible$ $Hand$](https://atcoder.jp/contests/abc312/task ......

AtCoder Beginner Contest 312

## [A - Chord (abc312 A)](https://atcoder.jp/contests/abc312/tasks/abc312_a) ### 题目大意 给定一个长度为$3$的字符串,问是不是`ACE, BDF, CEG, DFA, EGB, FAC, GBD`中的一个。 ### ......
Beginner AtCoder Contest 312

(AtCoder Beginner Contest 312)

(AtCoder Beginner Contest 312) A - Chord #include<bits/stdc++.h> using namespace std; #define int long long //#define int __int128 typedef pair<int,in ......
Beginner AtCoder Contest 312

ARC 补题笔记 1

## ARC156 ### A. Non-Adjacent Flip >给定长度为 $n\ (3\le n\le 2\times10^5)$ 的 01 串,每次选定 $1\le i,j\le n$ 且 $|i-j|\ge2$,将 $i,j$ 位上的数字 $x$ 变为 $1-x$。求全部数字变为 $1 ......
笔记 ARC

Atcoder ABC259H Yet Another Path Counting

首先可以想到有组合数的方法: 令起点为 $(x1, y1)$,终点为 $(x2, y2)$,则路径方案数就为 $\binom{x2 + y2 - x1 - y1}{x2 - x1}$,这样设有 $k$ 个相同颜色的点,时间复杂度就为 $O(k^2)$。 再考虑到还有 $\text{DP}$ 方法: ......
Counting Atcoder Another 259H Path

AT_arc113_c 题解

[洛谷链接](https://www.luogu.com.cn/problem/AT_arc113_c)&[Atcoder 链接](https://www.luogu.com.cn/remoteJudgeRedirect/atcoder/arc113_c) 本篇题解为此题**较简单做法**及**较少 ......
题解 AT_arc 113 arc AT

Java面试题 P9:hashCode与equals区别

equals: 1、用于定义对比两个对象的对比规则,来判断这两个对象什么时候是相等的,什么时候是不相等的 2、默认使用object的equals,实际上就是==号,对比的是对象在栈中的引用的地址,如果是基本类型变量的话对比的是栈中的值,对比的是引用地址。 hashCode: 1、 ......
hashCode equals Java

==与equals区别

``` java public class ll{ public static void main(String[] args) { String s1 = "abc"; String s2 = "abc"; String s3 = new String("abc"); String s4 = "a ......
equals

Atcoder ARC060D Digit Sum

看到 $n\le 10^{11}$,考虑按根号分为两部分处理。 对于 $b\le \sqrt{n}$,考虑直接暴力算 $\operatorname{f}(b, n)$ 判断是否等于 $s$,这部分的计算量是 $O(\sqrt{n})$ 级别的。 对于 $\sqrt{n} n$,这个时候 $\oper ......
Atcoder Digit 060D ARC 060

[ARC143B] Counting Grids 题解

[Counting Grids](https://www.luogu.com.cn/problem/AT_arc143_b) ### 题目大意 将 $1\sim n^2$ 填入 $n\times n$ 的网格 $A$ 中,对于每个格子满足以下条件之一: - 该列中存在大于它的数。 - 该行中存在小于 ......
题解 Counting Grids 143B ARC

1775.equal sum arrays with minimum number of operations

Description 1775.equal-sum-arrays-with-minmum-number-of-operations Solution hash table + greedy algorithm The general idea of this problem is hash + g ......
operations minimum arrays number equal

AT_arc041_b 题解

[洛谷链接](https://www.luogu.com.cn/problem/AT_arc041_b)&[Atcoder 链接](https://www.luogu.com.cn/remoteJudgeRedirect/atcoder/arc041_b) 本篇题解为此题较**简单做法**及**较少 ......
题解 AT_arc 041 arc AT

AT_arc149_a 题解

[洛谷链接](https://www.luogu.com.cn/problem/AT_arc149_a)&[Atcoder 链接](https://atcoder.jp/contests/arc149/tasks/arc149_a) 本篇题解为此题较**简单做法**及**较少码量**,并且码风优良, ......
题解 AT_arc 149 arc AT

AT_arc154_b 题解

[洛谷链接](https://www.luogu.com.cn/problem/AT_arc154_b)&[Atcoder 链接](https://www.luogu.com.cn/remoteJudgeRedirect/atcoder/arc154_b) 本篇题解为此题较**简单做法**及**较少 ......
题解 AT_arc 154 arc AT

AT_arc157_a 题解

## 思路 看数据范围时能发现,这 $N$ 啥用也没有,因为 $A+B+C+D=N-1$。 首先,$B$,$D$ 为 $0$ 且 $A$,$C$ 为 $0$ 的情况是不可能有的,因为既然有 `XX` 和 `YY` 字符串,那么一定会至少组成一个 `XY` 或 `YX`,输出 `No`; 然后,$\l ......
题解 AT_arc 157 arc AT

Java面试题 P4:==和equals

==对比的是栈中的值,基本数据类型是变量值,引用类型是堆中内存对象的地址 new String(“abc”),实际上是指向了堆中的内存对象应用地址。 String str1=“Hello”; //放入堆中的常量池 String Str2=new String("Hello");//在堆中去分配内存, ......
equals Java

[ARC150F] Constant Sum Subsequence

Problem StatementWe have a sequence of positive integers of length $N^2$, $A=(A_1,\ A_2,\ \dots,\ A_{N^2})$, and a positive integer $S$. For this sequ ......
Subsequence Constant 150F ARC 150

C. Equal Frequencies

#include "bits/stdc++.h" using namespace std; typedef long long ll; typedef pair<int,int> PII; const int N=1e6+10,INF=0x3f3f3f3f; int n; string s; int ......
Frequencies Equal