06 2024 档案

摘要:循环结构参考资料:https://blog.csdn.net/m0_56945138/article/details/118929416需要掌握:1.for循环用法2.while循环用法3.continue跳过 和 break终止 题号 题目名称 题解链接 3067 输出范围内的整数 https:/ 阅读全文
posted @ 2024-06-30 22:58 CRt0729 阅读(14) 评论(0) 推荐(0) 编辑
摘要:解法一:循环倒叙一个个找 #include<bits/stdc++.h> #define f(i,s,e) for(int i = s; i <= e; i++) #define ll long long using namespace std; const int N = 1e3+10,inf = 阅读全文
posted @ 2024-06-30 22:55 CRt0729 阅读(45) 评论(0) 推荐(0) 编辑
摘要:解法一:循环找 #include<bits/stdc++.h> #define f(i,s,e) for(int i = s; i <= e; i++) #define ll long long using namespace std; const int N = 1e3+10,inf = 0x3f 阅读全文
posted @ 2024-06-30 22:53 CRt0729 阅读(45) 评论(0) 推荐(0) 编辑
摘要:#include<bits/stdc++.h> #define f(i,s,e) for(int i = s; i <= e; i++) #define ll long long using namespace std; const int N = 1e3+10,inf = 0x3f3f3f3f; 阅读全文
posted @ 2024-06-30 22:50 CRt0729 阅读(38) 评论(0) 推荐(0) 编辑
摘要:#include<bits/stdc++.h> #define f(i,s,e) for(int i = s; i <= e; i++) #define ll long long using namespace std; const int N = 1e3+10,inf = 0x3f3f3f3f; 阅读全文
posted @ 2024-06-30 22:49 CRt0729 阅读(21) 评论(0) 推荐(0) 编辑
摘要:#include<bits/stdc++.h> #define f(i,s,e) for(int i = s; i <= e; i++) #define ll long long using namespace std; const int N = 1e3+10,inf = 0x3f3f3f3f; 阅读全文
posted @ 2024-06-30 22:49 CRt0729 阅读(18) 评论(0) 推荐(0) 编辑
摘要:#include<bits/stdc++.h> #define f(i,s,e) for(int i = s; i <= e; i++) #define ll long long using namespace std; const int N = 1e3+10,inf = 0x3f3f3f3f; 阅读全文
posted @ 2024-06-30 22:48 CRt0729 阅读(83) 评论(0) 推荐(0) 编辑
摘要:#include<bits/stdc++.h> using namespace std; typedef long long ll; const int N = 1e3+10,inf = 0x3f3f3f3f; map<ll,ll> ma; ll n,x; int main() { cin >> n 阅读全文
posted @ 2024-06-30 22:46 CRt0729 阅读(17) 评论(0) 推荐(0) 编辑
摘要:#include<bits/stdc++.h> #define f(i,s,e) for(int i = s; i <= e; i++) #define ll long long using namespace std; const int N = 1e3+10,inf = 0x3f3f3f3f; 阅读全文
posted @ 2024-06-30 22:45 CRt0729 阅读(103) 评论(0) 推荐(0) 编辑
摘要:#include <iostream> using namespace std; int main(){ int n; cin >> n; int sum = 0; //统计位数 while(n != 0) { sum++; n /= 10; //每分割一位数就统计位数+1 } cout << su 阅读全文
posted @ 2024-06-30 22:45 CRt0729 阅读(57) 评论(0) 推荐(0) 编辑
摘要:#include<bits/stdc++.h> using namespace std; int main() { //1 - n int n , sum = 0; cin >> n; for(int i = 1; i <= n; i++) { if(i % 3 == 0 || i % 5 == 0 阅读全文
posted @ 2024-06-30 22:44 CRt0729 阅读(28) 评论(0) 推荐(0) 编辑
摘要:#include<bits/stdc++.h> #define f(i,s,e) for(int i = s; i <= e; i++) #define ll long long using namespace std; const int N = 1e3+10,inf = 0x3f3f3f3f; 阅读全文
posted @ 2024-06-28 18:00 CRt0729 阅读(13) 评论(0) 推荐(0) 编辑
摘要:#include<bits/stdc++.h> using namespace std; int main() { int n; cin >> n; int sum = 0; for(int i = 1;i <= n;i++) { int x; cin >> x; sum += x; //把每一个输 阅读全文
posted @ 2024-06-28 17:59 CRt0729 阅读(68) 评论(0) 推荐(0) 编辑
摘要:#include<bits/stdc++.h> #define f(i,s,e) for(int i = s; i <= e; i++) #define ll long long using namespace std; const int N = 1e3+10,inf = 0x3f3f3f3f; 阅读全文
posted @ 2024-06-28 17:58 CRt0729 阅读(25) 评论(0) 推荐(0) 编辑
摘要:#include<bits/stdc++.h> #define f(i,s,e) for(int i = s; i <= e; i++) #define ll long long using namespace std; const int N = 1e3+10,inf = 0x3f3f3f3f; 阅读全文
posted @ 2024-06-28 17:56 CRt0729 阅读(15) 评论(0) 推荐(0) 编辑
摘要:#include<bits/stdc++.h> #define f(i,s,e) for(int i = s; i <= e; i++) #define ll long long using namespace std; const int N = 1e3+10,inf = 0x3f3f3f3f; 阅读全文
posted @ 2024-06-28 17:55 CRt0729 阅读(10) 评论(0) 推荐(0) 编辑
摘要:#include<bits/stdc++.h> #define f(i,s,e) for(int i = s; i <= e; i++) #define ll long long using namespace std; const int N = 1e3+10,inf = 0x3f3f3f3f; 阅读全文
posted @ 2024-06-28 17:52 CRt0729 阅读(79) 评论(0) 推荐(0) 编辑
摘要:#include<bits/stdc++.h> #define f(i,s,e) for(int i = s; i <= e; i++) #define ll long long using namespace std; const int N = 1e3+10,inf = 0x3f3f3f3f; 阅读全文
posted @ 2024-06-28 17:51 CRt0729 阅读(24) 评论(0) 推荐(0) 编辑
摘要:我比较喜欢解法二的for 解法1:while循环 #include<bits/stdc++.h> using namespace std; typedef long long ll; const int N = 1e3+10,inf = 0x3f3f3f3f; int main() { int n, 阅读全文
posted @ 2024-06-28 17:47 CRt0729 阅读(11) 评论(0) 推荐(0) 编辑
摘要:主要就是让你学会如何循环范围、奇数范围、偶数范围 #include<bits/stdc++.h> using namespace std; typedef long long ll; const int N = 1e3+10,inf = 0x3f3f3f3f; int main() { for(in 阅读全文
posted @ 2024-06-28 17:45 CRt0729 阅读(39) 评论(0) 推荐(0) 编辑
摘要:结构体排序参考资料:https://blog.csdn.net/weixin_44959377/article/details/102381323需要掌握的知识点有:1.掌握结构体的定义2.定义结构体数组3.自定义结构体排序函数4.掌握sort函数的应用5.掌握cmp自定义比较函数的应用 题号 题目 阅读全文
posted @ 2024-06-28 17:36 CRt0729 阅读(114) 评论(0) 推荐(0) 编辑
摘要:孩子,别被误导了,结构体数组,咱们可以开两个的^^ #include<bits/stdc++.h> #define f(i,s,e) for(int i = s; i <= e; i++) #define ll long long using namespace std; const int N = 阅读全文
posted @ 2024-06-28 17:34 CRt0729 阅读(72) 评论(0) 推荐(0) 编辑
摘要:喜欢这么多条件判断的程序嘛?^^ #include<bits/stdc++.h> #define f(i,s,e) for(int i = s; i <= e; i++) #define ll long long using namespace std; const int N = 1e3+10,i 阅读全文
posted @ 2024-06-28 17:33 CRt0729 阅读(26) 评论(0) 推荐(0) 编辑
摘要:#include<bits/stdc++.h> using namespace std; struct node{ int yw,sx,yy,zf,id; }; node a[301]; bool comp(node a,node b) { //总分高优先,总分相同,语文成绩高优先,语文相同,顺序小 阅读全文
posted @ 2024-06-28 17:30 CRt0729 阅读(65) 评论(0) 推荐(0) 编辑
摘要:#include<bits/stdc++.h> using namespace std; struct node{ int yw,sx,yy,zf,id; //yw语文、sx数学、yy英语、zf总分、id顺序 }; node a[301]; bool comp(node a,node b) { // 阅读全文
posted @ 2024-06-28 17:28 CRt0729 阅读(40) 评论(0) 推荐(0) 编辑
摘要:#include<bits/stdc++.h> #define f(i,s,e) for(int i = s; i <= e; i++) #define ll long long using namespace std; const int N = 1e3+10,inf = 0x3f3f3f3f; 阅读全文
posted @ 2024-06-28 17:27 CRt0729 阅读(32) 评论(0) 推荐(0) 编辑
摘要:#include<bits/stdc++.h> #define f(i,s,e) for(int i = s; i <= e; i++) #define ll long long using namespace std; const int N = 1e3+10,inf = 0x3f3f3f3f; 阅读全文
posted @ 2024-06-28 17:26 CRt0729 阅读(67) 评论(0) 推荐(0) 编辑
摘要:这里的基础语法的课程大纲及对应的题单题解,有链接就是我发了,没有了就是我懒了^^,欢迎催更 课程名称 题解链接 初识C++ 顺序结构 选择结构 循环结构 嵌套循环 一维数组 二维数组 字符数组 字符串 函数 结构体排序 https://www.cnblogs.com/jyssh/p/18274023 阅读全文
posted @ 2024-06-28 17:19 CRt0729 阅读(41) 评论(0) 推荐(0) 编辑
摘要:这里是各个算法的超链接,有就有,没有就是笔者懒了,欢迎催更^^ 时间复杂度 枚举 https://www.cnblogs.com/jyssh/p/18273285 模拟 贪心 递推 递归 二分 数据结构 - 栈 数据结构 - 队列 数据结构 - 图 数据结构 - 树 高级算法 - 深度优先搜索 高级 阅读全文
posted @ 2024-06-28 15:56 CRt0729 阅读(28) 评论(0) 推荐(0) 编辑
摘要:因为它,我学会了sscanf ^^ #include<bits/stdc++.h> using namespace std; typedef long long ll; const int N = 1e3+10,inf = 0x3f3f3f3f; map<string,int> p; int n; 阅读全文
posted @ 2024-06-28 15:15 CRt0729 阅读(17) 评论(0) 推荐(0) 编辑
摘要:NB,标签大王 也可以知道,就是队列模拟了 #include<bits/stdc++.h> using namespace std; typedef long long ll; const int N = 3e5+10; struct node{ int t,x; }; queue<node>q; 阅读全文
posted @ 2024-06-28 15:14 CRt0729 阅读(11) 评论(0) 推荐(0) 编辑
摘要:解法一:我也不记得怎么做了,就记得好像是不断拼接字符串,然后用map做判断去重 #include<bits/stdc++.h> using namespace std; typedef long long ll; const int N = 1e3+10,inf = 0x3f3f3f3f; int 阅读全文
posted @ 2024-06-28 15:12 CRt0729 阅读(77) 评论(0) 推荐(0) 编辑
摘要:转自:lugo的题解,注释比较多,还算是比较清晰 #include<iostream> #include<cstring> #include<algorithm> #include<cmath> using namespace std; int x11,y11,x22,y22,minn=400001 阅读全文
posted @ 2024-06-28 15:09 CRt0729 阅读(29) 评论(0) 推荐(0) 编辑
摘要:#include<bits/stdc++.h> #define f(i,s,e) for(int i=s;i<=e;i++) using namespace std; typedef long long ll; const int N=1e6+10,inf=0x3f3f3f3f; int a[N], 阅读全文
posted @ 2024-06-28 15:08 CRt0729 阅读(51) 评论(0) 推荐(0) 编辑
摘要:思路:每次找出剩下瓶子的最小值,交换到前面去 #include<bits/stdc++.h> #define f(i,s,e) for(int i = s; i <= e; i++) #define ll long long using namespace std; const int N = 1e 阅读全文
posted @ 2024-06-28 15:04 CRt0729 阅读(7) 评论(0) 推荐(0) 编辑
摘要:#include<bits/stdc++.h> #define f(i,s,e) for(int i = s; i <= e; i++) #define ll long long using namespace std; const int N = 1e4+10,inf = 0x3f3f3f3f; 阅读全文
posted @ 2024-06-28 14:59 CRt0729 阅读(23) 评论(0) 推荐(0) 编辑
摘要:思路:非常经典的先循环,然后check(i)是否满足条件 #include<bits/stdc++.h> #define f(i,s,e) for(int i = s; i <= e; i++) #define ll long long using namespace std; const int 阅读全文
posted @ 2024-06-28 14:57 CRt0729 阅读(51) 评论(0) 推荐(0) 编辑
摘要:思路:先通过数列第1、2小的值求最大公约数得到公差,然后再推算出项数公式算有多少项 #include<bits/stdc++.h> #define f(i,s,e) for(int i = s; i <= e; i++) #define ll long long using namespace st 阅读全文
posted @ 2024-06-28 14:56 CRt0729 阅读(62) 评论(0) 推荐(0) 编辑
摘要:#include<bits/stdc++.h> #define f(i,s,e) for(int i = s; i <= e; i++) #define ll long long using namespace std; const int N = 2e6+10,inf = 0x3f3f3f3f; 阅读全文
posted @ 2024-06-28 14:53 CRt0729 阅读(14) 评论(0) 推荐(0) 编辑
摘要:#include<bits/stdc++.h> using namespace std; typedef long long ll; const int N = 1e3+10,inf = 0x3f3f3f3f; int main() { int money = 0,c = 0,s; for(int 阅读全文
posted @ 2024-06-28 14:51 CRt0729 阅读(10) 评论(0) 推荐(0) 编辑
摘要:#include<bits/stdc++.h> #define f(i,s,e) for(int i = s; i <= e; i++) #define ll long long using namespace std; const int N = 1e3+10,inf = 0x3f3f3f3f; 阅读全文
posted @ 2024-06-28 14:51 CRt0729 阅读(18) 评论(0) 推荐(0) 编辑
摘要:#include<bits/stdc++.h> #define f(i,s,e) for(int i = s; i <= e; i++) #define ll long long using namespace std; const int N = 1e3+10,inf = 0x3f3f3f3f; 阅读全文
posted @ 2024-06-28 14:49 CRt0729 阅读(50) 评论(0) 推荐(0) 编辑
摘要:#include<bits/stdc++.h> #define f(i,s,e) for(int i = s; i <= e; i++) #define ll long long using namespace std; const int N = 1e6+10,inf = 0x3f3f3f3f; 阅读全文
posted @ 2024-06-28 14:48 CRt0729 阅读(32) 评论(0) 推荐(0) 编辑
摘要:#include<bits/stdc++.h> #define f(i,s,e) for(int i = s; i <= e; i++) #define ll long long using namespace std; const int N = 1e3+10,inf = 0x3f3f3f3f; 阅读全文
posted @ 2024-06-28 14:47 CRt0729 阅读(10) 评论(0) 推荐(0) 编辑
摘要:描述 键盘输入 N,N 在 2 至 2000 之间,求 2 至 N 中的亲密数对,就是 A 的因子和等于 B,B 的因子和等于 A,且 A=B。 如 48 和 75 是亲密数对。48 的因子和为 2+3+4+6+8+12+16+24=75,而75的因子和为 3+5+15+25=48。 输入描述 只 阅读全文
posted @ 2024-06-28 14:46 CRt0729 阅读(76) 评论(0) 推荐(0) 编辑
摘要:描述 因子:因子也叫因数,例如 3×5=15,那么 3 和 5 是 15 的因子。同时 15×1=15,那么 1 和 15 也是 15 的因子。 1,3,5,15 这四个因子是 15 的所有因子。完数:如果一个数等于不含它本身的其他因子之和,则称该数为‘完数’。如 6 的因子有 1,2,3,6,且  阅读全文
posted @ 2024-06-28 14:45 CRt0729 阅读(51) 评论(0) 推荐(0) 编辑
摘要:描述 “百鸡问题”是出自我国古代《张丘建算经》的著名数学问题。大意为:“每只公鸡 5 元,每只母鸡 3 元,每 3 只小鸡 1 元;现在有 100 元,买了 100 只鸡,共有多少种方案?”小明很喜欢这个故事,他决定对这个问题进行扩展,并使用编程解决:如果每只公鸡 x元,每只母鸡 y 元,每 z 只 阅读全文
posted @ 2024-06-28 14:44 CRt0729 阅读(181) 评论(0) 推荐(0) 编辑
摘要:描述 我国古代数学家张丘建在《算经》一书中提出的数学问题:鸡翁一值钱五,鸡母一值钱三,鸡雏三值钱一。百钱买百鸡,问鸡翁、鸡母、鸡雏各几何?意思是:公鸡1只需要5钱,母鸡1只需要3钱,小鸡3只需要1钱,100钱买100只鸡,公鸡、母鸡、小鸡各多少只? 输入描述 无 输出描述 一行中分别是公鸡、母鸡、小 阅读全文
posted @ 2024-06-28 14:43 CRt0729 阅读(72) 评论(0) 推荐(0) 编辑
摘要:参考资料:https://blog.csdn.net/sinat_39522506/article/details/131564256需要掌握知识:1.求解特殊数字2.鸡兔同笼、百钱买百鸡等枚举问题3.时间模拟问题 简述:枚举,顾名思义列举出每一种可能,然后去check(检查)该种可能是否满足条件, 阅读全文
posted @ 2024-06-28 14:39 CRt0729 阅读(49) 评论(0) 推荐(0) 编辑
摘要:前言:现在中小学学习C++的人越来越多,可网上搜了搜桶排序的博文,发现大家都写得好深奥,于是,便有了这篇简单易懂(不是)的桶排序文章 思考一下,你面前有一些不大的数字,但是它们是乱序的,请问你如何将它们排成有序的序列? 不妨,让我们把这些数字当成生活中常见的东西,比如,这些都是不同种类的垃圾编号,我 阅读全文
posted @ 2024-06-13 16:01 CRt0729 阅读(461) 评论(0) 推荐(0) 编辑

点击右上角即可分享
微信分享提示