摘要: 1:【子串里面包含空串】12+1=13【一个字符串中任意个连续的字符组成的子序列称为该字符串的子串,则字符串 abcab 有(13 )个内容互不相同的子串】 2 栈可以实现队列, 队列常常被用于广度优先搜索算法。 3双向循环链表结点 【前驱后继的优先执行】 阅读全文
posted @ 2025-09-14 14:30 浩瀚宇宙星晨 阅读(4) 评论(0) 推荐(0)
摘要: include using namespace std; int main() { int x, n,ans = 0; scanf("%d%d", &x, &n); for(int i = 1; i <= n; i++,x++){ if(x % 7 == 6 ||x % 7==0) continue 阅读全文
posted @ 2025-04-04 14:17 浩瀚宇宙星晨 阅读(13) 评论(0) 推荐(0)
摘要: include <bits/stdc++.h> using namespace std; long long a, b, sum; int main() { cin >> a >> b; if (a%20) a/=2; else a=a/2+1; if (b%20) b/=2; else b=b/2 阅读全文
posted @ 2025-04-04 14:14 浩瀚宇宙星晨 阅读(10) 评论(0) 推荐(0)
摘要: include <bits/stdc++.h> using namespace std; long long t, a, b, c; long long sum; long long lcm(long long a,long long b) { return a*b/__gcd(a,b); } in 阅读全文
posted @ 2025-04-03 13:12 浩瀚宇宙星晨 阅读(41) 评论(0) 推荐(0)
摘要: include <bits/stdc++.h> using namespace std; int main() { long long x, y, sum=0; cin >> x >> y; for (long long i=1;ii<=xy;i++) { long long j=xy/i; if 阅读全文
posted @ 2025-04-02 22:18 浩瀚宇宙星晨 阅读(35) 评论(0) 推荐(0)
摘要: include <bits/stdc++.h> using namespace std; int main() { int a, b, n=0; cin >> a >> b; for (int i=max(a, b)-min(a, b)+1;i<a+b;i++)//1 { if (a+b>i) n+ 阅读全文
posted @ 2025-03-23 11:41 浩瀚宇宙星晨 阅读(14) 评论(0) 推荐(0)
摘要: include using namespace std; int a[21][21]; int main(){ int n, s; cin >> n >> s; for(int j = 1; j <= n; j++) { for(int i = 1; i <= j; i++,s++){ a[i][j 阅读全文
posted @ 2025-03-23 11:37 浩瀚宇宙星晨 阅读(9) 评论(0) 推荐(0)
摘要: 题目描述 输入两个正整数x ,y ,求出满足下列条件的P,Q的个数: 1.P,Q是正整数。 2.要求P,Q以x 为最大公约数,以y 为最小公倍数。 试求:满足条件的所有可能的 P,Q的个数。 输入 一行两个正整数 x ,y ​ 。 输出 —行一个数,表示求出满足条件的 P, Q的个数。 样例输入 复 阅读全文
posted @ 2025-03-23 11:35 浩瀚宇宙星晨 阅读(16) 评论(0) 推荐(0)
摘要: 题目描述 不管是基于太阳的阳历,还是基于月亮的阴历,或者阴阳合历的农历,都太复杂了。 33DAI 自己发明了一套历法,取名为“星星历”。星星历采用每年 3 3 星,每星 120 120 天的方式纪年。 33DAI 定义现实的 2024 年 1 月 18 日为“星星历”的第一天,即 1 1 年 1 1 阅读全文
posted @ 2025-03-23 11:32 浩瀚宇宙星晨 阅读(45) 评论(0) 推荐(0)
摘要: include <bits/stdc++.h> using namespace std; bool lucky(int j) { int sum=0; while (j>0) { sum=j%10;//反思1 j/=10;//反思1 if (sum<=j%10) return false; } re 阅读全文
posted @ 2025-03-19 22:20 浩瀚宇宙星晨 阅读(61) 评论(0) 推荐(0)