- 博客(15)
- 收藏
- 关注
原创 康托展开
康托展开笔记namespace cantor{ long long* fac=new long long[20]; fac[0]=fac[1]=1; for(int i=2;i<=20;i++) fac[i]=fac[i-1]*i; template<typename typeofarray> inline long long cantor(typeofarra...
2019-05-25 12:01:18
165
原创 STL_list
#include <bits/stdc++.h>using namespace std;struct node{ int Number; bool operator==(node b)const{ return this->Number==b.Number; } bool operator!=(node b)const{ return ...
2019-03-02 15:38:32
166
原创 单源最短路径(DJ)
#include <cstdio>#include <queue>#include <algorithm>#include <iostream>#define INF 2147483647using namespace std;struct node{ int dis; int to; int next;};...
2019-03-01 18:13:40
326
原创 康托展开
#include <bits/stdc++.h>using namespace std;int main(){ //init(); long long* fac=new long long[20]; fac[0]=fac[1]=1; for(int i=2;i<=20;i++) fac[i]=fac[i-1]*i;// for(int i=0;i<=20...
2019-02-16 11:30:37
107
原创 PowerMod
/*快速乘取模*/ #define Mod %100000007long long Powermod(long long a,long long b){//a*b%c long long ans=0; a=a Mod; while(b){ if(b&1) ans=(ans+b) Mod; a=(a+a) Mod; b>>=1; } retur...
2018-10-04 16:37:27
1222
原创 SPFA(模板)
#include <cstdio>#include <queue>const int INF=2147483647;const int max_edge=50000+100;const int max_node=10000+100;struct edge{ int to,next; int dis;};edge pic[max_edge*2];in...
2018-09-27 19:42:48
250
原创 2004 合并果子
#include<iostream>#include<algorithm>#include<queue>using namespace std;priority_queue<int,vector<int>,greater<int> > q;int main(){ int a,n,ans=0; ...
2018-09-25 17:48:36
116
原创 减法(高精度)
int a[10000],b[10000],c[10000];int lena,lenb,lenc;char sa[10000],sb[10000];int Powerj(){ scanf("%s %s",sa,sb); lena=strlen(sa); lenb=strlen(sb); if(lenb>lena||(lena==lenb&&a...
2018-09-08 16:36:48
781
原创 加法(高精度)
int a[10000],b[10000],c[10000];int lena,lenb,lenc;char sa[10000],sb[10000];int Powerj(){ scanf("%s %s",sa,sb); lena=strlen(sa); lenb=strlen(sb); for(int i=1;i<=lena;i++) a[i]=sa...
2018-09-08 16:27:36
120
原创 比较(高精度)
char sa[10000];char sb[10000];int a[10000];int b[10000];int m_in(){ scanf("%s %s",sa,sb); int lena=strlen(sa); int lenb=strlen(sb); for(int i=1;i<=lena;i++){ a[i]=sa[le...
2018-09-08 16:19:43
479
转载 同余定理
sorry,仅仅笔记;想了解具体另找高见。同余转化1.(a+b)%n=(a%n+b%n)%n2.(a-b) % n = ( a%n - b%n ) %n3.(a*b) % n = ( a%n * b%n ) %n4.(a^b) % n = ( (a%n) ^ b ) % n扩展欧几里得相对与欧几里得多的代码的讲解 令a'=b; b' = a % b...
2018-08-21 09:19:18
814
原创 常用库函数及头文件
1.排序 sort(a,b,c) 头文件:#include <algorithm>2.字符串与整实型转换 一、string转int a(int变量)=atoi(b(string变量).c_str()) 头文件:#include <cstdlib> 二、string转float a(float变量)=...
2018-08-20 16:57:00
1359
转载 Tip:1
a++与++a//前缀形式,如++aint &int::operator++(){ *this+=1; return *this;}//后缀形式,如a++,由于返回的是副本,所以设定了const int,因为给oldvalue赋值是危险的,函数出栈动作结束后,oldvalue就消失了。const int int::operator++(int){...
2018-08-18 19:41:50
195
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人