- 博客(9)
- 收藏
- 关注
原创 E. There Should Be a Lot of Maximums
/计算完轻儿子的答案后 要把儿子的痕迹擦干净 为下一个儿子准备。//计算完轻儿子的答案后 要把儿子的痕迹擦干净 为下一个儿子准备。//计算完轻儿子的答案后 要把儿子的痕迹擦干净 为下一个儿子准备。//计算完轻儿子的答案后 要把儿子的痕迹擦干净 为下一个儿子准备。void dfs1( int u, int fa ) { //遍历整个树,找每个点的重儿子。//先算轻儿子的答案。
2023-04-03 12:35:02
276
原创 Codeforces Round #796 (Div. 2) ABCD题解
Codeforces Round #796 (Div. 2) ABCD题解
2022-06-04 16:40:40
323
原创 Codeforces Round #789 (Div. 2 题解ABCD
A 题直接照着题意模拟没什么好说的 #include<iostream> #include<stdio.h> #include<string.h> #include<queue> #include<map> #include<algorithm> #include<stack> #include<set> #include<string> #include<utility> #in...
2022-05-09 19:23:40
225
原创 B. Getting Zero
B. Getting Zero time limit per test 2 seconds memory limit per test 256 megabytes input standard input output standard output Suppose you have an integervv. In one operation, you can: either setv=(v+1)mod32768v=(v+1)mod32768 or setv=(2⋅v)mod3...
2022-04-10 20:46:47
621
原创 https://codeforces.com/contest/277/problem/A
大概题意就是每个人会一些语言,为了保证可以让全公司舒畅沟通要每个人再学的语言的总和 我的解法是把可以互相沟通的人视为一个群体,群体总数是n;最好得n-1是答案;没有考虑一门也不会的人无论如何都要学一门;一直没过很烦; #include<iostream> using namespace std; bool a[101][101]; bool c[101][101]; bool b[101]; void dp(int x,int n) { for(int i=0;i<n;i++)...
2022-03-12 14:55:58
375
原创 Educational Codeforces Round 124 (Rated for Div. 2)D. Nearest Excluded Points
一开始从标记点开始bfs ole 了,然后从空点开始就过了 原题链接Problem - D - Codeforces #include<iostream> #include<queue> #include<utility> #include<map> using namespace std; typedef pair<int,int>pii; map<pii,pii>ans; map<pii,int>id; map<
2022-03-11 18:33:15
518
原创 Educational Codeforces Round 124 (Rated for Div. 2)C. Fault-tolerant Network
原题链接Problem - C - Codeforces 题意就是两边各有电脑,每边的电脑互相之间已经连接,在破坏一台电脑的情况下还要两边可以连接成功的最小代价是 代价=abs(a[i]-b[k]); 不难猜到只要两边两端的电脑可以连接到对面就一定可以,因为可以互相之间相互连,所以最少两条线最多四条线就可以了,先预处理一下两边两端相连的代价然后就可以去比较到底用几条线好了; 代码 #include<iostream> #include<algorithm> using n
2022-03-11 15:01:07
274
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人