利用math中的求余 摘要:解题思路:注意事项:参考代码:#include <stdio.h>#include <math.h>double a, b, r;int main() { scanf("%lf%lf", &a, &b…… 题解列表 2024年11月21日 0 点赞 0 评论 279 浏览 评分:0.0
普普通通的解题方法 摘要:解题思路:注意事项:参考代码:#include<stdio.h>int main(){int a,b,c;scanf("%d%d%d",&a,&b,&c);if(a*a+b*b==c*c||b*b+c…… 题解列表 2024年11月21日 0 点赞 0 评论 171 浏览 评分:0.0
无虑,无悔,无题。 摘要:解题思路:注意事项:参考代码:#include<stdio.h>int main(){ int m; scanf("%d",&m); switch (m){ case 1 : case 2 :prin…… 题解列表 2024年11月21日 0 点赞 0 评论 179 浏览 评分:0.0
通过将三位数转换为字符串直接for循环输出数组即可 摘要:解题思路:注意事项:参考代码:#include<iostream>#include<string>using namespace std;int main(){ int a; cin>>a; …… 题解列表 2024年11月21日 0 点赞 0 评论 132 浏览 评分:0.0
2048: 多重背包一眼丁真 摘要:解题思路: 在01背包的基础上再套多一层循环以表示该物品的个数注意事项:参考代码:#include<stdio.h> #define max(x,y) ((x)>(y)?(x):(y)…… 题解列表 2024年11月21日 0 点赞 0 评论 125 浏览 评分:0.0
For循环解题 摘要:解题思路:注意事项:参考代码:#include<stdio.h>int main(){ int i,a[3],t; for (i = 0;i < 3;i++) { scanf("%d",&a[i]…… 题解列表 2024年11月21日 0 点赞 0 评论 157 浏览 评分:0.0
完全背包问题,记忆化搜索,不能暴力了呜呜呜呜呜 摘要:解题思路:注意事项:参考代码:#include"bits/stdc++.h" using namespace std; // 定义全局变量,m表示背包容量,n表示物品数量,h初始化为-1 int…… 题解列表 2024年11月21日 0 点赞 0 评论 114 浏览 评分:0.0
超简单思路+代码 # 1453: 蓝桥杯历届试题-翻硬币 (C++) 摘要:- 思路:遍历每个位置,只要当前位置不一样就翻一次,最终得到的答案就是最优解 ```c++ #define _CRT_SECURE_NO_WARNINGS 1 #include #incl…… 题解列表 2024年11月22日 0 点赞 0 评论 280 浏览 评分:0.0
二分 # 1885: 蓝桥杯2017年第八届真题-分巧克力(C++) 摘要:二分思路 最少切边长为1,最多切边长为1e5 如果我们切边长为MID的巧克力 可以满足切出来的巧克力数量 大于等于 小朋友的数量 那么我们可以尝试切>=MID的巧克力(收缩…… 题解列表 2024年11月22日 2 点赞 0 评论 362 浏览 评分:0.0
哈希法 # 2270: 蓝桥杯2016年第七届真题-四平方和(C++) 摘要:这道题显而易见的暴力思路就是三重for循环枚举所有情况 这里有一个全新的思路 => 哈希法 对于四个数字 a b c d (升序排序) 我们定义数组 C[S],D[S], 表示 能凑…… 题解列表 2024年11月22日 0 点赞 0 评论 217 浏览 评分:0.0