码迷,mamicode.com
首页 >  
搜索关键字:hduoj sum    ( 21465个结果
6、函数
函数 定义函数 def printinfo(): print(" ") print(" 人生苦短 我用python ") print(" ") ## 函数调用 printinfo() 带参数的函数的定义 def sum2num(a,b): sum=a+b print(sum) sum2num(11, ...
分类:其他好文   时间:2020-06-27 20:12:47    阅读次数:89
P2664 树上游戏
给定一棵大小为 \(n\) 的树,每个结点都有颜色。 定义 \(s(i, j)\) 为从 \(i\) 到 \(j\) 的不同颜色数量以及 \(sum_i = \sum\limits_{j= 1}^ns(i,j)\)。 求出所有的 \(sum_i\)。 较为复杂的点分治题。 也可以用差分 \(O(n) ...
分类:其他好文   时间:2020-06-27 13:15:18    阅读次数:52
mysql基本语句
MySQL关系型数据库RDS中的老大哥,增删改查是MySQL入门的基础 增删改查语句增删改查的语句命令为 增:insert删:delete改:update查:SELECT或者show 库操作 创建数据库:create database shujukuba;创建带字符集的数据库:create data ...
分类:数据库   时间:2020-06-27 10:11:02    阅读次数:277
0344. Reverse String (E)
Reverse String (E) 题目 Write a function that reverses a string. The input string is given as an array of characters char[]. Do not allocate extra space ...
分类:其他好文   时间:2020-06-27 10:04:20    阅读次数:50
0040. Combination Sum II (M)
Combination Sum II (M) 题目 Given a collection of candidate numbers (candidates) and a target number (target), find all unique combinations in candidate ...
分类:其他好文   时间:2020-06-27 10:04:01    阅读次数:52
程序练习-珠心算习题生成
珠心算:目前和为9以内加减法;最多随机7个数字,从第二个数字开始,随机数加前面的数字和不超过9, 差不能小于0; 据此规则得: 0-sum<=a <= 9-sum; 得知待填入数字a的范围。 通过for 遍历, 获得处在这个区间的数字在数组中的index, 以这个index做为 random.nex ...
分类:其他好文   时间:2020-06-27 09:49:41    阅读次数:57
0303. Range Sum Query - Immutable (E)
Range Sum Query - Immutable (E) 题目 Given an integer array nums, find the sum of the elements between indices i and j (i ≤ j), inclusive. Example: Give ...
分类:其他好文   时间:2020-06-27 09:44:58    阅读次数:46
0304. Range Sum Query 2D - Immutable (M)
恢复内容开始 Range Sum Query 2D - Immutable (M) 题目 Given a 2D matrix matrix, find the sum of the elements inside the rectangle defined by its upper left cor ...
分类:其他好文   时间:2020-06-27 09:36:59    阅读次数:61
Codeforces 1373E - Sum of Digits (构造)
Description 题目大意: $f(x)$为十进制下x每一位上的数字的和。求满足$f(x)+f(x+1)+...+f(x+k)=n$的最小x。 思路 由于k特别小(<=9),故x+k至多发生一次进位。x每加1,必有某一位加上1。如果发生进位,那么$f(x)$只要额外减去若干个9(进位发生后9变 ...
分类:其他好文   时间:2020-06-26 23:57:16    阅读次数:130
[P4735] 最大异或和 - 可持久化Trie
给定一个非负整数序列 $\{a\}$,初始长度为 $n$。 有 $m$ 个操作,有以下两种操作类型: 1. `A x`:添加操作,表示在序列末尾添加一个数 $x$,序列的长度 $n+1$。 2. `Q l r x`:询问操作,你需要找到一个位置 $p$,满足 $l \le p \le... ...
分类:其他好文   时间:2020-06-26 21:53:20    阅读次数:48
21465条   上一页 1 ... 77 78 79 80 81 ... 2147 下一页
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!