题目链接:http://poj.org/problem?id=1847
把第一个相连的边设为0,其余的设为1.
#include
#include
#include
#include
#include
using namespace std;
const int INF = 1000000;
const int MAX = 110;
int n,a,b;
int m,f,t;
...
目录:
一、使用CoreData存储基本数据
二、使用CoreData存储自定义类型数据
简单介绍CoreData
CoreData是iOS编程中使用持久化数据存储的一种方式,我们知道CoreData并不是数据库本身,而是Apple提供的对象持久化技术——Object Persistent technology。CoreData框架为我们的数据变更、管理、对象存储、读取和恢复提...
这题可能是用贪心思想来写的,具体是不是我也不知道,自己对贪心也不是太清楚。之前好像写过,当时似乎没有写出来,不过,这次一下就有了思路。本来是想先装小的包裹,可是试了一下不行,有问题;于是改为先装大的包裹,如果有多余,再装小的,每次都这样,直到所有的包裹被装完为止。试了试,感觉没有什么问题。
代码写的可能有的乱,不过思路还是清楚的。
#include
#include
#include
#inc...
I want to run some programs of vs2012 on the vs2013 ,however some errors as follows:
first time the error is :
error LNK2038: mismatch detected for '_MSC_VER': value '1800' doesn't match value '1700'
you can do that as fllows :
...
Given n, how many structurally unique BST's (binarysearch trees) that store values 1...n?
For example,
Given n = 3, there are a total of 5 unique BST's.
1 3 3 2 1
\ ...
Given a binary tree, return the preorder traversal of itsnodes' values.
For example:
Given binary tree {1,#,2,3},
1
2
/
3
return [1,2,3].
Note: Recursive solution istr...
Given a linked list, determine if it has a cycle in it.
Follow up:
Can you solve it without using extra space?
HideTags
Linked List Two
Pointers
#pragma once
#include
using namespace std;
...
Given a binary tree, return the inorder traversal of itsnodes' values.
For example:
Given binary tree {1,#,2,3},
1
2
/
3
return [1,3,2].
Note: Recursive solution istri...