随笔分类 -  图论 最短路

摘要:#include<bits/stdc++.h> #define fi first #define se second #define io std::ios::sync_with_stdio(false) using namespace std; typedef long long ll; type 阅读全文
posted @ 2020-10-29 10:46 摸鱼选手LLF 阅读(141) 评论(0) 推荐(0)
摘要:div3真好啊 养老 A. Boring Apartments 直接模拟 B. Yet Another Bookshelf 模拟 C. Dominant Piranha 不会 D. Districts Connection 模拟,按树每个deep去分层连就行了 #include<bits/stdc+ 阅读全文
posted @ 2020-10-21 10:41 摸鱼选手LLF 阅读(225) 评论(0) 推荐(1)
摘要:http://codeforces.com/contest/1422/problem/D D. Returning Home 一个n*n的图 有些点就是可以瞬移 和象棋里车的规则一样,给你一些点,只要你在横纵坐标 就可以瞬移过去 考虑对x,y的列和行建图就可以了 #include <bits/std 阅读全文
posted @ 2020-10-13 10:47 摸鱼选手LLF 阅读(111) 评论(0) 推荐(0)
摘要:题意: 给一个N个点的完全图 有边权 然后你可以删K条边,让剩下的图的最短路最长 题解: 发现K很小,暴力搜一下, 再想一下,只搜当前最短路上的边就可以 复杂度未知,本地跑的挺快,然后交就完事了(引自zbr) #include<bits/stdc++.h> #define rep(i,a,n) fo 阅读全文
posted @ 2020-07-28 17:22 摸鱼选手LLF 阅读(309) 评论(3) 推荐(1)