题解列表

筛选

白细胞计数 学习新函数

摘要:解题思路:利用冒泡排序,直接从小到大排好数组顺序(或者利用algorithm库的sort函数排序)再利用cmath库求绝对值和较大的数省去重复利用if-else函数,使代码更简洁客观参考代码:int ……

2875: 回文子串

摘要:解题思路:注意事项:参考代码:#include <stdlib.h> #include <stdio.h> #include <iostream> #include <string.h> us……

动态规划通用题解,学会了就都懂了

摘要:解题思路:二维数组填表来实现注意事项:vtype代表的是价值和体重的类型如果可以,自己实现一个函数不用max函数是最优解,即可达到动态规划公式参考代码:#include <iostream>using……

2872: 字符环

摘要:解题思路:注意事项:参考代码:#include <stdlib.h> #include <stdio.h> #include <iostream> #include <string.h> us……

暴力拆解 分解质因数 直接算出最小的质因数

摘要:解题思路:某数已知是两个质数的乘积,这里设为n大质数设为b;小指数设为a根号下n一定大于较小的质数a(可数学验证),以此解决计算时间超时的问题参考代码:int n;scanf("%d",&n);int……

题解 2767: 计算多项式的值

摘要:解题思路:注意事项:参考代码:#include<bits/stdc++.h>using namespace std;int main(){    int a,b;    cin>>a>>b;    p……

题解 3003: 鸡兔同笼问题

摘要:解题思路:注意事项:参考代码:#include <bits/stdc++.h>using namespace std;int main(){    double a;    cin>>a;    pr……

题解 3003: 鸡兔同笼问题

摘要:解题思路:注意事项:参考代码:#include<iostream>using namespace std;int main(){   int a,b;   cin>>a>>b;   cout<<(4*……