建图很简单
bfs预处理地图,距离就为费用
源点到所有m建边,流量1费用0
m到所有H建边,流量1费用为距离
H到所有汇点建边,流量1费用0
#include
#include
#include
#include
using namespace std;
#define MAXN 10005
#define MAXM 1000000
#define INF 0x3f3f3f3
#defi...
分类:
其他好文 时间:
2014-06-26 12:16:37
阅读次数:
199
在Objective-C中,可以使用#import和@class来引用别的类型, 但是你知道两者有什么区别吗?
@class叫做forward-class, 你经常会在头文件的定义中看到通过@class的引用, 原因就是当你只用@class来引入一个类时, 编译器知道有这么一个类,也就是说它能识别Engine *engine;
而在implementation文件中,如果你想要访问e...
分类:
其他好文 时间:
2014-06-26 12:09:21
阅读次数:
220
BUG 1:GDI+ Image::FromFile 无效
m_pImg = Gdiplus::Bitmap::FromFile(m_imgFilePath);
m_pImg为NULL
原因是没有初始化GDI+。
BUG2:GDI+ new Bitmap不能接受三个参数
//创建目标Bitmap
Bitmap *bmpDest = new Bitmap(destWidth, destHeight, m_pImg->GetPixelFormat());
原因:
//#ifdef _DEBUG
//#...
分类:
其他好文 时间:
2014-06-26 11:59:26
阅读次数:
377
private boolean writeToSDCard(Throwable ex)
{
boolean isDealing = false;
if (Environment.getExternalStorageState().equals(Environment.MEDIA_MOUNTED))
{
RandomAccessFile randomAccessFile = n...
分类:
移动开发 时间:
2014-06-26 11:58:42
阅读次数:
243
#import
@interface CommonZomble : NSObject
{
NSString * _zombleKind;//僵尸种类
NSInteger _totalBloodVolume;//总血量
NSInteger _everyTimeBloodloss;//每次被攻击的血量
NSInteger _residualVolume;//剩余血量...
分类:
其他好文 时间:
2014-06-26 11:56:39
阅读次数:
181
首先了解下zigzag数组,如下图,由一个矩阵的对角线,数字按一定规律递增
求nxn的Zigzag数组?
代码如下:
/*
0 1 5 6 14 15 27 28
2 4 7 13 16 26 29 42
3 8 12 17 25 30 41...
分类:
其他好文 时间:
2014-06-26 11:54:03
阅读次数:
233
借助Collections工具类:
import java.util.ArrayList;
import java.util.Collections;
public class TTEST {
public static void main(String[] args) {
ArrayList arr = new ArrayList();
for(int i=0;i<10;++i)...
分类:
其他好文 时间:
2014-06-26 11:43:56
阅读次数:
204
UVA 10692 - Huge Mods
题目链接
题意:求a0a1a2...mod m
思路:直接算肯定不行,利用欧拉定理ab=a(b mod phi(m) + phi(m))(b>=phi(m)),对指数进行降值处理,然后就可以利用快速幂去计算了,计算过程利用递归求解。
代码:
#include
#include
const int N = 1005;
i...
分类:
其他好文 时间:
2014-06-26 11:43:20
阅读次数:
290
# Sample ``local.conf`` for user-configurable variables in ``stack.sh``
# NOTE: Copy this file to the root ``devstack`` directory for it to
# work properly.
# ``local.conf`` is a user-maintained set...
分类:
其他好文 时间:
2014-06-26 11:41:09
阅读次数:
272