Amber
训练做的题里有板子单独拉出来。
欧拉筛
int vis[N+],prim[N+];
int cnt;
void Eular()
{
vis[]=vis[]=;
for(int i=;i<N;i++)
if(!vis[i])
{
prim[cnt++]=i;
for(ll j=(ll)i*i;j<N;j+=i) vis[j]=;
}
}
辗转相除法求逆元
ll ans,re;
void e_gcd(ll a,ll b)
{
if(b==)
{
ans=,re=;
return;
}
e_gcd(b,a%b);
ll temp=ans;
ans=re; ///***
re=temp-a/b*re;
}
SPFA找环【bfs
int vis[N];
bool spfa_bfs()
{
ans[s]=v;
vis[s]=;
queue<int> qu;
qu.push(s);
while(!qu.empty())
{
int node=qu.front();
qu.pop();
vis[node]=;
for(int i=;i<=n;i++)
{
if(ans[i]<(ans[node]-ma2[node][i])*ma1[node][i])
{
ans[i]=(ans[node]-ma2[node][i])*ma1[node][i];
if(ans[s]>v) return true;
if(!vis[i]) qu.push(i),vis[i]=;
}
}
}
return false;
}
二维树状数组
int ma[N][N];
int n,m;
inline int lowbit(int x){return x&-x;}
void updata(int x,int y)
{
for(int i=x;i<=n;i+=lowbit(i))
for(int j=y;j<=m;j+=lowbit(j)) ma[i][j]++;
}
int query(int x,int y)
{
int res=;
for(int i=x;i>;i-=lowbit(i))
for(int j=y;j>;j-=lowbit(j)) res+=ma[i][j];
return res;
}
矩阵相乘&矩阵快速幂
int n;
struct p{
double matris[][];
}Rl,tep,res,wat,ans;
void init()
{
memset(Rl.matris,,sizeof(Rl.matris));
memset(res.matris,,sizeof(res.matris));
memset(tep.matris,,sizeof(tep.matris));
memset(wat.matris,,sizeof(wat.matris));
for(int i=;i<=n;i++) tep.matris[i][i]=;
}
p Matris(p a,p b)
{
p tem;
memset(tem.matris,,sizeof(tem.matris));
for(int i=;i<=n;i++)
for(int j=;j<=n;j++)
for(int k=;k<=n;k++)
tem.matris[i][j]+=a.matris[i][k]*b.matris[k][j];
return tem;
}
p quick_mi(ll n)
{
p m=Rl,b=tep;
while(n)
{
if(n&) b=Matris(b,m);
m=Matris(m,m);
n/=;
}
return b;
}
Amber的更多相关文章
- AMBER: CPPTRAJ Tutorial C0
CPPTRAJ作为PTRAJ的继任者,拥有比PTRAJ更强大的功能,本教程会简要的介绍CPPTRAJ的用法及注意事项. 需要的文件: trpzip2.gb.nc trpzip2.ff10.mbondi ...
- 使用AMBER中遇到的一些问题
1.读取蛋白问题 读取无配体pdb文件(loadpdb complex.pdb)时,出现一堆 FATAL: Atom .R<ARG >.A<HD1 > does not hav ...
- Amber TUTORIAL 4b: Using Antechamber to Create LEaP Input Files for Simulating Sustiva (efavirenz)-RT complex using the General Amber Force Field (GAFF)
sustiva.pdb PDB: 1FKO Create parameter and coordinate files for Sustiva 1. 加氢: $ reduce sustiva.pdb ...
- Amber TUTORIAL B1: Simulating a DNA polyA-polyT Decamer
Section 1: Introduction The input files required (using their default file names): prmtop - a file c ...
- Amber中的一些option设置及名词
详细请见AMBER官方文档第18章第6节(18.6) Amber16.pdf The settings can be summarized as follows: imin=1 Choose a m ...
- Amber TUTORIAL B5: Simulating the Green Fluorescent Protein
Section 1: Preparing the PDB file 1EMA是本次教程所用的pdb,可以在PDB数据库下载. pdb4amber -i 1EMA.pdb -o gfp.pdb --dr ...
- Amber安装并行
现在简单介绍一下amber12中安装openmpi并行的过程. 1. 下载openmpi版本在1.5-1.9之间的(openmpi-1.6.5.tar.bz2) 这是因为$AMBERHOME/Ambe ...
- amber模拟kcl水溶液
最近刚开始学习amber软件,看网上的教程勉强知道怎么操作这个amber了.就暂时跑了个分子动力学,其他的啥也没处理.先把我的操作过程记录下来吧,免得日后忘记. 一.构建kcl.pdb结构 利用Gau ...
- Amber learning note A8: Loop Dynamics of the HIV-1 Integrase Core Domain
1. Prepare Input File $ tleap >source leaprc.protein.ff14SB ----- Source: /home/wangq/Programs/am ...
随机推荐
- C89标准和C99标准C11标准的区别
转载 C89标准和C99标准C11标准的区别 C99对C89的改变 1.增加restrict指针 C99中增加了公适用于指针的restrict类型修饰符,它是初始访问指针所指对象的惟一途径,因此只有借 ...
- git Windows终端安装教程
1.下载网址:https://gitforwindows.org/ 2.双击压缩包出现: 3.点击下一步后,选择安装路径: 根据自己的需求选择路径 4.选择安装的组件,建议全选 [每一条解析:] Ad ...
- UNIX网络编程总结三
套接口结构 IPv4套接口地址结构: 1 2 3 4 5 6 7 struct sockaddr_in{/*16字节*/ uint8_t sin_len; /*结构体长度,8位*/ sa_famil ...
- this与super的区别
调用super()的语句必须要写在子类构造方法的第一行. super()是在子类中调用父类的构造方法:this()是在同一类中调用其它方法. super()和this()都需要放在构造函数的第一行. ...
- find 查找目录下的文件
1. 命令功能 find命令用于查到目录下的文件,同时也可以调用其它命令执行相应操作. 2. 语法格式 find [-H] [-L] [-P] [-Olevel] [-D help|tree|sear ...
- sqlmap 基本使用步骤(二)
post------------------------------------------------------------------1.使用 -rpython sqlmap.py -r pos ...
- 线程工具类 - CountDownLatch(倒计时器)
CountDownLatch官方文档 一.原理 CountDownLatch是一个非常实用的多线程控制工具类.Count Down在英文中意为倒计时,Latch意为门闩,可以简单的将CountDown ...
- vue服务器端渲染指南研究
什么是服务器端渲染(SSR)? Vue.js 是构建客户端应用程序的框架.默认情况下,可以在浏览器中输出 Vue 组件,进行生成 DOM 和操作 DOM.然而,也可以将同一个组件渲染为服务器端的 HT ...
- handy源码阅读(二):EventsImp类
EventsImp用于完成事件的处理. class EventsImp { EventBase* base_; PollerBase* poller_; std::atomic<bool> ...
- python学习笔记(十七)flask模块写接口
import flask,json from tools import op_mysql #op_mysql() # 接口,后台服务 server = flask.Flask(__name__) #把 ...