Stay Hungry,Stay Foolish!

摘要: D - New Friends https://atcoder.jp/contests/abc350/tasks/abc350_d 思路 此sns网络,可能包括若干个连同子图, 对于每个子图, 计算 连通子图中 成员数目, 和 连接数目, 计算全连接子图,需要的总的连接数目, 减去当前连接数目, 得 阅读全文
posted @ 2024-04-20 23:15 lightsong 阅读(7) 评论(0) 推荐(0) 编辑
摘要: C - Sort https://atcoder.jp/contests/abc350/tasks/abc350_c 思路 开辟一个map, 对于输入排列数组,记录每个值所在的位置 (因为后面做位置替换的时候,需要快速找到 当前位置上 值 对应位置) 遍历数组,如果当前位置i,存放的就是当前位置值i 阅读全文
posted @ 2024-04-20 23:10 lightsong 阅读(6) 评论(0) 推荐(0) 编辑
Life Is Short, We Need Ship To Travel