DP入门 # 2809: 菲波那契数列 摘要:``` // 注意这道题第一下项的下标为0,所以我们最后输出的是dp[n-1] #include #include #include #include using namespace …… 题解列表 2024年10月25日 1 点赞 0 评论 275 浏览 评分:0.0
1501: 蓝桥杯算法提高VIP-分苹果 摘要:这道题考察前缀和 , 差分 - 前缀和数组 : 定义一个数组 , 该数组 记录了 数列的前x个值的和 - 例如 数列 1 2 3 4 5,前缀和数组为a[N] 那么a[1]=1,a[…… 题解列表 2024年10月25日 0 点赞 4 评论 189 浏览 评分:0.0
模拟 #2911: 连续出现的字符 摘要:``` #include #include #include #include using namespace std; int main() { char str[1010]…… 题解列表 2024年10月25日 0 点赞 0 评论 146 浏览 评分:9.9
sort# 2332: 信息学奥赛一本通T1181-整数奇偶排序 摘要:``` #include #include #include using namespace std; int main() { //定义两个数组分别存放奇数和偶数 int …… 题解列表 2024年10月25日 0 点赞 0 评论 156 浏览 评分:0.0
冒泡排序# 信息学奥赛一本通T1310-车厢重组 摘要:``` #include #include #include using namespace std; const int N = 1e4 + 10; int a[N]; int…… 题解列表 2024年10月25日 1 点赞 0 评论 248 浏览 评分:0.0
哈希法,map+vector法# 2974: 统计字符数 摘要:[TOC] # 哈希法 ``` #include #include using namespace std; //统计每个字符出现的次数,因为有26个字母,所以开到26 int …… 题解列表 2024年10月25日 0 点赞 0 评论 126 浏览 评分:0.0
while+for : 2833: 金币 摘要:``` #include using namespace std; int main() { int n; cin >> n; //IDX:用来表示当前发多少硬币 …… 题解列表 2024年10月25日 0 点赞 0 评论 166 浏览 评分:0.0
2837: 年龄与疾病(超简单思路) 摘要:解题思路:注意事项:参考代码:#include<stdio.h>int main(){ int i,a[100]; double n,b=0,c=0,d=0,f=0,sum1=0,sum2…… 题解列表 2024年10月24日 0 点赞 0 评论 231 浏览 评分:0.0
2836: 数组逆序重放 摘要:解题思路:注意事项:参考代码:#include<stdio.h>int main(){ int a[100],b[100],n,i; scanf("%d",&n); for( i=0…… 题解列表 2024年10月24日 0 点赞 0 评论 253 浏览 评分:0.0
1098: 陶陶摘苹果 摘要:解题思路:注意事项:参考代码:#include<stdio.h>int main(){ int a[100],b=0,c=10,d=0,i; for( i=0;i<c;i++) { …… 题解列表 2024年10月24日 0 点赞 0 评论 201 浏览 评分:0.0