// demo1.cpp : 定义控制台应用程序的入口点。//通过此例程了解重载#include
"stdafx.h"#include using namespace std;class CMath{public:CMath(float
a):m_a(a){}~CMath(){}double Add...
分类:
编程语言 时间:
2014-05-17 13:24:50
阅读次数:
343
Two elements of a binary search tree (BST) are
swapped by mistake.Recover the tree without changing its structure.Note:A
solution using O(n) space is ...
分类:
其他好文 时间:
2014-05-17 11:30:21
阅读次数:
247
效果图和json格式Controllers代码using HR.Models;using
HR.Models.Repository;/***********************************************************************************...
分类:
Web程序 时间:
2014-05-17 02:48:12
阅读次数:
1011
这是微软官方教程Getting Started with Entity Framework 6
Code First using MVC 5 系列的翻译,这里是第六篇:为ASP.NET MVC应用程序更新相关数据原文:Updating Related
Data with the Entity Fra...
分类:
Web程序 时间:
2014-05-17 01:28:45
阅读次数:
510
1 using System; 2 using System.Diagnostics; 3
using System.Threading; 4 using System.Windows.Forms; 5 using UtilityClass; 6 7
namespace Program 8 { .....
分类:
其他好文 时间:
2014-05-17 01:03:00
阅读次数:
311
1 using System; 2 using
System.Collections.Generic; 3 using System.Text; 4 using System.IO; 5 using
System.Diagnostics; 6 7 namespace Utility...
分类:
其他好文 时间:
2014-05-17 00:50:37
阅读次数:
249
using System; using System.Collections.Generic;
using System.Data; using System.Data.Common; using System.Reflection; /// ///
实体阅读器类,可以从DataTa...
分类:
其他好文 时间:
2014-05-17 00:20:57
阅读次数:
341
#include
using namespace std;
const int size = 1000;
void ArrDel()
{
int arr[size];
//循环结束标志,一直循环到数组中只剩下最后一个元素结束
int currentNum = size;
int count = 0;
for (int k = 0; k < size; k++)
{
arr...
分类:
其他好文 时间:
2014-05-13 15:53:09
阅读次数:
282
题目地址:BZOJ 1036
题目大意:给出一棵树,每个点有一个权值,要求三种操作:1.修改某个点的权值,2.询问x到y路径上各点的权值最大值,3.询问x到y路径上各点的权值之和。
算法讨论:树链剖分模板题。
Code:
#include
#include
#define N 30000
#define oo 0x7f7f7f7f
using namespace std;
int...
分类:
其他好文 时间:
2014-05-13 15:45:57
阅读次数:
336
中心节点就是树的中心,2遍dfs求到树的直径,而中心一定在直径上,顺着直径找到中心就够了。
然后可以一遍树形DP找到最小值或者二分+判断是否访问到叶子节点。
#include
#include
#include
#include
using namespace std;
struct node
{
int next;
int power;
int length...
分类:
其他好文 时间:
2014-05-13 11:28:38
阅读次数:
306