不定期更新,跟着自己的进度走的。

有什么好的东西可以收录的尽管留言

UPD:话说真的没人发现本宝宝的$Martix$类的$operator$打错了么?$qwq$ $2018.7.19$

/*by Qingnian Su,Only want to write sonething useful*/
#ifndef suqingnian
#define suqingnian template<typename _Element_pow>
_Element_pow
_pow(_Element_pow _a,_Element_pow _b,_Element_pow _mod)
{
_Element_pow _res=;
for(;_b;_b >>= , _a= _a * _a % _mod)
if(_b & ) _res = _res * _a % _mod;
return _res ;
} template<typename _Element_gcd>
_Element_gcd
_gcd(_Element_gcd _m, _Element_gcd _n)
{
while (_n != )
{
_Element_gcd _t = _m % _n;
_m = _n;
_n = _t;
}
return _m;
} bool __check[];
int __size;
int _num[];
void _prime(int __n)
{
for(int _i=;_i<=__n;_i++)
{
if(!__check[_i]) _num[__size++]=_i;
for(int _j=;_j<__size;_j++)
{
if(_i*_num[_j]>__n) break;
__check[_num[_j]*_i]=;
if(_i%_num[_j]==) break;
}
}
return ;
}
bool _isprime(int __n) {return ~__check[__n];} template<typename _Element_stack>
struct _stack{
_Element_stack __st[];
int __size_st;
void __push(_Element_stack __x)
{__st[++__size_st]=__x;return ;}
void __pop()
{__size_st--;return ;}
_Element_stack __top()
{return __st[__size_st];}
bool _empty() {return __size_st==;}
}; template<typename _Element_compare_max>
_Element_compare_max
_max(
const _Element_compare_max &a,
const _Element_compare_max &b )
{ return a > b ? a : b ;} template<typename _Element_compare_min>
_Element_compare_min
_min(
const _Element_compare_min &a,
const _Element_compare_min &b )
{ return a > b ? b : a ;} template<typename _Element_fabs>
_Element_fabs
_fabs(
const _Element_fabs &a )
{return a>(_Element_fabs)?a:-a;} template<typename _Element_swap>
void
_swap(
_Element_swap &a,
_Element_swap &b ){
a^=b^=a^=b;
return ;
} #include<cstdio>
struct file_io{
#define isdigit(ch) ((ch) >= '0' && (ch) <= '9')
char inbuf[ << ], *pin ,
outbuf[ << ], *pout ;
int stk[ ] ; file_io():
pout( outbuf ) {
fread( pin = inbuf, , << , stdin );
} ~file_io() {
fwrite( outbuf , , pout - outbuf , stdout ) ;
} inline void
getint( int &num ){
bool
neg = ;
num = ;
while( !isdigit( *pin ))
if( *pin++ == '-' )
neg = ;
while( isdigit( *pin ))
num = num * + *pin++ - '';
if( neg )
num = -num;
} inline void
putint( int num ){
static int
*v = stk;
if( !num )
*pout++ = '';
else{
if( num < )
*pout++ = '-', num = -num;
for( ; num ; num /= )
*v++ = num % ;
while(v != stk )
*pout++ = *--v + '';
}
} inline void
nextline() {
*pout++ = '\n';
}
}fio;
#define getint(num) fio.tint(num)
#define putint(num) fio.putint(num)
#define nextline() fio.nextline()
//template<typename _Element_Martix>
const double eps=0.00000000000000000001;
struct _Martix{
int
num[][];
int siz;
friend _Martix operator*
( const _Martix &__a,const _Martix &__b)
{
_Martix __c;
int _n
= _max ( __a.siz , __b.siz ); for( int _k = ; _k < _n ; _k ++ )
for( int _i = ; _i < _n ; _i ++ )
for( int _j = ; _j < _n ; _j ++ )
__c.num[_i][_j] +=
__a.num[_i][_k] * __b.num[_k][_j] ; __c.siz = _n;
return __c;
} friend _Martix operator+
( const _Martix &__a,const _Martix &__b)
{
_Martix __c;
int _n
= _max ( __a.siz , __b.siz );
for( int _i = ; _i < _n ; _i ++ )
for( int _j = ; _j < _n ; _j ++ )
__c.num[_i][_j] = __a.num[_i][_j] + __b.num[_i][_j] ;
__c.siz = _n;
return __c;
} friend _Martix operator-
( const _Martix &__a,const _Martix &__b)
{
_Martix __c;
int _n
= _max ( __a.siz , __b.siz );
for( int _i = ; _i < _n ; _i ++ )
for( int _j = ; _j < _n ; _j ++ )
__c.num[_i][_j] = __a.num[_i][_j] - __b.num[_i][_j] ;
__c.siz = _n;
return __c;
}
/*
inline int* operator []
( const int& __x )
{return num[__x];} inline bool cmp(const double &x){
return x < -eps ? - : x > eps ;} inline double
_getnum(){
double ans = 1.0 ;
for( int i = ; i <= siz ; i ++ ){
int nw = i;
for( int j = i + ; j <= siz ; j ++ )
if(_fabs(num[j][i]) > _fabs(num[nw][i]))
nw=j; for( int j = ; j <= siz ; j ++ )
_swap(num[nw][j],num[i][j]); for( int j = i + ; j <= siz ; j ++ ){
double t = num[j][i]/num[i][i];
for( int k = i ; k <= siz ; k ++ )
num[j][k] -= num[i][k] * t;
} if(!cmp(num[i][i])) return 0.0;
ans *= num[i][i];
}
return _fabs( ans );
}
*/
};
#endif

本宝宝暂时把$128int$注释掉了,因为本宝宝写挂了。

期待suqingnian.h的更多相关文章

  1. bzoj1050旅行

    题目链接 其实没有辣么难, 暴力枚举最小边是哪条边,然后每次跑一边最小生成树, 当$s,t$刚好联通时最后加的边的权值就是当前的最大边最小的情况 然后判断一下,更新答案就好 /************ ...

  2. bzoj1875 HH去散步

    题目链接 一开始特别天真, $Folyd$传递闭包写了一下过了样例就交上去了 然后$gg$ $qwq$ 想了想$……$ 还要写一点东西 最后统计答案的时候有细节要注意 /*************** ...

  3. bzoj1801中国象棋

    题目链接 很裸的$dp+$组合计数 注意 注意 注意 $BZOJ$不要用玄学优化 $CE$不管$qwq$ /********************************************** ...

  4. bzoj1009GT考试

    题目链接 没啥好说的,矩阵优化+$kmp$字符串匹配 上代码: /************************************************************** Prob ...

  5. bzoj2440完全平方数

    题目链接 上来先吐槽题面!!!!!! 你跟我说$1$不是完全平方数昂? 看了半天样例啊. 活生生的半天$……$ 莫比乌斯 反演    函数容斥一下,每次二分就好 反正本宝宝不知道反演是啥. 每次判断应 ...

  6. Android IOS WebRTC 音视频开发总结(七九)-- WebRTC选择H.264的四大理由

    本文主要介绍WebRTC选择H.264的理由(我们翻译和整理的,译者:weizhenwei,校验:blacker),最早发表在[编风网] 支持原创,转载必须注明出处,欢迎关注我的微信公众号blacke ...

  7. 彻底弄清c标准库中string.h里的常用函数用法

    在我们平常写的c/c++程序,一些算法题中,我们常常会用到c标准库中string.h文件中的函数,这些函数主要用于处理内存,字符串相关操作,是很有用的工具函数.而且有些时候,在笔试或面试中也会出现让你 ...

  8. vlc源码分析(六) 调用OpenMAX硬解码H.265

    H.265(HEVC)编码格式能够在得到相同编码质量视频的前提下,使用相当于H.264(AVC)一半的存储容量,虽然H.265的算法复杂度比H.264高一个数量级,但是硬件水平在不断提高,因此H.26 ...

  9. STL stl_alloc.h

    # // Comment By: 凝霜 # // E-mail: mdl2009@vip.qq.com # // Blog: http://blog.csdn.net/mdl13412 # # // ...

随机推荐

  1. 使用airmon-ng工具开启监听模式

    使用ifconfig命令查看活动的网络接口 可以看出网卡已经激活了,然后将网卡设置为混杂模式 root@sch01ar:~# airmon-ng start wlan0 用ifconfig查看网卡是否 ...

  2. springboot成神之——ioc容器(依赖注入)

    springboot成神之--ioc容器(依赖注入) spring的ioc功能 文件目录结构 lang Chinese English GreetingService MyRepository MyC ...

  3. java事件监听机制2

    今天早上的两点收获: 1.addActionListener(其中的setActionCommand函数就是要对对象进行唯一性的标记,便于消息传来后进行处理.理论上actionlistener可以全部 ...

  4. Mybatis工具Generator

    转自:http://www.cuiyongzhi.com/post/36.html MyBatis Generator(以下简称为MBG),可以逆向生成持久层的基本代码,而且mybatis的实现方案比 ...

  5. Django中间件限制用户访问频率

    原:https://blog.csdn.net/weixin_38748717/article/details/79095399 一.定义限制访问频率的中间件 common/middleware.py ...

  6. 15-EasyNetQ之对延迟消息插件的支持

    RabbitMQ延迟消息插件仍然在实验阶段.你使用这个功能要自担风险. RabbitMQ延迟消息插件为RabbitMQ增加了新的交换机类型,允许延时消息投递. EasyNetQ为交换机通过定义一种新的 ...

  7. JS 页面刷新或重载

    一.先来看一个简单的例子:下面以三个页面分别命名为frame.html.top.html.bottom.html为例来具体说明如何做.frame.html 由上(top.html)下(bottom.h ...

  8. 【bzoj4296】再见Xor

    4269: 再见Xor Time Limit: 10 Sec  Memory Limit: 512 MBSubmit: 176  Solved: 107[Submit][Status][Discuss ...

  9. IDEA03 连接数据库、自动生成实体类

    1 版本说明 JDK:1.8 MAVEN:3.5 SpringBoot:2.0.4 IDEA:旗舰版207.2 MySQL:5.5 2 利用IDEA连接数据库 说明:本案例以MySQL为例 2.1 打 ...

  10. opencv3读取视频并保存为图片

    #include <iostream> #include <vector> #include <opencv2/opencv.hpp> using namespac ...