摘要:
P1950 长方形 绿题,比赛依旧暴力吧,我算是发现了,绿题就是我智商上限了 这题其实和P4147一样需要借助悬线,不同点在于一个求组合数,一个求最大值 点击查看代码 #include<bits/stdc++.h> #define MAXN 1010 using namespace std; cha 阅读全文
posted @ 2025-05-09 20:07
Chuan81
阅读(9)
评论(0)
推荐(0)
摘要:
P2866 [USACO06NOV] Bad Hair Day S 单调栈而已 点击查看代码 #include<bits/stdc++.h> using namespace std; int main() { int n; cin >> n; long long ans = 0; int h; st 阅读全文
posted @ 2025-05-09 18:54
Chuan81
阅读(7)
评论(0)
推荐(0)
摘要:
P4147 玉蟾宫 本书对于该题的讲解挺好懂的,悬线的思想真挺妙的 点击查看代码 #include <bits/stdc++.h> using namespace std; const int N = 1010; vector<vector<char>> a(N, vector<char>(N)); 阅读全文
posted @ 2025-05-09 17:43
Chuan81
阅读(7)
评论(0)
推荐(0)
摘要:
P2671 [NOIP 2015 普及组] 求和 一道绿题 蓝桥杯能写出绿题的话我都稳国二了吧 因间隔y的存在所以x与z奇偶性必须相同 书上倒是写了暴力枚举会超时,不过这种题出现在比赛的话,先暴力拿下部分分再说吧,比赛时间其实很有限,反正OI赛制就得骗分啊 书上解法又是列表又是找规律算贡献的,看得头 阅读全文
posted @ 2025-05-09 14:21
Chuan81
阅读(45)
评论(1)
推荐(0)
摘要:
P7072 [CSP-J2020] 直播获奖 数据量小的时候,桶排序非常好用 点击查看代码 #include<bits/stdc++.h> using namespace std; int t[610], n, w; //t是成绩桶,计算目前得到该分数的有多少人 int main() { cin > 阅读全文
posted @ 2025-05-09 13:03
Chuan81
阅读(10)
评论(0)
推荐(0)
摘要:
P1115 最大子段和 考察Kadane算法 点击查看代码 #include<bits/stdc++.h> using namespace std; int main() { int n; cin >> n; int ans = 0, sum = -10009;//sum值用于记录连续字段和,ans 阅读全文
posted @ 2025-05-09 12:39
Chuan81
阅读(12)
评论(0)
推荐(0)
摘要:
P1102 A-B 数对 这是《深入浅出(进阶)》的第一道题,早前自己做过 点击查看代码 #include<bits/stdc++.h> using namespace std; int main() { int n, c; cin >> n >> c; vector<int>e(n); long 阅读全文
posted @ 2025-05-09 12:21
Chuan81
阅读(17)
评论(0)
推荐(0)

浙公网安备 33010602011771号