题意:本题描述了一片滑雪场,并且规定奶牛从一个点只能向它相邻的并且高度不大于它的点运动,现在想要在某些点对之间加上缆车使得奶牛也可以从较低点到达较高点,问最少需要多少辆这样的缆车就可以使得奶牛可以从任意一个点运动到滑雪场的每个角落。
思路:即问至少加多少条边使图变成强联通图,先缩点成DAG。
不难知道强连通分量的所有节点的入度和出度均不为0,可以统计DAG上的入度和出度为0的个数分别是a,b。...
分类:
其他好文 时间:
2015-04-19 06:33:22
阅读次数:
205
Problem
A certain forest consists of N trees, each of which is inhabited by a squirrel.
The boundary of the forest is the convex polygon of smallest area which contains every tree, as if a giant r...
分类:
其他好文 时间:
2015-04-18 19:14:41
阅读次数:
169
We begin with drawing some Unicode text on the client area of a window.#!/usr/bin/python# -*- coding: utf-8 -*-"""ZetCode PyQt4 tutorial In this examp...
AreaTime Limit:1000MSMemory Limit:10000KTotal Submissions:5227Accepted:2342DescriptionBeing well known for its highly innovative products, Merck would...
分类:
其他好文 时间:
2015-04-17 21:53:04
阅读次数:
196
1、WLAN与wifi 1)先来从字面来介绍下wlan与wife。 wlan是Wireless Local Area Network的缩写,指应用无线通信技术将计算机设备互联起来,构成可以互相通信和实现资源共享的网络体 系。 2)而wife是指在公共场所提供无线局域网(WiFi)接入Int...
分类:
其他好文 时间:
2015-04-16 13:51:09
阅读次数:
150
Specifying a Resizable Area of an ImageUse the XcodeSlicingfeature to specify the dimensions of a resizable center area of the image and to optionally...
分类:
其他好文 时间:
2015-04-15 19:29:56
阅读次数:
141
1.dimens.xml文件: 100dp2.layout.xml中调用//3.activity中调用int margin_top = getResources().getDimension(R.dimen.area_margin_top);ok,没问题,运行正常。注:dimen.xml中area_...
分类:
移动开发 时间:
2015-04-15 13:16:00
阅读次数:
178
DescriptionNow ,there are some rectangles. The area of these rectangles is 1* x or 2 * x ,and now you need find a big enough rectangle( 2 * m) so that...
分类:
其他好文 时间:
2015-04-14 23:10:48
阅读次数:
143
problem:
Given n non-negative integers representing the histogram's bar height where the width of each bar is 1, find the area of largest rectangle in the histogram.
Above is a histo...
分类:
其他好文 时间:
2015-04-14 16:45:49
阅读次数:
88
problem:
Given a 2D binary matrix filled with 0's and 1's, find the largest rectangle containing all ones and return its area.
Hide Tags
Array Hash
Table Stack Dynamic
Programmin...
分类:
其他好文 时间:
2015-04-14 16:40:04
阅读次数:
110