码迷,mamicode.com
首页 >  
搜索关键字:island    ( 492个结果
[IOI2008]Island
基环树 找环,环外处理,环上处理 #include<bits/stdc++.h> #define re return #define inc(i,l,r) for(int i=l;i<=r;++i) using namespace std; template<typename T>inline vo ...
分类:其他好文   时间:2019-10-23 12:00:57    阅读次数:77
[LeetCode] 827. Making A Large Island 建造一个巨大岛屿
In a 2D grid of s and s, we change at most one to a . After, what is the size of the largest island??(An island is a 4 directionally connected group o ...
分类:其他好文   时间:2019-10-14 01:24:21    阅读次数:105
Codeforces1214D. Treasure Island (dp + Hash)
题目链接:传送门 思路: 仔细观察可以发现,答案最多就是2,只要把(2,1)和(1,2)堵住就可以了。 答案是0的情况就是初始状态下,(1,1)就已经不可达(n,m)了,很好判断。 所以重点就是区分答案为1和答案为2的情况。 如果答案为1的话,就说明从(1,1)到(n,m)的所有路径都经过同一个点( ...
分类:其他好文   时间:2019-10-08 12:08:17    阅读次数:87
[Daily Coding Problem 290] Quxes Transformation
On a mysterious island there are creatures known as Quxes which come in three colors: red, green, and blue. One power of the Qux is that if two of the ...
分类:其他好文   时间:2019-09-14 10:30:32    阅读次数:110
Codeforces Round #583 (Div. 1 + Div. 2, based on Olympiad of Metropolises), problem: (D) Treasure Island
题目大意 给你一个n m 的棋盘 有的地方不能过 问题最少需要堵多少次 才能让(1,1)到(n,m)没有路径通过 解法: 打表发现 对角线最后剩下的通路最少 即为答案 画图可知$ 2 2$的子矩形内 右对角线被填满时左对角线都不能到达 递推判断即可 细节蛮多的 code: include inclu ...
分类:其他好文   时间:2019-09-08 00:13:05    阅读次数:72
codeforces1214D Treasure Island
其实是一道水题,很显然答案一定是0、1、2中的某一个数 那么直接上dfs搜一遍,标记走过的点,如果这一次dfs不能到达终点,那么答案为0 否则再dfs一遍,dfs时不走标记过的点,如果这一次不能到达终点,那么答案为1 否则答案为2 ...
分类:其他好文   时间:2019-09-05 13:57:37    阅读次数:72
LeetCode--Island Perimeter
原文引用https://www.dazhuanlan.com/2019/08/26/5d62fb8538067/ Island Perimeter 原题: You are given a map in form of a two-dimensional integer grid where 1 re ...
分类:其他好文   时间:2019-08-26 09:37:56    阅读次数:95
算法---图
一、图的基础知识 1.连通图与非连通图 连通图(Connected Graphs)指图内任意两个节点间,总能找到一条路径连接它们,否则,为非连通图(Disconnected Graphs)。也就是说,如果图中包含岛(Island),则是非连通图。如果岛内的节点都是连通的,这些岛就被成为一个部件(Co ...
分类:编程语言   时间:2019-08-15 19:14:34    阅读次数:111
[bzoj1791][ioi2008]Island 岛屿(基环树、树的直径)
bzoj luogu 题意可能会很绕 一句话:基环树的直径。 求直径: 对于环上每一个点记录其向它的子树最长路径为$dp_x$ 之后记录环上边长前缀和$ns_i$ dp值为$max_{i,j}dp[i]+sum[i]+dp[j]-sum[j]$ $dp[j]-sum[j]$提出来进单调队列。 O(n ...
分类:其他好文   时间:2019-08-10 21:03:02    阅读次数:129
HDU-4280-Island Transport(网络流,最大流, ISAP)
链接: https://vjudge.net/problem/HDU 4280 题意: In the vast waters far far away, there are many islands. People are living on the islands, and all the tra ...
分类:其他好文   时间:2019-08-09 20:04:07    阅读次数:118
492条   上一页 1 2 3 4 5 6 ... 50 下一页
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!