基础 树状数组
每输入一组数,就对染色次数进行修改;
#include
#include
#include
using namespace std;
int s[100005],a;
int low(int i)
{
return i&(-i);
}
void show(int q,int w)
{
while(q>0)
{
s[q]+=w;...
分类:
其他好文 时间:
2014-07-22 22:49:35
阅读次数:
188
UVA 10689 - Yet another Number Sequence
题目链接
题意:斐波那契给前两项,求出第n项,并保留m位
思路:挺裸的矩阵快速幂,就是取模的值是10^m
代码:
#include
#include
const int mod[5] = {0, 10, 100, 1000, 10000};
int t, a, b, n, m;
s...
分类:
其他好文 时间:
2014-07-22 00:31:37
阅读次数:
279
Distinct Subsequences
A subsequence of a given sequence is just the given sequence with some elements (possibly none) left out. Formally, given a sequence X = x1x2…xm,
another sequence Z = z1...
分类:
其他好文 时间:
2014-07-21 15:44:16
阅读次数:
244
antlr-2.7.7.jar ANTLR (ANother Tool for Language Recognition) 是一个PCCTS制定的语言工具, 它为他创建认定者,程序编译者,翻译者提供一个 包括 java,c#和C++在内的语法 描述框架, 使用from 多态查询语句时需要...
分类:
编程语言 时间:
2014-07-21 11:28:48
阅读次数:
205
Problem Description
In mathematics, a subsequence is a sequence that can be derived from another sequence by deleting some elements without changing the order of the remaining elements. For example, ...
分类:
其他好文 时间:
2014-07-21 11:13:44
阅读次数:
270
Another recursion problem.class Solution {public: int getHeight(TreeNode *p) { if (!p) return 0; int hL = 1; if (p->left) h...
分类:
其他好文 时间:
2014-07-21 11:10:03
阅读次数:
180
There are two identical boxes. One of them contains n balls, while the other box contains one ball. Alice and Bob invented a game with the boxes and b...
分类:
其他好文 时间:
2014-07-19 14:25:51
阅读次数:
228
Using cron seems
to add another entry point into your application, while Quartz would
integrate into it. So you would be forced to deal with some inter-process communication if you wanted to pass...
分类:
其他好文 时间:
2014-07-19 11:11:44
阅读次数:
373
第一个方法:append()方法 【1】$(selector).append(content)//向匹配的所有标签中的内容末尾处添加Html代码,会编译成页面显示。 1 2 3 4 11 12 13 This is a paragraph.14 This is another para...
分类:
Web程序 时间:
2014-07-18 22:11:16
阅读次数:
329
Another recursion-style problem.1. Each count of sub-solution with a certain root should contribute to final count2. With a certain root, the num of l...
分类:
其他好文 时间:
2014-07-18 18:18:01
阅读次数:
187