select模块 1. select模块 源:select.py This module provides access to the select() and poll() functions available in most operating systems, devpoll() avail ...
分类:
其他好文 时间:
2019-07-25 00:14:30
阅读次数:
142
传送门:QAQQAQ 题意:给你一个序列,求一个子序列a[l]~a[r]使得该子序列的sum(l,r)-k*(r-l+1+m+1)/m值是在所有子序列中最大的,并输出最大值 思路:比赛的时候使用O(n)写的,但是被hack了,因为O(n)无法记录当前距离下一次-k还有多少,若用单调队列维护也不知道前 ...
分类:
其他好文 时间:
2019-07-25 00:10:16
阅读次数:
119
A. Another Chess Problem B. Beauty Of Unimodal Sequence C. Coefficient D. Double Tree E. Everything Is Generated In Equal Probability F. Fantastic Mag ...
分类:
其他好文 时间:
2019-07-24 19:33:36
阅读次数:
155
In this problem, you are given an integer number s. You can transform any integer number A to another integer number B by adding x to A. This x is an ...
分类:
其他好文 时间:
2019-07-24 00:08:43
阅读次数:
106
D. Yet Another Subarray Problem 这个题目很难,我比赛没有想出来,赛后又看了很久别人的代码才理解。 这个题目他们差不多是用一个滑动窗口同时枚举左端点和右端点,具体如下: 首先枚举0~m,这个是说更新的位置,如果是1 当m==3 就更新1 4 7 10... 如果是2,当 ...
分类:
其他好文 时间:
2019-07-23 11:19:13
阅读次数:
119
Design a simplified version of Twitter where users can post tweets, follow/unfollow another user and is able to see the 10 most recent tweets in the u ...
分类:
其他好文 时间:
2019-07-21 16:28:44
阅读次数:
72
一、多态 Python变量并不需要声明类型,同一个变量可以在不同的时间引用不同的对象,当一个变量在调用同一个方法,可以呈现出多种行为,而具体呈现出哪种行为由该变量引用的对象来决定,这就是多态。 先看一下以下例子: 上面的例子中,当涉及Host类的pet()方法时,该方法传入的参数对象只需要具有beh ...
分类:
编程语言 时间:
2019-07-21 16:25:08
阅读次数:
109
Given a string S, we can transform every letter individually to be lowercase or uppercase to create another string. Return a list of all possible stri ...
分类:
其他好文 时间:
2019-07-20 13:01:37
阅读次数:
93
题目描述 Farmer John has bought property in the Caribbean and is going to try to raise dairy cows on a big farm composed of islands. Set in his ways, he w ...
分类:
其他好文 时间:
2019-07-09 13:27:04
阅读次数:
100
"原题链接" 题目大意是有N个数,分成K段,每一段的花费是这个数里相同的数的数对个数,要求花费最小 如果只是区间里相同数对个数的话,莫队就够了 而这里是!边单调性优化边莫队(只是类似莫队)!而移动的次数和分治的复杂度是一样的! 这个时候就不能用单调栈+二分了,得用分治 分治的方法就是$Solve(l ...
分类:
其他好文 时间:
2019-07-05 20:51:22
阅读次数:
83