题目来源:HDU 1542 Atlantis
题意:给你一些矩形(左下角和右上角)求面积
思路:参考here这个超赞的 一看就懂了
#include
#include
#include
#include
using namespace std;
const int maxn = 210;
struct node
{
double l, r, h;
int s, val;
nod...
分类:
其他好文 时间:
2014-05-07 08:59:09
阅读次数:
395
In file included from mod_shib_20.cpp:68:
mod_shib.cpp:118: warning: deprecated conversion from string constant to 'char*'
mod_shib.cpp: In member function 'virtual const char* ShibTargetApache::get...
分类:
其他好文 时间:
2014-05-07 06:04:50
阅读次数:
363
以前的模板和题目
白书例题,基本模板,多个串连接时的处理,二分加分组的处理。
注意n和m的值
n为字符个数
m为最大字符值+1
分组时,分出来的区间是[ ),左闭右开
idx[],的有效只是1-t-1,为t表示自己添加的字符
#include
#include
#include
#include
using namespace std;
const int maxn = ...
分类:
其他好文 时间:
2014-05-07 04:50:29
阅读次数:
250
《算法导论》里的COUNTING_SORT,用C++实现有问题:
#include
#include
using namespace std;
void COUNTING_SORT(vectorint>&A, vectorint>&B, const int& k)
{
int* C = new int[k + 1]();
for (unsigned j = 0; j A.size();...
分类:
其他好文 时间:
2014-05-07 02:59:30
阅读次数:
251
1、const、mutable与volatile的区别:const表明内存被初始化以后,程序将不能对它进行修改。volatile则表明,即使程序代码没有对内存单元进行修改,但是里面的值也可能会发生变化。例如:将一个指针指向某个硬件位置,其中包含了来自串行端口的时间和信息,在某些情况下,硬件而不是程序...
分类:
编程语言 时间:
2014-05-06 23:53:29
阅读次数:
518
n个数,只能用
F[i][j]=(F[i-1][j]+F[i-1][j-1])*j
F[i][j]代表i个数,有j个不同值的情况。比如A
大数模板
#include
#include
const int MAX =505;
struct BigNum
{
int num[MAX];
int len;
} a[51][51];
BigNum Add(...
分类:
其他好文 时间:
2014-05-06 23:06:51
阅读次数:
364
题意:一个A和两个B一共可以组成三种字符串:"ABB","BAB","BBA".
给定若干字母和它们相应的个数,计算一共可以组成多少个不同的字符串.
思路:
(a1+a2+ ... +an)! / a1! / a2! / ... / an! 大数
#include
#include
const int MAX =5...
分类:
其他好文 时间:
2014-05-06 23:05:30
阅读次数:
323
You are given an N × N grid initially filled by zeros. Let the rows and columns of the grid be numbered from1 to N, inclusive. There are two types of operations can be applied to the grid:
RowAdd R...
分类:
其他好文 时间:
2014-05-06 22:35:44
阅读次数:
451
让我们简单Let’s take a look at three (very basic) ways to get a scoped token from Keystone (theOpenStack Identity
Project). Keep in mind that these are just a few ways you can go about this. Before tryin...
分类:
其他好文 时间:
2014-05-06 19:30:32
阅读次数:
359
#2.bool类型和const类型bool类型const限定符const与#define结构体内存对齐bool类型逻辑型也称布尔型,其取值为true(逻辑真)和false(逻辑假),存储字节数在不同编译系统中可能有所不同,VC++中为1个字节。声明方式:boolresult;result=true;可以当作整数用(true一般为1,fa..
分类:
其他好文 时间:
2014-05-06 16:25:36
阅读次数:
331