square 135d arc add

git 通过husky提交代码报错导致代码丢失(只add了未commit的代码)

> 项目中使用了eslint,以及lint-staged,在执行git commit 时会触发 git 的 pre-commit 钩子,对代码做一次检查及格式化。由于个别文件中有TS报错,导致commit失败,并抛出了具体文件路径,当我在命令行点击路径时发现新增得文件没了(.ts、.vue、图片), ......
代码 commit husky git add

ARC154

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

AGC063C Add Mod Operations

感觉是非常纯的思维题。 ## 题意 给两个长度为 $n$ 的序列 $A, B$。你可以对 $A$ 做不超过 $n$ 次操作,形如对于所有元素,先加上 $x$ 再对 $y$ 取模。其中 $0\le x using namespace std; using LL = long long; using U ......
Operations 063C AGC 063 Add

[ARC119F] AtCoder Express 3

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

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

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

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

Please set enableBabelTransform to true or add...

前言:在npm run dev时都正常展示,但是在 npm run build:alipay 打包后,可能会出现 解决方法: 使用 npm run build:alipay -- --watch 可以边修改边看打包后效果 参考来源:http://luwa100.com/BlogContent--id ......
enableBabelTransform Please true set add

lightdb alter table add column 语法支持括号

## 背景 在 Oracle 中,在旧表上用 `alter table` 命令一次添加多列是可以把列定义放在要括号里的,而 lightdb 之前版本 `alter table` 命令必须要多次执行 `add ...`. 此次版本允许 lightdb 有同样功能。LightDB 版本为 `LightD ......
括号 语法 lightdb column alter

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

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

[LeetCode] 2013. Detect Squares

You are given a stream of points on the X-Y plane. Design an algorithm that: Adds new points from the stream into a data structure. Duplicate points a ......
LeetCode Squares Detect 2013

E - Defect-free Squares

[Linkkkkkkkkkkkk](https://atcoder.jp/contests/abc311/tasks/abc311_e) 这其实是个dp问题 可以拆成一个个dp小问题,然后求和,这个小问题就是以$(i,j)$为右下角方块下会有多少矩形,然后把每一个位置加起来就行了。 应注意到以下命题 ......
Defect-free Squares Defect free

[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

git config --global --add safe.directory

克隆下源码对其操作时git报错 fatal: unsafe repository 并提示可以: git config --global --add safe.directory 这个命令是用来将一个安全目录添加到全局的 Git 配置中。具体来说,它会在 Git 的配置文件中添加一行类似于 "safe ......
directory config global safe git

Root Mean Square Layer Normalization

[TOC] > [Zhang B. and Sennrich R. Root mean square layer normalization. NIPS, 2019.](http://arxiv.org/abs/1910.07467) ## 概 RMSNorm 节省时间. ## RMSNorm - ......
Normalization Square Layer Root Mean

Atcoder ARC058E Iroha and Haiku

题目中的式子转化一下即存在一位 $i$ 使得到 $i$ 时的后缀和存在 $X + Y + Z, Y + Z, Z$,再发现 $X + Y + Z\le 17$,考虑状压。 设 $f_{i, j}$ 为填了 $i$ 个数当前后缀和中存在的数的状态为 $j$(只存 $0\sim X + Y + Z$ 的 ......
Atcoder Iroha Haiku 058E ARC

ARC134F Flipping Coins

pb 讲课没讲的题,感觉很牛逼啊!但不是牛逼在多项式,因为多项式大家应该都会。 考虑从前往后扫的过程,只要有正面就翻成反面,所以最后只有可能是当 $p_i #define int long long using namespace std; namespace vbzIO { char ibuf[( ......
Flipping Coins 134F ARC 134

Atcoder ARC058B Iroha and a Grid

考虑从第 $b$ 列与第 $b + 1$ 之间分开这个矩阵,钦定 $(i, b)$ 下一步必须走到 $(i, b + 1)$,可以发现这样是不会漏算或算重的。 于是就可以用乘法原理算出这个 $i$ 的贡献:$\binom{(i - 1) + (b - 1)}{i - 1}\times \binom{ ......
Atcoder Iroha 058B Grid ARC

ARC125F Tree Degree Subset Sum

感觉挺不错的一道题,不过课上 pb 好像没有讲。 显然树的具体形态对题目影响不大,那么我们知道 $\sum\limits_{i=1}^nd_i=2n-2$ 即可扔掉树的条件。即: > 给定 $n$ 个 $d_i$,和为 $2n-2$,求 $(x,y)$ 满足 $0\le x\le n$ 且 $\ex ......
Degree Subset 125F Tree ARC

E - Defect-free Squares

E - Defect-free Squares (atcoder.jp) 题意:一个H*W的矩形上有几个块有洞,问你没有洞的正方形有多少个 两种做法,DP和二分前缀和 DP是官方题解 先是二分前缀和做法,当时没想到前缀和可还行。。 先弄好前缀和,然后我们考虑用(i,j)作为正方形左上角能贡献多少个正 ......
Defect-free Squares Defect free

什么是 SAP AS ABAP 的 add-on 概念

AS ABAP 是 Application Server ABAP 的缩写,即 ABAP 应用服务器。 SAP AS ABAP的Add-on,顾名思义,是一个附加组件,它提供了一种实现特定业务功能或扩展已有系统功能的方式。 大家玩过星际争霸吗?这个游戏里人族的指挥中心基地,可以在雷达和核弹发射井两种 ......
概念 add-on ABAP SAP add

AT_arc101_d [ARC101F] Robots and Exits 题解--zhengjun

思路不错。 首先考虑把每个机器人转化为 $(a_i,b_i)$ 两个参数。 表示向左 $a_i$ 步会进入左边的出口,向右 $b_i$ 会进入右边的出口。 > 注:此时其他只能进入唯一的出口的机器人不影响答案,不考虑。 记 $c_i=0/1$ 表示 $i$ 号机器人是进入左边还是右边出口。 然后考虑 ......
题解 101 zhengjun AT_arc Robots

ARC163D Sum of SCC

### Description 给定 $N,M$,求对于所有 $N$ 个点的,满足恰有 $M$ 条从小连向大的边,即 $\sum\limits_{(u,v)\in E}[u 给竞赛图每个 SCC (强连通分量)缩点后,剩下的是由一条**极长**的链与某些前向边组成的图。 于是 SCC 的数量能够转换 ......
163D ARC 163 Sum SCC

AGC020F Arcs on a Circle

先考虑只能放**整点**的情况,不难想到考虑 dp。 对于环上的 dp,考虑**断环成链**,即钦定一条线段的左端点为**起点**。这里我们令长度**最长**的线段的左端点为环的起点。 这样做有一个好处:我们不用考虑**一条线段把环末尾覆盖再覆盖开头的空**的情况,而当我们钦定一个长度较小的线段作为 ......
Circle 020F Arcs AGC 020

ARC098D Donation

捐钱太亏了,我们倒序考虑,于是就变成了抢钱。 于是对于一个点的限制 $(a_u,b_u)$,令 $c_u=\max\{0,a_u-b_u\}$,表示到这个点之前你至少拥有的钱数,并且到了这个点之后会抢到 $b_u$ 的钱。 考虑建立 $\text{Kruskal}$ 重构树使得树上每条边 $fa_u ......
Donation 098D ARC 098