摘要: a的b的c次方模1e9+7 #include #include #include #include #include #define PI 3.1415926535898 #define e 2.718281828459 using namespace std; const long long Mod=1e9+7; long long phi(long long x) { long l... 阅读全文
posted @ 2019-05-08 22:24 Leozi 阅读(311) 评论(0) 推荐(0)
摘要: #include #include using namespace std; const long long p=1e7; int main() { char a[150]; long long m,n,k,t,ans,lenth; while(cin>>a>>m>>n) { lenth=strlen(a); k=0; ... 阅读全文
posted @ 2019-05-08 22:24 Leozi 阅读(204) 评论(0) 推荐(0)
摘要: #include using namespace std; const int Mod=10000; int main() { long long n,a,b,c,d,a1,b1,c1,d1,a2,b2,c2,d2; while(cin>>n) { if(n==-1) break; if(n==0||n==1) ... 阅读全文
posted @ 2019-05-08 22:23 Leozi 阅读(370) 评论(0) 推荐(0)
摘要: #include int main() { long long t,n,k,s; scanf("%lld",&t); for(s=0;s0) { k=k+n/5; n=n/5; } printf("%lld\n",k); } } 阅读全文
posted @ 2019-05-08 22:22 Leozi 阅读(205) 评论(0) 推荐(0)
摘要: #include int main() { int a[20]; int m,n,i,k; while(1) {scanf("%d %d",&m,&n); if(m==0&&n==0) break; if(n=0;i--) printf("%d",a[i-1]);} else if(n==10... 阅读全文
posted @ 2019-05-08 22:22 Leozi 阅读(155) 评论(0) 推荐(0)
摘要: #include #include int main() { int lenth1,lenth2,n,i,j,k,s; scanf("%d",&n); for(i=0;ilenth2)?lenth1:lenth2; for(j=0;j9) { z[j+1]++; z[... 阅读全文
posted @ 2019-05-08 22:21 Leozi 阅读(332) 评论(0) 推荐(0)
摘要: #include #include using namespace std; int main() { int T; double x1,x2,x3,y1,y2,y3,a,b,c; cin>>T; while(T--) { scanf("%lf %lf %lf %lf %lf %lf",&x1,&y1,&x2,&y2,&x3,&y3); ... 阅读全文
posted @ 2019-05-08 22:21 Leozi 阅读(543) 评论(0) 推荐(0)
摘要: #include using namespace std; int main() { long long m,n,a[25],k,sum,s; cin>>m>>n; for(int i=0;i>a[i]; } for(int j=1;j0;i>>=1,s++) { if(i&1==1) { ... 阅读全文
posted @ 2019-05-08 22:20 Leozi 阅读(260) 评论(0) 推荐(0)
摘要: 下面是“分数”模运算的定义: b, m互质 k = a/b (mod m) kb = a (mod m) 这里求 x = 1/17 (mod 2668) 17x = 1 (mod 2668) 17x = 2668k + 1 (k∈整数) 取合适的k使得17|(2668k+1) 这里刚好17 | (2668 + 1) 所以k = 1, x = (2668+1)/17 = 157 当然... 阅读全文
posted @ 2019-05-08 22:20 Leozi 阅读(5653) 评论(0) 推荐(3)
摘要: #include #include using namespace std; int line[505][505],m,n,used[505],man[505];; int find(int x) { for(int i=1;i>k) { memset(line,0,sizeof(line)); memset(man,0,sizeof(man));... 阅读全文
posted @ 2019-05-08 22:19 Leozi 阅读(170) 评论(0) 推荐(0)
摘要: #include int main() { long long int m,n,r,a,b,c,x,y,z,k,i,left,right,mid,h,f,e,p,s,g; while(scanf("%lld %lld %lld",&a,&b,&c)!=EOF) { scanf("%lld %lld %lld",&m,&n,&r); scan... 阅读全文
posted @ 2019-05-08 22:19 Leozi 阅读(231) 评论(0) 推荐(0)
摘要: https://www.cnblogs.com/luoxn28/p/5767571.html 阅读全文
posted @ 2019-05-08 22:18 Leozi 阅读(125) 评论(0) 推荐(0)
摘要: #include #include #include using namespace std; int v[200005],s[200005],val[200005]; int main() { int a[6]={1,2,3,4,5,6},b[10],k,sum,h,f,g=0; while(1) { memset(val,0,sizeof(val));... 阅读全文
posted @ 2019-05-08 22:17 Leozi 阅读(223) 评论(0) 推荐(0)
摘要: #include #include using namespace std; int c[100005],d[100005]; int main() { int n,m,a[105],b[105],k; while(cin>>n>>m) { k=0; if(n==0&&m==0) break; for... 阅读全文
posted @ 2019-05-08 22:17 Leozi 阅读(201) 评论(0) 推荐(0)
摘要: #include #define INF 105 using namespace std; int main() { int n,m,d[105][105],mark,x,y,g; while(cin>>n>>m) { mark=0; g=0; for(int i=0;i>x>>y; d[x][y]=... 阅读全文
posted @ 2019-05-08 22:16 Leozi 阅读(219) 评论(0) 推荐(0)
摘要: #include int main() { int m,n,i,a[105],k=0,sum=0,j,s; scanf("%d %d",&m,&n); for(i=0;i0;j>>=1,s++) if(j&1) sum=sum+a[s]; if(sumk) k=sum; ... 阅读全文
posted @ 2019-05-08 22:16 Leozi 阅读(417) 评论(0) 推荐(0)
摘要: #include #include #include using namespace std; const int N = 100001; int mark[N],prime[N],cont=0; void prime_table() { memset(mark,0,sizeof(mark)); mark[0] = mark[1] = 1; for(long long i... 阅读全文
posted @ 2019-05-08 22:15 Leozi 阅读(318) 评论(0) 推荐(0)
摘要: #include #include #include using namespace std; char map[205][205]; int count[205][205]; int a[205][205],b[205][205]; int m,n; const int w=1e7; int u[4][2]={1,0,-1,0,0,1,0,-1}; struct node{ int x... 阅读全文
posted @ 2019-05-08 22:15 Leozi 阅读(1372) 评论(0) 推荐(0)
摘要: #include #include #include #define INF 0x3f3f3f3f using namespace std; int main() { int n,m,x,y,val,now,map[105][105],dis[105],vis[105]; while(cin>>n>>m) { queueq; if(n==0... 阅读全文
posted @ 2019-05-08 22:14 Leozi 阅读(186) 评论(0) 推荐(0)
摘要: #include #include #define INF 0x3f3f3f3f using namespace std; int edge[105][105],d[105]; int Dijstra(int st,int n) { int mark[105],minn,minn_num; memset(mark,0,sizeof(mark)); for(int i=1;... 阅读全文
posted @ 2019-05-08 22:14 Leozi 阅读(109) 评论(0) 推荐(0)
摘要: #include #include #include #include #include using namespace std; char a[100000],b[100000],c[100000]; int x[100000],y[100000],z[100000]; int Muti() { memset(z,0,sizeof(z)); memset(x,0,sizeof... 阅读全文
posted @ 2019-05-08 22:14 Leozi 阅读(307) 评论(0) 推荐(0)
摘要: #include #include #include #include typedef long long ll; using namespace std; ll sum[500050],n; struct node{ ll lf; ll rg; }a[500050]; ll cmp(node x,node y) { if(x.lf==y.lf) retu... 阅读全文
posted @ 2019-05-08 22:13 Leozi 阅读(248) 评论(0) 推荐(0)
摘要: #include using namespace std; int par[1005]; int get_par(int x) { return par[x]==x?x:get_par(par[x]); } int main() { int T,n,m,x,y,cont; cin>>T; while(T--) { cin>>n>>m; ... 阅读全文
posted @ 2019-05-08 22:12 Leozi 阅读(117) 评论(0) 推荐(0)
摘要: #include using namespace std; long long min(long long x1,long long y1,long long z1,long long w1) { long long k1,k2; k1=min(x1,y1); k2=min(z1,w1); return min(k1,k2); } int main() { ... 阅读全文
posted @ 2019-05-08 22:12 Leozi 阅读(170) 评论(0) 推荐(0)
摘要: #include #include #include using namespace std; typedef long long LL; LL work(LL n) { LL ans = 0; for(int k = 0; k >n) cout #include #include using namespace std; typede... 阅读全文
posted @ 2019-05-08 22:11 Leozi 阅读(711) 评论(0) 推荐(0)
摘要: #include #include using namespace std; int main() { /*map mp; map::iterator it; mp[2]='L'; mp[1]='A'; mp[3]='Z'; for(it=mp.begin();it!=mp.end();it++) { coutfirstse... 阅读全文
posted @ 2019-05-08 22:08 Leozi 阅读(186) 评论(0) 推荐(0)
摘要: #include #include #include using namespace std; int main() { int m,n,x; /*vector a; for(int i=0;i>x; a.push_back(x); } for(int i=0;i a[100]; cin>>m>>n; for(int i=0... 阅读全文
posted @ 2019-05-08 22:07 Leozi 阅读(613) 评论(0) 推荐(0)
摘要: #include using namespace std; int a[2005]; int main() { int quicksort(int r,int l); int n,i; while(cin>>n) { if(n==0) { break; } for(i=0;i>... 阅读全文
posted @ 2019-05-08 22:06 Leozi 阅读(120) 评论(0) 推荐(0)
摘要: #include #include #include #define N 50005 using namespace std; int maxx[N][20],minn[N][20],a[N]; int ST(int n) { for(int i=1;i>n>>q; for(int i=1;i<=n;i++) { scanf("%d",&a[i]); ... 阅读全文
posted @ 2019-05-08 22:06 Leozi 阅读(200) 评论(0) 推荐(0)
摘要: c语言中 函数 log(x) 表示是以e为底的自然对数,即 ln(x) 函数 log10(x) 以10为底的对数,即 lg(x) 以其它数为底的对数用换底公式来表示 log(a)/log(b) 函数 log() 和 log10() 包含在头文件<math.h>中 阅读全文
posted @ 2019-05-08 22:05 Leozi 阅读(5673) 评论(0) 推荐(0)
摘要: #include #include int u,n; char a[1005],b[1005],h[1005]; int x[1005],y[1005],z[1005]; int main() { char s(char t[],char o[]); int p,q,i; while(scanf("%d",&n,n!=0)) { for(i=0;iN) ... 阅读全文
posted @ 2019-05-08 22:04 Leozi 阅读(321) 评论(0) 推荐(0)
摘要: struct Complex { double r,i; Complex(double _r = 0,double _i = 0) { r = _r; i = _i; } Complex operator +(const Complex &b) { return Complex(r+b.r,i+b.i); }... 阅读全文
posted @ 2019-05-08 22:03 Leozi 阅读(191) 评论(0) 推荐(0)
摘要: #include #include using namespace std; int mapp[2005][2005],color[2005],n; int dfs(int x,int c) { color[x]=c; for(int i=1;i>T; while(T--) { cin>>n>>m; memset(mapp,0,si... 阅读全文
posted @ 2019-05-08 22:02 Leozi 阅读(377) 评论(0) 推荐(0)
摘要: #include #include #include #include using namespace std; int mapp[2005][2005],color[2005]; int n,m,k; int bfs(int x) { color[x]=1; queue que; que.push(x); while(!que.empty()) { ... 阅读全文
posted @ 2019-05-08 22:01 Leozi 阅读(500) 评论(0) 推荐(0)
摘要: #include #include #include using namespace std; char map[105][105]; int b[105][105]; int m,n; int s[4][2]={-1,0,1,0,0,-1,0,1}; struct node{ int x,y; int step; }; int cheak(int x,int y) { ... 阅读全文
posted @ 2019-05-08 22:00 Leozi 阅读(129) 评论(0) 推荐(0)
摘要: #include #include #include using namespace std; typedef long long LL; int tree[32*100005][2]; LL val[32*100005]; int tot; void First() { memset(tree[0],0,sizeof(tree[0])); tot=1; } void inser... 阅读全文
posted @ 2019-05-08 21:59 Leozi 阅读(331) 评论(0) 推荐(0)
摘要: 二位数组实现01背包算法: 一维数组实现01背包算法: 01背包取的物品是那些,取物品路径,价值,容量: 阅读全文
posted @ 2019-05-08 21:57 Leozi 阅读(194) 评论(0) 推荐(0)
摘要: 数据结构 栈,队列,链表 哈希表,哈希数组 堆,优先队列 双端队列 可并堆 左偏堆 二叉查找树 Treap 伸展树 并查集 集合计数问题 二分图的识别 平衡二叉树 二叉排序树 线段树 一维线段树 二维线段树 树状数组 一维树状数组 N维树状数组 字典树 后缀数组,后缀树 块状链表 哈夫曼树 桶,跳跃 阅读全文
posted @ 2019-05-08 21:38 Leozi 阅读(952) 评论(0) 推荐(0)
摘要: 在使用WPF的时候,我们经常会用到窗体之间传值,下面示例主窗口传值到子窗口,子窗口传值到主窗口的方法。 一、主窗口向子窗口传值 主窗口向子窗口传值主要方法就是在子窗口建立一个接收主窗口值的变量,然后实现传值。 主窗口的Xaml: 视图: 主窗口的后台: 子窗口的Xaml: 视图: 子窗口后台: 传值 阅读全文
posted @ 2019-05-08 21:26 Leozi 阅读(11374) 评论(0) 推荐(3)