题解列表
一种超简单标准的枚举方法
摘要:解题思路:注意事项:参考代码:#include<stdio.h>int main(){ enum play{lose=-1,equality,win} result; int a,b; ……
时间复杂度的O(n)算法
摘要:解题思路:注意事项:参考代码:#include<bits/stdc++.h>using namespace std;#define maxn 100010#define maxk 100010//0 ……
时间复杂度O(n)的算法
摘要:解题思路:注意事项:参考代码:#include<bits/stdc++.h>using namespace std;#define maxn 100010//−100000≤ Ai ≤100000ty……
3050: 最长上升子序列(线性dp)
摘要:题目描述:给定一个长度为N的数列,求数值严格单调递增的子序列的长度最长是多少。
解题思路:线性dp
1.状态表示: 所有以i结尾的严格单调上升的子序列的长度的集合(MAX)
2.状态计算: 只需……
【Python】编写题解 1981: 输出M到N的数
摘要:注意事项:利用range()函数循环输出参考代码:M, N = map(int, input().split())
if M<N:
for i in range(M+1, N+1):
……
【Python】1984: 蓝桥杯算法提高VIP-求圆面积表面积体积
摘要:注意事项:格式化输出参考代码:r = float(input())
pi = 3.1415926536
s1 = pi*r**2
s2 = 4*pi*r**2
v = 4*pi*r**3/3
……