题解:
有N个股票经济人可以互相传递消息,他们之间存在一些单向的通信路径。现在有一个消息要由某个人开始传递给其他所有人,问应该由哪一个人来传递,才能在最短时间内让所有人都接收到消息。
显然,用Floyd算法,然后选出每个点到其他点的最长距离当中的最短距离。
/** \brief poj 1125 Floyd
*
* \param date 2014/7...
分类:
其他好文 时间:
2014-07-31 17:07:36
阅读次数:
218
Bellman-ford算法的反向应用--正循环检查
/** \brief poj 1860 Bellman-Ford
*
* \param date 2014/7/24
* \param state AC
* \return memory 708K time 141ms
*
*/
#include
#include
#include
using namespace std...
分类:
其他好文 时间:
2014-07-31 00:01:23
阅读次数:
213
自定义的字符串格式为
@"123.02,234.23|321.23,432.0002|543.0003,432.0045|654.0034,567.0034|23.3443,56.0034|77.3440,55.3443|"
/**
*@brief:将BezierPath中的点转为字符串
*/
+ (NSString*)convertBezierPathToNSString:(UIBe...
分类:
其他好文 时间:
2014-07-30 12:13:33
阅读次数:
171
This tutorial will give a brief overview of the defun function and moreover explain why localising variables is a good habit to get into. By http://le...
分类:
其他好文 时间:
2014-07-29 13:53:59
阅读次数:
136
斯特灵公式 Wiki http://zh.wikipedia.org/wiki/斯特林公式
/** \brief hdu 1018
*
* \param date 2014/7/24
* \param state AC
* \return
*
*/
#include
#include
#include
using namespace std;
const doub...
分类:
其他好文 时间:
2014-07-25 11:22:51
阅读次数:
192
先把最后所有的0去掉,方法就是在乘的时候统计因子2的个数,然后每遇到一个5,就去掉一个,那么乘出来就没有最后的0了~然后在乘的时候只保留最后一位就可以了,最后把统计了的2的个数乘回去(在统计的时候把2给提出来,这样就可以避免模的除法了!)
/** \brief hdu 1066
*
* \param date 2014/7/25
* \param state AC
* \return
...
分类:
其他好文 时间:
2014-07-25 11:22:01
阅读次数:
240
MSAA, UIA brief explanation
分类:
其他好文 时间:
2014-07-24 22:29:32
阅读次数:
195
模拟IIC
/**
******************************************************************************
* @file HTU20.x
* @brief HTU20 function
* @cpu STM32F051
* @compiler Keil uVision V4...
分类:
其他好文 时间:
2014-07-21 23:27:53
阅读次数:
526
获取,指定目录的子文件列表,支持递归获取子目录,支持Win32和类Unix系统。#ifndef _FILE_HELPER_H__#define _FILE_HELPER_H__class FileHelper{public: /** @brief 获取指定文件夹内的文件路径列表 @param str...
分类:
编程语言 时间:
2014-07-21 14:03:05
阅读次数:
214
/** \brief hdu 1009--greedy
*
* \param date 2014/7/18
* \param state AC
* \return
*
*/
#include
#include
#include
#include
using namespace std;
const int MAXN=1001;
struct Data
{
int...
分类:
其他好文 时间:
2014-07-19 23:41:49
阅读次数:
237