摘要: 需要注意的几个问题 1.修改查询操作判断完全不含不能用小于等于或大于等于,不能加等于。 2.懒标记的数组照样要开\(4\)倍。 阅读全文
posted @ 2024-07-10 09:53 我的晴语表 阅读(28) 评论(0) 推荐(0)
摘要: A link …… 点击查看代码 #include<bits/stdc++.h> using namespace std; string s,t; signed main(){ cin >> s >> t; if(s == "AtCoder"&&t == "Land") cout << "Yes"; 阅读全文
posted @ 2024-06-18 21:17 我的晴语表 阅读(26) 评论(0) 推荐(0)
摘要: A link 循环加每一个数,加到哪个数不能加了输出前一个数,注意如果加到最后还能加,记得输出\(n\)。 点击查看代码 #include<bits/stdc++.h> using namespace std; int n,m; int h[105],sum; signed main(){ cin 阅读全文
posted @ 2024-06-13 13:29 我的晴语表 阅读(40) 评论(0) 推荐(0)
摘要: 介绍 所谓等比数列,就是相邻两个数之间的比相等。 公比用\(q\)表示,第\(1\)项是\(a_1\),第\(n\)项是\(a_n\),后一个数是前一个数的\(q\)倍。 求第\(n\)项 \(a_n = a_1*(n-1)q\) 求和 \(s_n = \frac{a_1(1-q^n)}{1-q}\ 阅读全文
posted @ 2024-06-13 11:41 我的晴语表 阅读(113) 评论(0) 推荐(0)
摘要: 引言:__int128不能用\(cin\)\(cout\)或\(scanf\)\(printf\)。 快读 思想:把每一个字符读入,组成数字。 int read(){ int x = 0,y = 1;//x代表那个数的绝对值,y代表符号 char ch = getchar(); while(ch < 阅读全文
posted @ 2024-06-12 21:21 我的晴语表 阅读(546) 评论(0) 推荐(0)
摘要: A link 把\(1\) ~ \({l-1}\)和\({r+1}\) ~ \(n\)部分顺序输出\(l\)~\(r\)部分逆序输出。 点击查看代码 #include<bits/stdc++.h> using namespace std; int n,l,r; signed main(){ cin 阅读全文
posted @ 2024-06-07 19:49 我的晴语表 阅读(63) 评论(0) 推荐(0)
摘要: A link 模拟整个过程即可。 点击查看代码 #include<bits/stdc++.h> #define int long long using namespace std; signed main(){ int h; cin >> h; int day = 1ll,g = 0ll; whil 阅读全文
posted @ 2024-05-22 12:37 我的晴语表 阅读(30) 评论(0) 推荐(0)
摘要: A link 暴力寻找\(2\)及以后比\(a_1\)大的数。 点击查看代码 #include<bits/stdc++.h> using namespace std; int n; int a[105]; signed main(){ cin >> n; for(int i = 1;i <= n;+ 阅读全文
posted @ 2024-05-17 21:10 我的晴语表 阅读(20) 评论(0) 推荐(0)
摘要: 思路 大体是多个联通块,枚举每一个点,如果所在联通块已经搜过,不在搜,如果没搜过,搜联通块。 题目 AcWing1097 AcWing1098 AcWing1106 阅读全文
posted @ 2024-05-08 20:28 我的晴语表 阅读(24) 评论(0) 推荐(0)
摘要: A link \(x\)停不到,\(y\)能停到。 要先判断是从前往后还是从后往前。 点击查看代码 #include<bits/stdc++.h> using namespace std; signed main(){ int n,x,y,z; cin >> n >> x >> y >> z; if 阅读全文
posted @ 2024-05-05 15:27 我的晴语表 阅读(101) 评论(0) 推荐(0)