题解列表
优质题解
题解 1105: 数列
摘要:解题思路:(1)观察序列:30,31,30+31,32,30+32,31+32,30+31+32,…(2)发现可以写成:30*1,31*1+30*0,31*1+30*1,32*1+31*0+30*0,……
很简单,三行搞定,容易理解
摘要:解题思路:注意事项:参考代码:def func(c): return 32+c*9/5for i in range(-100,151,5): print('c={}->f={}&#……
十六进制转八进制(C++)
摘要:解题思路:将十六进制先转为十进制,再转为八进制参考代码:#include<iostream>#include<cstring>#include<cmath>using namespace std;in……
我写的有点复杂,死办法,将就看就好了
摘要:解题思路:注意事项:参考代码:list=list(map(int,input().split()))list2=[i for i in list if i>=0]list3=[v for v in l……
深搜c++ 题目陷阱
摘要:解题思路:注意事项:输入cin>>n>>m通常默认为行数和列数,这里题目规定先输入列数,在输入行数参考代码:#include<iostream>
using namespace std;
int ……
0/1背包问题,一维数组求解
/*背包问题基本01:递推公式:w[i]:商品占用价值;val[i]:商品价值;f[v]=max(f[v],f[v-w[i]]+val[i])*/```#include#include#includeusingnamespacestd;constintmaxn=1e4;intf[maxn];intw[
编写题解 1027: [编程入门]自定义函数处理最大公约数与最小公倍数(递归法)
摘要:解题思路:注意事项:参考代码:m,n=map(int,input().split())def maxgongyue(m,n): if n != 0 : return maxgong……
数据结构-折半插入排序
摘要:解题思路:注意事项:参考代码:#include<bits/stdc++.h>using namespace std;int a[100005],n;int main(){ cin>>n; for……