K. Fling Fling is a kind of puzzle games available on phone.This game is played on a board with 7 rows and 8 columns. Each puzzle consists of a set of furballs placed on the board. To solved a puzzle, you need to remove the furballs from board until…
题目简介:给定一个带权有向图,再给定图中一个顶点(源点),求该点到其他所有点的最短距离,称为单源最短路径问题. 如下图,求点1到其他各点的最短距离 准备工作:以下为该题所需要用到的数据 int N; //保存顶点个数 int M; //保存边个数 int max; //用来设定一个比所有边的权都大的值,来表示两点间没有连线 int[] visit; //找到一个顶点的最短距离,就把它设为1,默认为0(即还没有找到) int[][] distance; //保存图中个边的值,两点间无边则设为max…
Ubuntu and Win10 - double OS 2016-02-21 Yesterday I helped my friend install Ubuntu (14.04 LTS) on his PC where there has been a MS Win10. I used UltraISO to create a U-disk installation and installed it. However, then we could only start up Ubuntu a…
Sublime Text 2下搭建Python环境时,最容易出的错误就是Python环境配置错误,导致build(Ctrl+B)后没有任何反应. 关于Python编程环境的配置,网上很容易搜索到.先默认你已经在windows上安装好了Python编译环境,并且在sublime text 2中已经安装好了必要的插件.下边我们就直接配置Python了,让Python代码能够在Sublime Text 2里欢快的跑起来.常见的配置主要是两种. 一.在Windows高级系统设置里设置好环境变量的系统变量…
463. Island Perimeterhttps://leetcode.com/problems/island-perimeter/就是逐一遍历所有的cell,用分离的cell总的的边数减去重叠的边的数目即可.在查找重叠的边的数目的时候有一点小技巧,就是沿着其中两个方向就好,这种题目都有类似的规律,就是可以沿着上三角或者下三角形的方向来做.一刷一次ac,但是还没开始注意codestyle的问题,需要再刷一遍. class Solution { public: int islandPerime…
As an emergency rescue team leader of a city, you are given a special map of your country. The map shows several scattered cities connected by some roads. Amount of rescue teams in each city and the length of each road between any pair of cities are…
前一段时间终于装上了传说中的代码编辑神器====>Sublime Text ,一打开便爱不释手,于是在网上找PHP的配置方案和插件,所有的一切都搞定了,可就是编译的时候没有显示,也没有提示,熬了好几个夜天天在网上找解决方案,终于功夫不负有心人,终于还是让我找到了,结果真是出我意料之外,真没想到是那地方的问题!不过总算解决了,再也没有后顾之忧了,可以安心写代码啦….. 下面享一下我的PHP环境初始配置过程(win7系统): 首先,将PHP加到电脑的环境变量中如图(D:\PHPEnv\PHP5是我P…
SparkContext是spark的入口,通过它来连接集群.创建RDD.广播变量等等. class SparkContext(config: SparkConf) extends Logging with ExecutorAllocationClient { private val creationSite: CallSite = Utils.getCallSite() //如果生命了2个sparkContext,则会使用warn来取代exception.防止退出 private val al…