信息学奥赛一本通T1267-01背包问题(动态规划) 摘要:解题思路:注意事项:参考代码:#include<iostream>using namespace std;int w[31];int c[31];int dp[201] = {0};int main(…… 题解列表 2022年07月31日 0 点赞 0 评论 390 浏览 评分:0.0
不知道为什么用python有一组数据n=12不通过,求大佬教教 摘要:解题思路:注意事项:参考代码:n = int(input())t = 0for i in range(1, n + 1): t += 1 / iprint("%.6f"%t)…… 题解列表 2022年07月31日 0 点赞 2 评论 510 浏览 评分:0.0
十进制转八进制(递归解法) 摘要:解题思路:递归注意事项:参考代码:#include <stdio.h>void f(int n){ int r; r = n % 8; if(n >= 8) …… 题解列表 2022年07月31日 0 点赞 0 评论 399 浏览 评分:0.0
公约公倍(辗转相除法) 摘要:解题思路:最大公约数用辗转相除,最小公倍数为两数之积除以最小公倍数注意事项:参考代码:#include<stdio.h>int a(int m,int n){ return (m%n==0)?n…… 题解列表 2022年07月31日 0 点赞 0 评论 253 浏览 评分:0.0
[编程入门]三个字符串的排序:不断strcpy 摘要:解题思路:类比a,b,c三个数比较大小注意事项:字符串内置函数的使用方法参考代码:#include<stdio.h>#include<string.h>int main(){ char a[100],…… 题解列表 2022年07月31日 0 点赞 0 评论 375 浏览 评分:0.0
题解 1125: C语言训练-委派任务* 摘要:解题思路:注意事项:参考代码:#include<stdio.h>int main(void){ int i; int a[6]={0}; for(a[0]=0;a[0]<2;a[0]++) for(…… 题解列表 2022年07月31日 0 点赞 0 评论 316 浏览 评分:0.0
信息学奥赛一本通T1268-完全背包问题(C++) 摘要:解题思路:注意事项:参考代码:#include<iostream>using namespace std;int w[31];int c[31];int dp[201] = {0};int main(…… 题解列表 2022年07月31日 0 点赞 0 评论 272 浏览 评分:0.0
1142: C语言训练-立方和不等式(不用提示的算法,用减法实现) 摘要:解题思路:注意事项:参考代码:#include<stdio.h>int main(void){ int i; long long n; scanf("%lld",&n) ; for(i=1;;i++)…… 题解列表 2022年07月31日 0 点赞 0 评论 395 浏览 评分:0.0
1157: 亲和数 摘要:解题思路: ①在while 循环外 规定计数变量初值h, 在while循环内 将变量h++(每输入一次A,B),直至变量h>=M(结束输入A,B的值) ②…… 题解列表 2022年07月31日 0 点赞 0 评论 382 浏览 评分:0.0
辗转相除法 求最大公约数 摘要:解题思路: 先了解最大公约数与最小公倍数的关系,即 两数乘积除以最大公约数等于最小公倍数 也就是说求出最大公约数也就求出了最小公倍数 …… 题解列表 2022年07月31日 0 点赞 0 评论 292 浏览 评分:0.0