上一页 1 2 3 4 5 6 ··· 19 下一页
2024年9月29日
摘要: #include<bits/stdc++.h> using namespace std; #define x first #define y second typedef pair<int,int> PII; typedef long long ll; typedef unsigned long l 阅读全文
posted @ 2024-09-29 15:32 ruoye123456 阅读(12) 评论(0) 推荐(0)
摘要: #include<bits/stdc++.h> using namespace std; #define x first #define y second typedef pair<int,int> PII; typedef long long ll; typedef unsigned long l 阅读全文
posted @ 2024-09-29 14:08 ruoye123456 阅读(30) 评论(0) 推荐(0)
摘要: 一开始默认为0,如果有捕食关系调整d[x] #include<bits/stdc++.h> using namespace std; #define x first #define y second typedef pair<int,int> PII; typedef long long ll; t 阅读全文
posted @ 2024-09-29 13:38 ruoye123456 阅读(25) 评论(0) 推荐(0)
摘要: 方法1:带权路径维护 本题核心:[a,b]之间有奇数个1转换为s[a-1]^s[b] = 1,从而转向并查集 #include<bits/stdc++.h> using namespace std; #define x first #define y second typedef pair<int, 阅读全文
posted @ 2024-09-29 13:12 ruoye123456 阅读(11) 评论(0) 推荐(0)
摘要: 带权并查集稍微注意下细节、 #include<bits/stdc++.h> using namespace std; #define x first #define y second typedef pair<int,int> PII; typedef long long ll; typedef u 阅读全文
posted @ 2024-09-29 10:41 ruoye123456 阅读(22) 评论(0) 推荐(0)
摘要: 考虑利润从高到底排序,优先把利润最高的填到最接近过期的空余位置 贪心证明:如果当前a[i]被填入而填入了比最靠近过期前面的位置显然不会更优,如果没有被填入而放了另一组方案利润更大,则把属于a[i]的位置换成a[i]一定更优,两者矛盾 #include<bits/stdc++.h> using nam 阅读全文
posted @ 2024-09-29 09:56 ruoye123456 阅读(13) 评论(0) 推荐(0)
摘要: 相等放并查集里,不等直接判断 #include<bits/stdc++.h> using namespace std; #define x first #define y second typedef pair<int,int> PII; typedef long long ll; typedef 阅读全文
posted @ 2024-09-29 09:31 ruoye123456 阅读(18) 评论(0) 推荐(0)
2024年9月16日
摘要: #include<bits/stdc++.h> using namespace std; #define x first #define y second typedef long long ll; typedef pair<int,int> PII; void solve() { int n; w 阅读全文
posted @ 2024-09-16 21:03 ruoye123456 阅读(25) 评论(0) 推荐(0)
2024年9月14日
摘要: A(军训I) 大分类讨论 #pragma GCC optimize("O3,unroll-loops") #pragma GCC target("avx2,bmi,bmi2,lzcnt,popcnt") //如果在不支持 avx2 的平台上将 avx2 换成 avx 或 SSE 之一 #includ 阅读全文
posted @ 2024-09-14 11:28 ruoye123456 阅读(105) 评论(0) 推荐(0)
摘要: #include<bits/stdc++.h> using namespace std; #define x first #define y second typedef pair<int,int> PII; typedef long long ll; typedef unsigned long l 阅读全文
posted @ 2024-09-14 11:04 ruoye123456 阅读(17) 评论(0) 推荐(0)
上一页 1 2 3 4 5 6 ··· 19 下一页