当时想到了贪心,但是不知为何举出了反列。。。。我是逗比,看了点击打开链接。才发现我是逗比。
Problem Description
There is a special number sequence which has n+1 integers. For each number in sequence, we have two rules:
● ai ∈ [0,n]
●...
分类:
其他好文 时间:
2014-09-16 02:44:19
阅读次数:
276
Given a binary tree, find its maximum depth.The maximum depth is the number of nodes along the longest path from the root node down to the farthest le...
分类:
其他好文 时间:
2014-09-16 00:15:49
阅读次数:
196
Given a digit string, return all possible letter combinations that the number could represent.A mapping of digit to letters (just like on the telephon...
分类:
其他好文 时间:
2014-09-16 00:05:09
阅读次数:
405
1 /* 2 题意:a, b两个序列,规定由[0, n]区间的数! 3 求 a[i] ^ b[i] 的和最大! 4 5 思路:如果数字 n的二进制有x位, 那么一定存在一个数字m,使得n^m的所有二进制位 6 都是1,也就是由x位1!这样下去的到的值就是...
分类:
其他好文 时间:
2014-09-15 22:43:39
阅读次数:
226
题目链接:hdu 5014 Number Sequence
题目大意:给定n,表示有0~n这n+1个数组成的序列a,要求构造一个序列b,同样是由0~n组成,要求∑ai⊕bi尽量大。
解题思路:贪心构造,对于n来说,找到n对应二进制的取反对应的数x,那么从x~n之间的数即可两两对应,然后x-1即是一个子问题。
#include
#include
#include
using n...
分类:
其他好文 时间:
2014-09-15 21:25:59
阅读次数:
207
给定数组表示的十进制数,加一操作。结果依然用十进制的数组表示。这里主要注意最高位(digit[0])依然有进位,即溢出的情况。
Given a non-negative number represented as an array of digits, plus one to the number.
The digits are stored such that the most si...
分类:
其他好文 时间:
2014-09-15 21:25:19
阅读次数:
236
实验:使用DBMS_FGA实现细粒度审计
1,创建测试表
TEST_USR1@PROD1> create table audit_test (x number );
Table created.
2,创建审计策略
TEST_USR1@PROD1> conn / as sysdba
Connected.
SYS@PROD1> begin
DBMS_FGA.ADD_POLICY (
...
分类:
数据库 时间:
2014-09-15 21:24:59
阅读次数:
294
Number Sequence
Time Limit: 4000/2000 MS (Java/Others) Memory Limit: 65536/65536 K (Java/Others)
Total Submission(s): 545 Accepted Submission(s): 258
Special Judge
Problem Description
...
分类:
其他好文 时间:
2014-09-15 21:24:49
阅读次数:
341
Problem Description
There is a special number sequence which has n+1 integers. For each number in sequence, we have two rules:
● ai ∈ [0,n]
● ai ≠ aj( i ≠ j )
For sequence a and sequence b,...
分类:
其他好文 时间:
2014-09-15 21:22:10
阅读次数:
240
题目以下思路参考自discuss:http://poj.org/showmessage?message_id=176353/*我的思路:1.将长串数分成一个个部分,每个部分是从1到x的无重复的数字序列2.每个序列比前一个序列多的位数是他的最后一个数的位数,如12345678910比123456789...
分类:
其他好文 时间:
2014-09-15 21:01:49
阅读次数:
186