POJ1258
思路:首先把第一个结点加入树中,每次往树中加入一个结点,加入的结点必须是与当前树中的结点距离最小那个点,这样每次把结点加入树中选取的都是最小权值,循环n-1次后把所有结点都加入树中。
#include
#include
#include
using namespace std;
const int MAXN = 1e9;
//创建map二维数组储存图表,low数组记录每2个点...
                            
                            
                                分类:
其他好文   时间:
2014-06-19 09:54:24   
                                阅读次数:
255
                             
                    
                        
                            
                            
                                今天在群里又有一个朋友问到了这样一个练习,我索性将代码贴到这里,下次需要的朋友可以来这里看。用到知识点:数组、集合、IO流问题描述:在如下图所示的一个txt文件中读取数据到内存,然后统计列除过0的各个数字的个数(放入Map)并按照列的数据大小排序。代码:package com.test;
import java.io.BufferedReader;
import java.io.File;
im...
                            
                            
                                分类:
编程语言   时间:
2014-06-19 09:33:46   
                                阅读次数:
300
                             
                    
                        
                            
                            
                                当程序A在执行insert、update、delete时,通过getContext().getContentResolver().notifyChange(uri, observer)方法来告诉所有注册在该Uri的监听者数据发生改变
参数1uri:注册的uri
参数2observer:注册的监听者
	/**
	 * 插入操作
	 */
	@Override
	public Uri...
                            
                            
                                分类:
其他好文   时间:
2014-06-16 11:54:53   
                                阅读次数:
204
                             
                    
                        
                            
                            
                                map的键尽量是字符串或者数字类型: ${key}---${map[key]}
                            
                            
                                分类:
其他好文   时间:
2014-06-16 07:14:38   
                                阅读次数:
133
                             
                    
                        
                            
                            
                                实现效果:实现图片遮罩展示效果。实例代码: Insert title here
                            
                            
                                分类:
其他好文   时间:
2014-06-16 06:49:05   
                                阅读次数:
179
                             
                    
                        
                            
                            
                                #include 
#include 
using std::cout;
using std::endl;
using std::cin;
using std::string;
int main(void){
	string str1="We can insert a string";
	string str2="a str into ";
         //在字符串指定位置...
                            
                            
                                分类:
编程语言   时间:
2014-06-15 19:29:30   
                                阅读次数:
251
                             
                    
                        
                            
                            
                                CHAIN_MSG_MAP(baseClass)是个很简单的宏,就是调用某个基类的ProcessWindowsMessage函数。意味着你把消息路由给他,看它处理不处理// 
处理程序原型: // LRESULT MessageHandler(UINT uMsg, WPARAM wParam, LP....
                            
                            
                         
                    
                        
                            
                            
                                1. Esxi主机上的虚拟机迁移只能是低----->高,或版本一样的才能进行迁移 
【如Esxi5.1---->Esxi5.5】ok, 而Esxi5.5----->Esxi5.1 
no;2.升级完成后,需要重启venter机器,若则会出现:pbm.fault.PBMFault.summary 错误;3...
                            
                            
                                分类:
其他好文   时间:
2014-06-13 17:47:38   
                                阅读次数:
676
                             
                    
                        
                            
                            
                                dfs#include #include char Map[16][16];int 
mv[16][16];//mv[i][j] == 0 没有被访问//mv[i][j] == 1 已经被访问struct N{int x,y;} ;int 
jx[] = { 0,-1, 0, 1};int jy[] =...
                            
                            
                                分类:
其他好文   时间:
2014-06-13 17:45:35   
                                阅读次数:
263
                             
                    
                        
                            
                            
                                #include #include int map[51][51][51];int 
v[51][51][51];int a,b,c,t11;struct node{ int x,y,z,ans;}q[200001];int 
jx[6]={0,0,0,0,-1,1};int jy[6]={0,0...
                            
                            
                                分类:
其他好文   时间:
2014-06-13 17:10:39   
                                阅读次数:
157