2544: N以内累加求和,C++ 摘要:解题思路:do while求累加注意事项:参考代码:#include <iostream>using namespace std;int main(){ int n; int sum=0;…… 题解列表 2022年06月07日 0 点赞 0 评论 685 浏览 评分:9.9
1089: A+B for Input-Output Practice (V) 摘要:解题思路:双while注意事项:参考代码:#include <iostream>#include <cmath>using namespace std;int main(){ int count…… 题解列表 2022年06月07日 0 点赞 0 评论 441 浏览 评分:0.0
A+B for Input-Output Practice (II) ,C++解题 摘要:解题思路:用while注意事项:参考代码:#include<iostream>#include<cmath>using namespace std;int main(){ int k; i…… 题解列表 2022年06月07日 0 点赞 0 评论 585 浏览 评分:0.0
二级C语言-分段函数,C++解决 摘要:解题思路:setprecision函数控制cout的输出小数位数注意事项:参考代码:#include<iostream>#include<iomanip>//控制小数位的头文件using namesp…… 题解列表 2022年06月07日 0 点赞 0 评论 695 浏览 评分:9.9
新手学习,C++解决 摘要:解题思路:pow求立方注意事项:参考代码:#include<iostream>#include<cmath>using namespace std;int main(){ int n; i…… 题解列表 2022年06月07日 0 点赞 0 评论 745 浏览 评分:9.9
蓝桥杯2021年第十二届国赛真题-异或变换 打表发现当n=1时,异或1次循环n=2时,2次循环n=3,4次n=4,4次n=5,8次......显然可得,当数串长度为n时,异或2^(log2(n)+1)次即可重新得到此串因此,对t取模,模拟剩余次数即可得到答案注意开longlong```cpp#includeusingnamespacestd;t 题解列表 2022年06月05日 0 点赞 0 评论 1093 浏览 评分:4.0
[编程入门]矩阵对角线求和【C++版】 解题思路:首先需要寻找矩阵的规律,主对角线元素的横纵坐标相同,副对角线元素的横纵坐标相加等于矩阵的行数(列数),定义变量i、j分别表示矩阵的横纵坐标,定义变量sum1,sum2分别表示主对角线元素的和与副对角线元素的和,然后用双重for循环遍历整个矩阵, 题解列表 2022年06月04日 0 点赞 0 评论 1635 浏览 评分:7.8
优质题解 一伯分代码和思路 摘要:刚看到这个题,想到的就是i从1到n遍历,每个i出现做为因子的个数是(n/i),全部加起来就可以了 代码:const LL mod=1000000007; LL ans=0; int ma…… 题解列表 2022年06月04日 0 点赞 6 评论 1934 浏览 评分:8.4
1030: [编程入门]二维数组的转置 摘要:解题思路:定义一个交换函数,再掉用就可以了。注意事项:注意储存有没有被交换过的数组b要清空~参考代码:#include<bits/stdc++.h> using namespace std; vo…… 题解列表 2022年06月04日 0 点赞 1 评论 448 浏览 评分:9.9
信息学奥赛一本通T1598-最大连续和-题解(各语言代码) 题意为求区间和的最大值可分为两步解决:第一步求区间和,第二步求区间最大值区间求和最高效的方式是前缀和,而区间最值可以用单调队列解决时间复杂度O(n),空间复杂度O(m)**C++**```cpp#include#includeusingnamespacestd;intmain(){ios::sync_ 题解列表 2022年06月03日 0 点赞 0 评论 978 浏览 评分:2.0