https://leetcode-cn.com/problems/hua-dong-chuang-kou-de-zui-da-zhi-lcof/ https://leetcode-cn.com/problems/min-stack-lcci/ 1. 这两题都是要在O(1)时间内得到当前栈内的最小值 ...
分类:
其他好文 时间:
2021-02-17 14:19:50
阅读次数:
0
While和Do..while循环结构 while(布尔表达式){ //循环内容} 只要布尔表达式为true,循环就会一直执行下去 大多数情况下会让循环停止下来,我们需要一个让表达式失效的方式来结束循环 少数情况需要循环一直进行,比如服务器的请求响应监听 循环条件一直为true就会造成无限循环【死循 ...
分类:
编程语言 时间:
2021-02-17 14:18:15
阅读次数:
0
非常好的一个题。 如果不是看到dp的tag,我可能真不会往dp去想。 首先状压去枚举肯定不行,因为最多100位。 经过仔细思考之后我得出了一个dp状态。 dp[i][j][k] - 表示a[i]为第j位且余数为k的值。 在验证过后,我发现这个状态很可做。 然后就开始推了,并不是很难推,但是这里有一个 ...
分类:
其他好文 时间:
2021-02-17 14:15:41
阅读次数:
0
原题链接 题意简介 根据给定的数组 \(B\),现要求你构造出数组 \(A\),使数组 \(A\) 的每个位置 i,都满足下面的条件: \(A_i=B_i\) 或 \(\sum^i_{j=1}A_j=B_i\) 求问数组 A 的构造方案有多少种? 思路分析 首先,从通过人数上看,这题比 E 题容易。 ...
分类:
其他好文 时间:
2021-02-17 14:08:47
阅读次数:
0
#include<bits/stdc++.h> #define N 300010 using namespace std; #define int long long int h[N],nxt[N],v[N],w[N],s,t,dep[N],ec,p[N],n,a[N],b[N],c[N],f[N] ...
分类:
其他好文 时间:
2021-02-17 14:04:51
阅读次数:
0
未完待续……(只是给自己存个板子) 快速傅里叶变换 #include <bits/stdc++.h> using namespace std; const int maxn = 2e6 + 1e2; struct Cp { double x, y; inline Cp operator +(cons ...
分类:
其他好文 时间:
2021-02-17 14:03:19
阅读次数:
0
最重要的内置类型有数字、序列、映射、类、实例和异常。 真值检测 if和while都可以做真值检测,默认情况下,如果一个对象的__bool__()返回False或者__len__()返回0,那么该对象为假;否则都为真。 因此内置类型为假的情况有: 常量:None和False 任何值为0的数字类型:0, ...
分类:
编程语言 时间:
2021-02-17 14:02:30
阅读次数:
0
Getopts Let’s say you want to allow a user to pass a -v flag to turn on verbose logging in a script. Manually parsing out options passed to a script i ...
分类:
其他好文 时间:
2021-02-16 12:03:18
阅读次数:
0
如果求导之后没有任何非零项,需要输出0 0。 int main() { string line; getline(cin,line); stringstream ss(line); int a,b; bool first=true; while(ss>>a>>b) { a*=b; b--; if(b ...
分类:
其他好文 时间:
2021-02-16 11:53:11
阅读次数:
0
jq Bash, unfortunately, doesn’t ship with a command that can work with JSON natively. In this lesson, we’ll learn how to read and do basic queries on ...
分类:
Web程序 时间:
2021-02-15 12:41:34
阅读次数:
0