传送门 "Luogu" 解题思路 看到正负号相互抵消,很容易联想到括号匹配和栈。 但由于题目钦定了一些位置只能是负数,所以我们可以这样考虑: 把负数视为右括号,正数视为左括号,然后开一个栈,从右往左遍历,能匹配就匹配。 如果能匹配但是不匹配,一定不会更优,这是显然易见的。 细节注意事项 + 咕咕咕 ...
分类:
其他好文 时间:
2019-10-27 11:00:49
阅读次数:
85
random() random()方法不能直接访问,需要导入random模块,然后通过random静态对象调用该方法 random.randint(a,b)函数指定范围内随机数生成,其中参数a是最低限,参数b是上限 random.random()方法适用于生成0到1的随机浮点数 random.uni ...
分类:
编程语言 时间:
2019-10-26 17:39:25
阅读次数:
121
区间驱魔?看你大于模数吗,大就上,否则回家。 会不会$T$?每次驱魔至少变$\frac{1}{2}$,所以$log$,不怂 注意到叶子才更新 ...
分类:
其他好文 时间:
2019-10-25 13:41:44
阅读次数:
63
写在前面 这次模拟赛,难度。。。还可以吧。因为是欢乐赛,所以打的很开心 T1序列(sequence) "链接" Idea 本来想开个桶的,然后看到了$a_i \le 10^9$。于是我就开了个 这算是道模拟题吧。具体看代码,很好懂的。 Code cpp namespace Sol{ map m;// ...
分类:
其他好文 时间:
2019-10-25 10:26:03
阅读次数:
66
需求描述1.需要在三台路由器上配置静态路由,以实现各网段之间的互通2.若要实现全网互通,必须明确如下两个问题数据包被路由器转发或丢弃,取决于是否能够在路由表中找到数据包的目标地址所对应的条目路由器可以自动生成所有直连网段的路由条目,对于那些非直连网段就需要通过静态路由指定了3.因此,要想实现全网互通,就必须为每台路由器指定所有非直连网段的路由条目实验环境三台路由器R1、R2、R3两两互连,每台路由
分类:
其他好文 时间:
2019-10-22 22:14:23
阅读次数:
154
这个错误,在使用List<T>的First函数遇到。 Sequence contains no elements? From "Fixing LINQ Error: Sequence contains no elements": When you get the LINQ error "Sequen ...
分类:
其他好文 时间:
2019-10-22 12:58:20
阅读次数:
158
1 enumerate() enumerate() 函数用于将一个可遍历的数据对象(如列表、元组或字符串)组合为一个索引序列,同时列出数据和数据下标,一般用在 for 循环当中。 以下是 enumerate() 方法的语法: sequence -- 一个序列、迭代器或其他支持迭代对象。 start ...
分类:
其他好文 时间:
2019-10-21 23:23:45
阅读次数:
189
Given an input string, reverse the string word by word. Example 1: Example 2: Example 3: Note: A word is defined as a sequence of non-space characters ...
分类:
其他好文 时间:
2019-10-21 10:06:02
阅读次数:
91
Given two words (beginWord and endWord), and a dictionary's word list, find the length of shortest transformation sequence from beginWord to endWord, ...
分类:
其他好文 时间:
2019-10-21 09:18:22
阅读次数:
80
题目: Given an unsorted array of integers, find the length of longest increasing subsequence. Example: Note: There may be more than one LIS combination, ...
分类:
编程语言 时间:
2019-10-20 19:57:56
阅读次数:
102