AtCoder Beginner Contest 172 题解,地址https://atcoder.jp/contests/abc172/ ...
分类:
其他好文 时间:
2020-06-27 22:51:37
阅读次数:
159
函数 定义函数 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
给定一棵大小为 \(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
一、1486. 数组异或操作: 给你两个整数,n 和 start 。 数组 nums 定义为:nums[i] = start + 2*i(下标从 0 开始)且 n == nums.length 。 请返回 nums 中所有元素按位异或(XOR)后得到的结果。 示例: 输入:n = 5, start ...
分类:
其他好文 时间:
2020-06-27 12:00:16
阅读次数:
65
MySQL关系型数据库RDS中的老大哥,增删改查是MySQL入门的基础 增删改查语句增删改查的语句命令为 增:insert删:delete改:update查:SELECT或者show 库操作 创建数据库:create database shujukuba;创建带字符集的数据库:create data ...
分类:
数据库 时间:
2020-06-27 10:11:02
阅读次数:
277
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
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
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
恢复内容开始 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