Subsequence
Time Limit: 1000MS
Memory Limit: 65536K
Total Submissions: 8128
Accepted: 3141
Description
A sequence of N positive integers (10 < N < 100 000), each of t...
分类:
其他好文 时间:
2014-05-18 15:26:37
阅读次数:
284
迷宫规模较大,DFS必然超时。注意到行走方向只有上、下、右三个,意味着已走过的路不能再走,更意味着不用回溯。且问题问的是最大值。一切都清晰地指向了DP!...
分类:
其他好文 时间:
2014-05-18 15:16:29
阅读次数:
328
【调试渲染】
将TestCpp里Box2DTestBed的GLES-Render.h/cpp添加到项目中,声明绘制变量:GLESDebugDraw
mDebugDraw。
【创建世界】
// 根据重力创建世界
b2Vec2 gravity;
gravity.Set(0.0f, -10.0f);
mWorld = new b2World(gravity);
// 设置调试...
分类:
其他好文 时间:
2014-05-18 14:58:02
阅读次数:
316
背景,任务栏(开始按钮等都算这里),桌面图标
屏幕下方整个的长条部分、也就是从“开始”一直到系统时钟这个整体,总称为任务栏。
任务栏由下面几部分组成
1、“开始”按钮。
2、当前运行任务的按钮,也就是你说的“【开始】和【输入法】中间那长长的部分”
3、自定义工具栏。就是1和2之间的部分,就是有快速启动按钮的那一部分。
4、系统通知区域。也就是你现在提问的部分。
5、系统时钟。
这...
4Sum
Given an array S of n integers, are there elements a, b, c, and d in S such that a + b + c + d = target? Find all unique quadruplets in the array which gives the sum of target....
分类:
其他好文 时间:
2014-05-18 13:49:09
阅读次数:
306
题目链接:11375 - Matches
题目大意:给出n根火柴,问说能组成多少种数字,要求说0不能打头。
解题思路:d[i]表示i根火柴能够组成的数量,d[i+c[j]] = d[i+c[j]] + d[i];
最后dp[i]表示小于等于i根火柴能组成的数量,dp[i]=∑jidp[j].
高精度。
#include
#include
#include
using na...
分类:
其他好文 时间:
2014-05-18 10:21:35
阅读次数:
286
//普通方法
void strcpy1(char str1[], char str2[]){
int i = 0;
for (; str2[i] != '\0'; i++){
str1[i] = str2[i];
}
str1[i] = '\0';
}
//简练方法
void strcpy2(char str1[], char str2[]){
int i = 0;
whil...
分类:
其他好文 时间:
2014-05-18 09:47:40
阅读次数:
273
C++对象模型内存布局如下:
非静态数据成员在对象之内静态数据成员在对象之外静态、非静态成员函数在对象之外类中存在虚函数时,一个类对应一个virtual table放在对象之外,对象中安插一个指针vptr指向这个表。
测试例程:
#include
using namespace std;
class A {
public:
int x, y;
static...
分类:
编程语言 时间:
2014-05-18 07:46:31
阅读次数:
234
Wrote by mutouyun. (http://darkc.at/a-tricky-code/)
刚刚在网上闲逛,看到reddit上关于最受欢迎的代码的讨论贴,上面有一小段非常有意思的代码:
unsigned int v; // to count the number of bits set in v
unsigned int c; // c accumulates the ...
分类:
其他好文 时间:
2014-05-18 07:44:31
阅读次数:
284