题解列表
循环(就是一个01背包问题,大一上学期看了好久,2023蓝桥杯的那个炼铁一样的题型)
摘要:解题思路:注意事项:参考代码:#include<iostream>using namespace std;const int T=101,M=1001;int cost[T],value[T],dp[……
报数问题(本来想用递归来写的,没写出来,水平真的有限【苦涩】,链表实战也不行【哭】)
摘要:解题思路:注意事项:参考代码:#include<stdio.h>int main(){ int n,i,a[100],ko=0,num=0; scanf("%d",&n); for(……
1013-Sn的公式求和
摘要:解题思路:采用高精度加法解决本题。注意事项:参考代码:int arr[1000]={0};
int main(){
int n;
int i,len,j;
len=0;
scanf(……
STL& set[STL训练]{A} + {B}
摘要:# 使用STL库的`set`容器
> 自带去重和排序的功能,就不需要调用排序函数了
```c++
#include
#include
#include
#include
usi……
2977: 日历问题
摘要:```cpp
#include
#include
using namespace std;
int Isrun(int a)
{
if(a%4!=0||a%100==0&&a%400!=……
题目 1400: 教学楼的楼梯题解
摘要:1.解题思路第n层楼可以从第n-1层楼迈一步或从第n-2层楼迈两步,所以有f(n)=f(n-1)+f(n-2)种走法,用数组f表示,也可以用递推,但是时间超限了。2.参考代码2.1.数组法#inclu……