地址：戳这里

地址：戳这里

1.There is only one entrance and one exit.

2.All the road in the maze are unidirectional.

3.For the entrance, its out-degree = its in-degree + 1.

4.For the exit, its in-degree = its out-degree + 1.

5.For other node except entrance and exit, its out-degree = its in-degree. Read More →

地址：戳这里

## Description

地址：戳这里

## Description

Blinker最近喜欢上一个奇怪的游戏。

这个游戏在一个 N*M 的棋盘上玩，每个格子有一个数。每次 Blinker 会选择两个相邻

的格子，并使这两个数都加上 1。

现在 Blinker 想知道最少多少次能使棋盘上的数都变成同一个数，如果永远不能变成同

一个数则输出-1。

地址：戳这里

ACM ICPC World Finals 2009, sponsored by IBM and hosted by KTH, Royal Institute of Technology will be held in Stockholm, Sweden. This contest will last for *N*(1<= *N* <= 1000) days. We need at least *A _{i}*volunteers in the

*i*-th day. Now there are

*M*(1<=

*M*<=10000) kind of volunteers. The

*i*-th type of volunteers will work from

*S*-th day to

_{i}*T*-th day, we will pay them $

_{i}*C*. Now your task is to minimize the money KTH pay for all the volunteers. Read More →

_{i}地址：戳这里

地址:戳这里

_{i}. If you want to carry x units of goods along this road, you should pay a

_{i}* x

^{2}dollars to hire guards to protect your goods. And what’s worse, for each road i, there is an upper bound C

_{i}, which means that you cannot transport more than C

_{i}units of goods along this road. Please note you can only carry integral unit of goods along each road.

You should find out the minimum cost to transport all the goods safely.

地址:戳这里

Alice and Bob are playing together. Alice is crazy about art and she has visited many museums around the world. She has a good memory and she can remember all drawings she has seen.

Today Alice designs a game using these drawings in her memory. First, she matches K+1 colors appears in the picture to K+1 different integers(from 0 to K). After that, she slices the drawing into grids and there are N rows and M columns. Each grid has an integer on it(from 0 to K) representing the color on the corresponding position in the original drawing. Alice wants to share the wonderful drawings with Bob and she tells Bob the size of the drawing, the number of different colors, and the sum of integers on each row and each column. Bob has to redraw the drawing with Alice’s information. Unfortunately, somtimes, the information Alice offers is wrong because of Alice’s poor math. And sometimes, Bob can work out multiple different drawings using the information Alice provides. Bob gets confused and he needs your help. You have to tell Bob if Alice’s information is right and if her information is right you should also tell Bob whether he can get a unique drawing.

地址：戳这里

欢迎来到珠海！

由于土地资源越来越紧张，使得许多海滨城市都只能依靠填海来扩展市区以求发展。作为Z市的决策人，在仔细观察了Z市地图之后，你准备通过填充某些海域来扩展Z市的海岸线到最长，来吸引更多的游客前来旅游度假。为了简化问题，假设地图为一个N*M的格子，其中一些是陆地，一些是可以填充的浅海域，一些是不可填充的深海域。这里定义海岸线的长度为一个联通块陆地（可能包含浅海域填充变为的陆地）的边缘长度，两个格子至少有一个公共边，则视为联通。

值得注意的是，这里Z市的陆地区域可以是不联通的，并且整个地图都处在海洋之中，也就是说，Z市是由一些孤岛组成的，比如像，夏威夷？

你的任务是，填充某些浅海域，使得所有岛屿的海岸线之和最长。

地址：戳这里