码迷,mamicode.com
首页 >  
搜索关键字:using password: yes    ( 53562个结果
模板具体化
#ifndef SWAP_H_INCLUDED#define SWAP_H_INCLUDED#include using namespace std;struct Job{ string name; int salary;};template void Swap(T &a, T &b);...
分类:其他好文   时间:2014-05-16 01:14:38    阅读次数:340
HDU 4811 Ball(贪心)
http://acm.hdu.edu.cn/showproblem.php?pid=4811 推理一下,发现可以先求出后面放小球可以加分的最大值,然后前面的和为0 + 1 + 2 + ...+ max,max最大为6,因为每个球最多算左右两边 代码: #include #include using namespace std; long long a, b, c; long long ...
分类:其他好文   时间:2014-05-15 23:04:28    阅读次数:387
单链表的排序 快速排序 归并排序 quicksort mergesort
原理都很简单,关键是某些边界能否正确写对: #include #include using namespace std; class Node { public: int val; Node* next; Node(int val = 0):val(val),next(NULL){ } }; Node* quicksort(Node* head, Node* tai...
分类:其他好文   时间:2014-05-15 20:27:36    阅读次数:296
ZOJ 3635 线段树
线段树维护的是区间有多少个空位置,每次查询第X个空位置在哪,sum[rt]>=X就向左区间找,sum[rt] #include #include #include using namespace std; #define lson l , m , rt << 1 #define rson m + 1 , r , rt << 1 | 1 const int maxn = 55555; int...
分类:其他好文   时间:2014-05-15 20:19:48    阅读次数:256
wikioi 1282 约瑟夫问题 线段树
和上一题一样,寻找第K个位置,只不过需要处理一下下一个位置在哪,画图看看就知道了。 #include #include #include using namespace std; #define lson l , m , rt << 1 #define rson m + 1 , r , rt << 1 | 1 const int maxn = 30000+5; int sum[maxn<<...
分类:其他好文   时间:2014-05-15 20:07:28    阅读次数:262
算法 — partial_sort
partial_sort接受一个middle迭代器,使序列中的middle-first个最小元素以递增顺序排序,置于[first, middle)内。下面是测试代码: #include #include #include using namespace std; int main() { int a[] = {10,9,8,7,6,5,4,3,2,1,0}; vec...
分类:其他好文   时间:2014-05-15 19:23:27    阅读次数:361
NPOI DataGridView导出EXCEL
NPOI 官方网站 http://npoi.codeplex.com/ 加载NPOI.DLL ,引用这两个命名空间 using NPOI.HSSF.UserModel; using NPOI.SS.UserModel; #region NPOI DataGridView 导出 EXCEL /// /...
分类:Windows程序   时间:2014-05-15 17:47:20    阅读次数:536
A coroutine example: Streaming XML parsing using xml_parser
send($data)`. The sent data will then* be the result of the `yield` expression. Thus it can be received using a code like* `$data = yield;`.*/ /* What...
分类:其他好文   时间:2014-05-15 17:46:37    阅读次数:311
交换密钥与安全传输
1 using System; 2 using System.Collections.Generic; 3 using System.Linq; 4 using System.Text; 5 using System.Threading.Tasks; 6 using System.Security....
分类:其他好文   时间:2014-05-15 17:20:45    阅读次数:329
Linq:First FirstOrDefault
using System;using System.Collections.Generic;using System.Linq;using System.Text;using System.Data;using System.Reflection;namespace TestConsole{ ...
分类:其他好文   时间:2014-05-15 17:07:04    阅读次数:187
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!