摘要: 1.B爱恨的纠葛(先将ab排序,再二分查找ab元素间差值最小的一对,再从a和c中找出对应下标(因为第二个数组不能动),再交换a的两个下标位置的值) 1 #include<bits/stdc++.h> 2 using namespace std; 3 int a[1000005]; 4 int b[1 阅读全文
posted @ 2024-02-25 13:24 伊芙加登 阅读(19) 评论(0) 推荐(0)
摘要: 1.B - Jiubei and Overwatch(注意是范围伤害,只需要找出血量最大值就可以了) 1 #include<bits/stdc++.h> 2 using namespace std; 3 int a[10000]; 4 int main() 5 { 6 int m; 7 cin>>m 阅读全文
posted @ 2024-02-25 12:19 伊芙加登 阅读(16) 评论(0) 推荐(0)
摘要: 1.D守恒(主要通过数份数来和n作比较,一定要特判1这个特殊情况) #include<bits/stdc++.h> using namespace std; long long t[1000000]; void solve() { int n; cin>>n; long long sum=0,ans 阅读全文
posted @ 2024-02-25 12:04 伊芙加登 阅读(26) 评论(0) 推荐(0)
摘要: 1.New game(是一个拓扑排序板子稍微变形,但是循环加优先队列也可以做) 板子 1 #include <iostream> 2 #include <algorithm> 3 #include <utility> 4 #include <queue> 5 #include <cstring> 6 阅读全文
posted @ 2024-02-17 21:34 伊芙加登 阅读(30) 评论(0) 推荐(0)
摘要: 1.kk与答辩(把出现过的人名都记录一遍map,然后再用另一个容器储存大于过kk的人名,最后总人名和其相减就是所求) ps:当时输入流混用了导致re。切记 1 #include<bits/stdc++.h> 2 using namespace std; 3 4 int main() { 5 int 阅读全文
posted @ 2024-02-17 20:29 伊芙加登 阅读(13) 评论(0) 推荐(0)
摘要: 1.Tokitsukaze and Eliminate (hard)(easy难度可以通过暴力来进行,但是hard添加了颜色,我们需要从右往左找到最靠左的某一颜色的最后一个,那么我们可以先用map存图,存下当前剩下几种颜色,再用set一遍一遍重复清点颜色数量,一旦和map中颜色相同就消除一次) 1 阅读全文
posted @ 2024-02-17 19:13 伊芙加登 阅读(34) 评论(0) 推荐(0)
摘要: signed main() { ios::sync_with_stdio(0); cin.tie(0) , cout.tie(0); int T = 1; // cin >> T ; while(T--) solve(); return 0; } 一· ios::sync_with_stdio(fa 阅读全文
posted @ 2024-02-03 14:06 伊芙加登 阅读(2653) 评论(0) 推荐(0)
摘要: B.steel heart(主要是心之刚效果和冷却效果30秒的特判) #include<bits/stdc++.h> using namespace std; struct gang { int hh; int mm; int t; int e; }; struct gang g[10000]; i 阅读全文
posted @ 2024-02-03 13:59 伊芙加登 阅读(15) 评论(0) 推荐(0)
摘要: A.解开束缚丝(map写错了,直接存map然后搜索就可以) #include<bits/stdc++.h> #include<map> using namespace std; void solve() { int n; cin>>n; int a; for(int i=0;i<n;i++) { m 阅读全文
posted @ 2024-02-03 13:38 伊芙加登 阅读(18) 评论(0) 推荐(0)
摘要: D.网络寻路(dfs,但是可以简便方法) #include<bits/stdc++.h> using namespace std; int s[100000],a[100010],b[100010]; int main() { int n,m; cin>>n>>m; for(int i=0;i<m; 阅读全文
posted @ 2024-02-03 13:03 伊芙加登 阅读(11) 评论(0) 推荐(0)