Problem Description:Clone an undirected graph. Each node in the graph contains alabeland a list of itsneighbors.Solution: 1 public UndirectedGraph...
分类:
其他好文 时间:
2014-07-07 16:11:57
阅读次数:
192
题目如下:
Problem D: XYZZY
ADVENT: /ad?vent/, n.
The prototypical computer adventure game, first designed by Will Crowther on the PDP-10 in the mid-1970s as an attempt at computer-refereed fantasy...
分类:
其他好文 时间:
2014-07-03 18:09:47
阅读次数:
211
题目如下:
Dungeon Master
You are trapped in a 3D dungeon and need to find the quickest way out!The dungeon is composedof unit cubes which may or may not be filled with rock. It ...
分类:
其他好文 时间:
2014-07-02 16:53:39
阅读次数:
199
题目如下:
Slash Maze
By filling a rectangle with slashes (/) and backslashes (), youcan generate nice little mazes. Here is an example:
As you can see, paths in the maze cann...
分类:
其他好文 时间:
2014-07-02 09:07:46
阅读次数:
186
题目链接:点击打开链接
题意:
给定n个点m条边的无向图
求从1点开始经过每条边至少一次最后回到1点的最小路程
显然就是找一条路径可重复的欧拉回路
思路:
首先对于欧拉回路的结论是:所有点的度数都为偶数
因为所有边至少经过一次,那么可以把题意转换成加最少多少条边使得图满足以上结论
而加的边目的是为了把奇度数转成偶度数,先floyd一下得到任意点间加边的最小花费
dp[i]表示状态...
分类:
其他好文 时间:
2014-07-01 14:47:43
阅读次数:
274
仿写 networkx 的功能
# -*- coding: cp936 -*-
'''
简单图 Graph:
要求:
关于节点:
功能1.add_node:
通过 add_node 一次性加一个节点
字符串,数字,任何可以被哈希的 python 对象都可以当做节点
...
分类:
其他好文 时间:
2014-07-01 08:15:24
阅读次数:
281
题目如下:
Maze Exploration
A maze of rectangular rooms is represented on a twodimensional grid as illustrated in figure 1a. Each point of thegrid is represented by a character. ...
分类:
其他好文 时间:
2014-07-01 06:57:08
阅读次数:
231
题目
Clone an undirected graph. Each node in the graph contains a label and
a list of its neighbors.
OJ's undirected graph serialization:
Nodes are labeled uniquely.
We use # as a separa...
分类:
其他好文 时间:
2014-06-30 09:01:23
阅读次数:
197
// 重写鼠标滚轮事件
mxEvent.addMouseWheelListener = function (funct) {
}
// 增加初次加载事件
window.onload = function () {
var element= document.getElementById('graph');
addScrollListener(element, wheelHa...
分类:
其他好文 时间:
2014-06-28 09:06:26
阅读次数:
311
I I U P C 2 0 0 6
Problem G: Going in Cycle!!
Input: standard input
Output: standard output
You are given a weighted directed graph with n vertices and...
分类:
其他好文 时间:
2014-06-27 08:07:16
阅读次数:
183