题目
Given a collection of integers that might contain duplicates, S, return all possible subsets.
Note:
Elements in a subset must be in non-descending order.The solution set must not c...
分类:
其他好文 时间:
2014-06-08 05:32:21
阅读次数:
196
题目来源:Light OJ 1291 Real Life Traffic
题意:最少添加几条边 可以使全图边双连通
思路:缩点 重新构图 答案就是(叶子节点数+1)/ 2
#include
#include
#include
#include
#include
using namespace std;
const int maxn = 10010;
struct Edge
{
i...
分类:
其他好文 时间:
2014-06-08 02:57:26
阅读次数:
276
点击打开链接
两次求最短路(第二次把边反向求)
1、spfa
//poj 3268 Silver Cow Party
//SPFA
#include
#include
#include
using namespace std;
const int M = 100000 + 100;
const int N = 1000 + 100;
const int inf = 1...
分类:
其他好文 时间:
2014-06-08 05:29:39
阅读次数:
241
Rotating Sentences
In ``Rotating Sentences,'' you are asked to rotate a series of input sentences 90 degrees clockwise. So instead of displaying the input sentences from left to right and top to b...
分类:
其他好文 时间:
2014-06-08 04:51:34
阅读次数:
236
在opencv在开发过程中,我想最频繁的操作(之一)莫过于显示图片了。
学过OpenCV的同学都知道,调用cv::imshow()(或者C版本的ShowImage())可以轻而易举的将图片显示出来。
但是,它会创建一个不这么协调的对话框来显示这个图片,那么在MFC中我们如何让图片显示在指定的位置上呢?
先给个结果图(我使用的是VS2010+OpenCV2.4.8):
第一步:
创...
分类:
其他好文 时间:
2014-06-08 03:50:11
阅读次数:
451
【需要将view的显示区域黑色背景所需的步骤】
1、 简历普通单文档MFC工程(自动关联了DOC VIEW 和Frame三个类)
2、 拷贝Test 工程中的几个函数到目标工程
一、PreCreateWindow【改变窗口类型】
二、OnCreate【调用初始化函数myInitOpenGL】
三、myInitOpenGL【建立DC 和RC并关联二者,其中调用mySetupPixelFor...
分类:
其他好文 时间:
2014-06-08 04:15:16
阅读次数:
247
你刚学会ArrayAdapter、SimpleAdapter
后来你学会了BaseAdapter,你觉得你可以写好多东西了
后来你又学会了下拉刷新,上拉加载,你觉得你会了很多了
再后来,你解决了ListView的item带有checkbox的问题,你觉得对于ListView掌握的差不多了。
突然有一天,你碰到一个特别简单的问题:怎么根据item的控件值来获取控件?
请你告诉我,怎...
分类:
其他好文 时间:
2014-06-08 02:21:50
阅读次数:
225
链表类型list和foreard_list的特定容器算法...
分类:
其他好文 时间:
2014-06-08 05:03:09
阅读次数:
226
Problem Description
lily的好朋友xiaoou333最近很空,他想了一件没有什么意义的事情,就是统计一篇文章里不同单词的总数。下面你的任务是帮助xiaoou333解决这个问题。
Input
有多组数据,每组一行,每组就是一篇小文章。每篇小文章都是由小写字母和空格组成,没有标点符号,遇到#时表示输入结束。
Output
...
分类:
其他好文 时间:
2014-06-08 03:08:15
阅读次数:
221
git clone git-url
git add .
git comm -a -m ' desc '
git push...
分类:
其他好文 时间:
2014-06-08 02:21:09
阅读次数:
217
这个就不写很多不同类的属性和方法了。其中涉及的类有MailMessage类,SmtpClient类
其实可有还有相关的Attachment类:表示电子邮件的附件
以下就直接贴实例代码了:
一共三个窗体:Form1,frmSend,frmReceive
首先是Form1窗体:
后台代码:
using System;
using System.Collections...
分类:
其他好文 时间:
2014-06-08 05:02:33
阅读次数:
160
求两个排序数组的中位数。这个题可以有以下几个思路:
首先可以想到的是将两个数组merge起来,然后返回其中位数。
第二个是,类似merge的思想加上计数,找到(m+n)/2个数或者其前后的数,这个就可以算出中位数。这个方法对于各种情况需要一一考虑到。
第三个,假设A[k/2-1]<B[k/2-1],那么A[k/2-1]之前的数一定在整个有序数列中(m+n)/2之前。
这里我给出后面两种思路的代码。
代码一( 思路三)...
分类:
其他好文 时间:
2014-06-08 03:44:47
阅读次数:
231