subsequence square 299f abc

[LeetCode] 1218. Longest Arithmetic Subsequence of Given Difference

Given an integer array arr and an integer difference, return the length of the longest subsequence in arr which is an arithmetic sequence such that th ......

PROPERTIES OF SQUARE NUMBERS

When a number is multiplied by itself, the resulting number is called as a square number. For example, when we multiply 5 by 5, we get 52 = 25. Here, ......
PROPERTIES NUMBERS SQUARE OF

[ABC135D] Digits Parade

> [Digits Parade の 传送门](https://www.luogu.com.cn/problem/AT_abc135_d) ## Solution 首先看到 > $1\le |S|\le 10^5$ 考虑 DP。 定义 $f_{i,j}$ 表示前 $i$ 个位置的数除以 $13$ 的 ......
Digits Parade 135D ABC 135

ABC222D-Between Two Arrays(前缀和优化dp)

题意:给定两个递增数列A和B,构造一个ai <= ci <= bi 的递增数列C,询问满足条件的C的个数。 普通dp会超时,用前缀和优化 n=int(input()) a=list(map(int,input().split())) b=list(map(int,input().split())) ......
前缀 D-Between Between Arrays ABC

洛谷 P8922 -『MdOI R5』Squares

首先发现一个性质:对于一组询问,如果答案不是 $-1$,那么必然存在最优正方形满足,要么三个边界上存在给定的点,要么两个边界 + 一个对角上存在给定的点,这是因为如果一个正方形只顶住了两个边界,那么如果这两个边界是邻边的话正方形肯定可以继续扩大,如果是对边的话我们可以将正方形水平方向上移动直到其卡住 ......
Squares P8922 8922 MdOI

PAT-甲级-1007 Maximum Subsequence Sum C++

Given a sequence of K integers { N1​, N2​, ..., N​K }. A continuous subsequence is defined to be { Ni​, Ni+1​, ..., Nj​ } where 1≤i≤j≤K. The Maximum S ......
甲级 Subsequence Maximum 1007 PAT

[LeetCode] 2542. Maximum Subsequence Score

You are given two 0-indexed integer arrays nums1 and nums2 of equal length n and a positive integer k. You must choose a subsequence of indices from n ......
Subsequence LeetCode Maximum Score 2542

[ABC134E] Sequence Decomposing

[Sequence Decomposing の 传送门](https://www.luogu.com.cn/problem/AT_abc134_e) ### 前置知识 > [multiset](https://zh.cppreference.com/w/cpp/container/multiset) ......
Decomposing Sequence 134E ABC 134

ABC309G Ban Permutation

### Problem > 求有多少个 $1$ 至 $n$ 的排列 $P$,满足对于任意 $i$ 都有 $|i-p_i|\ge X$。 > $1\le n\le 100$,$1\le X\le 5$。 ......
Permutation 309G ABC 309 Ban

abc081d <思维 构造>

[D - Non-decreasing](https://atcoder.jp/contests/abc081/tasks/arc086_b) ``` // https://atcoder.jp/contests/abc081/tasks/arc086_b // // 两种情况非常容易构造 : 全整 ......
思维 081d abc 081 lt

abc080d <区间重叠>

[D - Recording](https://atcoder.jp/contests/abc080/tasks/abc080_d) ``` // https://atcoder.jp/contests/abc080/tasks/abc080_d #include #include using na ......
区间 080d abc 080 lt

Atcoder ABC 309 F

# [Atcoder ABC 309 F](https://atcoder.jp/contests/abc309/tasks/abc309_f) ## 题意 n个盒子,长宽高为$x,y,z,$(长宽高是相对的,可以任意调换),问是否有一个盒子可以完全容纳另一个盒子,即存在一个$A_i={x_i,y_ ......
Atcoder ABC 309

abc079d <Floyed>

[D - Wall](https://atcoder.jp/contests/abc079/tasks/abc079_d) ``` // https://atcoder.jp/contests/abc079/tasks/abc079_d // #include #include #include # ......
Floyed 079d abc 079 lt

abc078d <博弈>

[D - ABS](https://atcoder.jp/contests/abc078/tasks/arc085_b) ``` // https://atcoder.jp/contests/abc078/tasks/arc085_b // // 思路: // 首先注意到两点: // 1. a[n] ......
078d abc 078 lt gt

abc077d <思维 + 最短路 (将构造数字过程视为最短路)>

[D - Small Multiple](https://atcoder.jp/contests/abc077/tasks/arc084_b) ``` // https://atcoder.jp/contests/abc077/tasks/arc084_b // // 参考: // 1. https ......
思维 过程 数字 077d abc

AT_abc306_h 题解

# AT_abc306_h Balance Scale 题解 ## Links [洛谷](https://www.luogu.com.cn/problem/AT_abc306_h) [AtCoder](https://atcoder.jp/contests/abc306/tasks/abc306_h ......
题解 AT_abc 306 abc AT

abc076d <dp / 贪心>

[D - AtCoder Express](https://atcoder.jp/contests/abc076/tasks/abc076_d) ``` // https://atcoder.jp/contests/abc076/tasks/abc076_d // // dp[i][j] 表示第i秒 ......
076d abc 076 lt dp

acwing -- 3346. 你知道你的ABC吗

简单模拟,最小的两个数字是a, b, 最大的数字时a + b + c #include<iostream> #include<cstdio> #include<algorithm> #include<set> using namespace std; int main() { multiset<in ......
acwing 3346 ABC

abc075d <暴力枚举 / 枚举+离散化+二维前缀和>

[D - Axis-Parallel Rectangle](https://atcoder.jp/contests/abc075/tasks/abc075_d) ``` // https://atcoder.jp/contests/abc075/tasks/abc075_d // // 本代码为完全 ......
前缀 暴力 075d abc 075

abc074d <Floyed 消除传递边>

[D - Restoring Road Network](https://atcoder.jp/contests/abc074/tasks/arc083_b) ``` // https://atcoder.jp/contests/abc074/tasks/arc083_b // // 1. 跑一边f ......
Floyed 074d abc 074 lt

ABC_DQ:基于MATLAB/Simulink的三相静止坐标系到两相静止坐标系(Clark变换)到两相旋转坐标系变换(Park变

ABC_DQ:基于MATLAB/Simulink的三相静止坐标系到两相静止坐标系(Clark变换)到两相旋转坐标系变换(Park变换)的仿真模型。仿真条件:MATLAB/Simulink R2015bID:2720651503371560 ......
坐标系 坐标 Simulink ABC_DQ MATLAB

Atcoder ABC308H Make Q

考虑枚举唯一一个度数为 $3$ 的点 $u$,即既在环上又与非环上一点相连的那个点。 接下来考虑先处理环,那可以先把 $u$ 从图上删掉,环的最短距离便是与 $u$ 有连边的 $2$ 个点在图上最短路长度加上 $2$ 个点与 $u$ 连边的长度,即 $\min\{w_{u, i} + w_{u, j ......
Atcoder 308H Make ABC 308

AT-abc214-g题解

title: AT_abc214_g题解 date: 2023-05-30 21:12:20 tags: 题解 cover: https://i.imgloc.com/2023/05/30/Vt18Rz.jpeg # 题目描述 给定两个排列 $p, q$,要求统计满足 $\forall i, r_i ......
题解 AT-abc 214 abc AT

abc073d <Floyed + 枚举排列>

[D - joisino's travel](https://atcoder.jp/contests/abc073/tasks/abc073_d) ``` // https://atcoder.jp/contests/abc073/tasks/abc073_d // Floyed + 枚举排列 #i ......
Floyed 073d abc 073 lt

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