2015年7月12日

逆元

摘要: #include using namespace std;int inv(int a,int p){ if(a == 1) return 1; return inv(p%a,p)*(p-p/a)%p;}int main(){ int p,a; while(cin >> a >> p){ cout <... 阅读全文

posted @ 2015-07-12 16:26 AC_WQYYY 阅读(136) 评论(0) 推荐(0)

矩阵 构造 模板

摘要: F - Number Sequence#include#includeusing namespace std;struct mat{ int ans[2][2];};mat I,MID;int M;mat cal(mat a,mat b){ mat c; int i,j,k; for(i=0;i>=... 阅读全文

posted @ 2015-07-12 09:53 AC_WQYYY 阅读(131) 评论(0) 推荐(0)

导航