06 2021 档案
-
算法提高--数字三角形模型
摘要:https://www.acwing.com/problem/content/900/ 注意处理边界即可。 1 #include <iostream> 2 #include <cstring> 3 #include <algorithm> 4 using namespace std; 5 const 阅读全文
-
数据结构--线段树
摘要:线段树的基本思想是分治。 此处的是简单线段树,即只支持单点修改,区间查询,不涉及懒标记。 树的每一个节点维护一个区间 [ l , r ] 的值,其子节点的区间的并集等于这个区间的值,左儿子维护[l , mid] ,右儿子维护[ mid+1 , r ]。 树的高度为log(n),所以更新操作的时间复杂 阅读全文
-
leetcode周赛 243
摘要:A:水题。 https://leetcode-cn.com/problems/check-if-word-equals-summation-of-two-words/ 1 class Solution { 2 public: 3 int tans(string s){ 4 int res=0; 5 阅读全文
-
AcWing周赛 1
摘要:A:水题。 给定两个数组,找到从这俩数组中各找一数,使得和不在任何一个数组中。 因为数组中的数都是正整数,最大的俩数相加必然不在这俩数组之中。 1 #include <iostream> 2 #include <cstring> 3 #include <algorithm> 4 using name 阅读全文