题目很简单:分析发现满足杨辉三角,有通项公式,但是是高精度,大数题目。
记录一个大数类模板:以后好用
代码:
#include
#include
using namespace std;
#define MAXN 9999
#define MAXSIZE 10
#define DLEN 4
class BigInt
{
private:
int a[500];
...
分类:
其他好文 时间:
2014-08-08 16:11:06
阅读次数:
279
有一个需求是要在一个云监控程序中存储状态值中存储多个状态(包括可同时存在的各种异常、警告状态)使用了位运算机制在一个int型中存储。现在监控日志数据量非常大(亿级别)需要对数据按每小时、每天进行聚合,供在线报表使用。状态分了3个级别:正常(0)、警告(1)、异常(2),聚合时需要使用max选择最差的...
分类:
数据库 时间:
2014-08-08 12:25:05
阅读次数:
564
模板很重要#include #include #include #include #include using namespace std; #define MAXN 9999#define MAXSIZE 10#define DLEN 4class BigInt{ private: int...
分类:
其他好文 时间:
2014-08-07 21:53:30
阅读次数:
334
-- sql语句耗时百分比declare @tmptb table(id int,name varchar(50),total_worker_time bigint,rate varchar(50),execute_count bigint);with cte1 as(select a.*,t.*f...
分类:
数据库 时间:
2014-08-07 21:52:00
阅读次数:
351
friend表结构
DROP TABLE IF EXISTS FRIEND;
create table friend(
uid bigint not null comment '用户标识',
friend_uid bigint not null comment '申请加为好友的用户标识',
sys_create_date datetime no...
分类:
数据库 时间:
2014-08-07 15:51:50
阅读次数:
272
1.unix时间戳转时间函数
语法: from_unixtime(bigint unixtime[, string format])
返回值: string
说明: 转化UNIX时间戳(从1970-01-01 00:00:00 UTC到指定时间的秒数)到当前时区的时间格式
举例:
hive> select from_unixtime(1323308943,‘yyyyMMdd’) from...
分类:
其他好文 时间:
2014-07-29 17:56:42
阅读次数:
434
多对一(many to one)单向many-to-one关联是最常见的单向关联关系。 create table Person ( personId bigint not null primary key, addressId ...
分类:
系统相关 时间:
2014-07-21 09:35:39
阅读次数:
214
程序中用到一个大整数。存储在 MySQL 数据库那边用了 bigint 类型,程序运算过程中就有了点麻烦。integer用不了,只能用 __int64 这个数据类型。麻烦一,从数据表取数据。以前在数据表取回整形数据时用的都是Query->FieldByName("data")->AsInteger这...
分类:
编程语言 时间:
2014-07-16 15:35:52
阅读次数:
230
bigint 从 -2^63 (-9223372036854775808) 到 2^63-1 (9223372036854775807) 的整型数据(所有数字)。存储大小为 8 个字节。 P.S. bigint已经有长度了,在mysql建表中的length,只是用于显示的位数 int 从 -2^31...
分类:
数据库 时间:
2014-07-16 14:59:40
阅读次数:
187
--=====================================================================事件起因:开发发现有表插入数据失败,查看后发现INT类型自增值已经到了最大值,无法继续插入,需要修改INT类型为BIGINT类型。--============...
分类:
其他好文 时间:
2014-07-15 10:08:34
阅读次数:
191