backward digit 3187 sums

CF1866D Digital Wallet 题解

Problem - 1866D - Codeforces Digital Wallet - 洛谷 不妨为选数钦定一个顺序:不同行之间无影响,列从左到右取一定不劣。 设计状态:设 \(dp_{i,j}\) 表示前 \(i\) 次操作操作到第 \(j\) 列的最大答案 转移:因为对于同一列不互相影响, ......
题解 Digital Wallet 1866D 1866

All Possible Digits

here 单调性:多加几次,出现的数不会变少,肯定可以二分。 最多操作\(p-1\)次,也就是最多进位一次。 而且最多只会进位一次,对于最后一位在加的过程中出现的值,直接用式子算,然后为了统计出现的数的次数,在其他位的数,如果在最后一位变化的范围里,就不应该加1。 但是题解又有不用二分的做法…… 首 ......
Possible Digits All

debian 11 安装docker-ce 出现异常 “Hash Sum mismatch Hashes of expected file”

最近接手一个新的项目,需要在内网布置一套新系统,有docker 版本的要求,原来的docker 版本过低需要进行升级,按部就班的升级docker如下 安装 # 这里是用的debian 11 # 如果安装过docker apt-get remove docker docker-engine docke ......
docker-ce mismatch expected debian Hashes

题解 [ARC149B] Two LIS Sum

题解 [ARC149B] Two LIS Sum 大胆猜结论,按照 \(a\) 数组为关键字进行排序,求更改后 \(b\) 的 \(LIS\) 。 证明:每次移动,都有 \(a\) 中增加一个长度, \(b\) 中贡献可能为 \(\{-1,0,1\}\) , 总体贡献为 \(\{0,1,2\}\) ......
题解 149B ARC 149 Two

[LeetCode] 2574. Left and Right Sum Differences

Given a 0-indexed integer array nums, find a 0-indexed integer array answer where: answer.length == nums.length. answer[i] = |leftSum[i] - rightSum[i] ......
Differences LeetCode Right 2574 Left

Signal Filters Design Based on Digital Signal Processing

This project is developed about how to process digital signals perfectly and design very useful signal filters. ......
Signal Processing Filters Digital Design

PAT_A1081 Rational Sum

1、 #分数 本题主要考察分数的运算,和分数的输出 2、数据范围为int,但两分母相乘时,最大可达到long long,应该用long long 3、测试点4会检查0的输出。 ......
Rational PAT_A 1081 PAT Sum

PAT_A1104 Sum of Number Segments

Given a sequence of positive numbers, a segment is defined to be a consecutive subsequence. For example, given the sequence { 0.1, 0.2, 0.3, 0.4 }, we ......
Segments Number PAT_A 1104 PAT

003Square(n)Sum(8kyu)from codewars

Square(n)Sum Complete the square sum function so that it squares each number passed into it and then sums the results together. 完成平方和函数,对每个传入其中的数字平方并相 ......
codewars Square 8kyu from 003

Leecode 1. 两数之和 Two Sum

给定一个整数数组 nums 和一个整数目标值 target,请你在该数组中找出 和为目标值 target 的那 两个 整数,并返回它们的数组下标。 你可以假设每种输入只会对应一个答案。但是,数组中同一个元素在答案里不能重复出现。 你可以按任意顺序返回答案。 示例 1: 输入:nums = [2,7, ......
之和 Leecode Two Sum

安信可小安派【Analog to digital】 ADC 基于AI-M6x

今天来分享一下我的ADC学习心得,首先说明当前的教程适用于所有的搭载AI-m61或者m62芯片的小安派。 需要的库文件如 库文件 说明 bflb_adc.h ADC功能 log.h 用来打印日志 bflb_gpio.h 初始化GPIO bflb_mtimer.h 延时 board.h 初始化系统 重 ......
digital Analog AI-M ADC 6x

PAT 甲级【1007 Maximum Subsequence Sum】

本题是考察动态规划与java的快速输入: max[i]表示第i个结尾的最大的连续子串和。b begin[i]表示第[begin[i],i]为最大和的开始位置 超时代码: import java.io.BufferedReader; import java.io.IOException; import ......
甲级 Subsequence Maximum 1007 PAT

【dp】【竞赛图的性质】ARC163D Sum of SCC 题解

ARC163D 发现这个竞赛图一定能被分为两个集合 \(A\),\(B\)。满足 \(\forall u\in A,v\in B\),均有 \(u\to v\in E\)。答案就是划分这两个集合的方案数。 证明: 首先,竞赛图缩完点后一定是一条链,对强连通分量进行标号,满足编号小的强连通分量指向编号 ......
题解 性质 163D ARC 163

linux 中 md5sum -c 命令

001\ [root@pc1 test01]# ls [root@pc1 test01]# seq 3 > a.txt ## 测试文件 [root@pc1 test01]# ls a.txt [root@pc1 test01]# cat a.txt 1 2 3 [root@pc1 test01]# ......
命令 md5sum linux 5sum md5

Count of Sub-Multisets With Bounded Sum

Count of Sub-Multisets With Bounded Sum You are given a 0-indexed array nums of non-negative integers, and two integers l and r. Return the count of s ......
Sub-Multisets Multisets Bounded Count With

CF1628D2 Game on Sum

题目链接(Easy) 题目链接(Hard) Part1 神奇的博弈类型 \(Dp\) 。 我们发现与当前状态有关的量,有且只有 现在是第几轮,还有 Bob 用了几次加的操作 ,这都会影响之后的决策,而和之前的决策无关,换句话说,当前决策有后效性,没有前效性。那我们考虑倒着 \(Dp\). Part2 ......
1628D 1628 Game Sum CF

CF585F Digits of Number Pi

CF585F Digits of Number Pi 更好的阅读体验 观察数据范围,考虑数位 DP。 首先把长串中 \(len\geq\lfloor \frac{d}{2}\rfloor\) 的串提出来,塞进一个 trie 里,然后建立 ACAM,然后直接 DP 就行了。 设 \(f_{i,j,0/ ......
Digits Number 585F 585 CF

[LeetCode] 1354. Construct Target Array With Multiple Sums 多次求和构造目标数组

You are given an array target of n integers. From a starting array arr consisting of n 1's, you may perform the following procedure : let x be the sum ......
数组 Construct LeetCode Multiple 目标

Codeforces Round 671 (Div. 2) A. Digit Game

\(R\) 和 \(B\) 在玩一个数字游戏,给一个含有 \(n\) 位的正整数 \(x\) 。俩人轮流操作, \(R\) 先行动。 在每一步中,\(R\) 可以选择 \(x\) 中一个未被标记的奇数位置并标记,\(B\) 可以选择 \(x\) 中一个未被标记的偶数位置并标记。 当最后只剩下一个未被 ......
Codeforces Round Digit Game 671

Trying to backward through the graph a second time

原因是把创建loss的语句loss_aux = torch.tensor(0.)放在循环体外了,可能的解释是第一次backward后把计算图删除,第二次backward就会找不到父节点,也就无法反向传播。参考:https://stackoverflow.com/questions/55268726/ ......
backward through Trying second graph

Codeforces Round 684 (Div. 2) B. Sum of Medians

定义 \(median\) 是一个非降序数组中第 \(\lceil \frac{n}{2} \rceil\) 的数。数组从 \(1\) 开始标号。 给两个数 \(n\) 和 \(k\) ,并给出一个长为 \(nk\) 的数组 \(a\) 。 需要分出为 \(k\) 个大小为 \(n\) 的数组,每个 ......
Codeforces Medians Round 684 Div

解决SUM函数返回为NULL

解决SUM函数返回为NULL SUM函数的作用:计算某一字段中所有行的数值和, 使用SUM函数进行对符合条件的结果行数进行求和。 问题产生: sum 求和时会对 null 进行过滤,不计算,但如果没有返回结果,则sum 函数的返回值为 null,不是 0: 解决方式: 1. IFNULL 使用IFN ......
函数 NULL SUM

CF1886A Sum of Three 题解

Question 给定一个正整数 N ,我们需要找三个不同的整数x,y,z,使得 N = x+y+z,其中下x,y,z不能被三整除 solution 我们把N%3会有一些余数,我们针对余数来讨论,其中我们只关注xyz的余数 如果余数为0 那么也就可能是1+1+1,或者2+2+2,但是考虑到xyz不同 ......
题解 1886A Three 1886 Sum

Codeforces Round 891 (Div. 3) F. Sum and Product(数论+map)

Codeforces Round 891 (Div. 3) F. Sum and Product 思路:对于x,y:ai+aj=x —> aj=x-ai 因此 ai*(x-ai) = y ——> ai = (x 土 sqr( x^2 - 4y ) ) /2 对应的 ai 就是要的两个值 若两个值不同 ......
数论 Codeforces Product Round 891

D. Sum of XOR Functions

D. Sum of XOR Functions You are given an array $a$ of length $n$ consisting of non-negative integers. You have to calculate the value of $\sum_{l=1}^{ ......
Functions Sum XOR of

[LeetCode] 2578. Split With Minimum Sum

Given a positive integer num, split it into two non-negative integers num1 and num2 such that: The concatenation of num1 and num2 is a permutation of  ......
LeetCode Minimum Split 2578 With

CF1857F Sum and Product

根据题意我们有:\(b=a_i+a_j\),\(c=a_i\times a_j\)。 可以发现 \(a_i\) 和 \(a_j\) 是一元二次方程 \(x^2-bx+c=0\) 的根。 那么就可以根据求根公式 \(x=\dfrac{-b\pm \sqrt{b^2-4ac}}{2a}\) 来求出 \( ......
Product 1857F 1857 Sum and

D. Prefix Permutation Sums

D. Prefix Permutation Sums 吐槽:读题不仔细,还以为原数组的取值是任意的,最后看题解的时候才发现取值在[1,n],当时因为看不懂直接跳过了 题意:给你一个缺了一个的前缀和数组,让你判断是否存在原数组,取值[1,n],每个数只存在一次 可以分类讨论 1 缺少最后一个前缀和 2 ......
Permutation Prefix Sums

【思维】【DP】ABC298Ex Sum of Min of Length 题解

ABC298Ex 简单题。 因为有 \(\min\) 不好做,容易想到讨论 \(d(i, L)\) 和 \(d(i, R)\) 的大小。 令 \(p = \text{LCA}(L, R)\),\(dep_L > dep_R, dist = dep_L + dep_R - 2\times dep_p\ ......
题解 思维 Length of ABC

【竞赛图】【DP】ARC163D Sum of SCC 题解

ARC163D 发现这个竞赛图一定能被分为两个集合 \(A\),\(B\)。满足 \(\forall u\in A,v\in B\),均有 \(u\to v\in E\)。答案就是划分这两个集合的方案数。 证明: 首先,竞赛图缩完点后一定是一条链,对强连通分量进行标号,满足编号小的强连通分量指向编号 ......
题解 163D ARC 163 Sum