摘要: #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 阅读(192) 评论(0) 推荐(0) 编辑
摘要: 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 阅读(297) 评论(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 阅读(353) 评论(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 阅读(197) 评论(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 阅读(145) 评论(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 阅读(315) 评论(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 阅读(519) 评论(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 阅读(248) 评论(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 阅读(5409) 评论(0) 推荐(3) 编辑
摘要: #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 阅读(223) 评论(0) 推荐(0) 编辑
摘要: #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 阅读(160) 评论(0) 推荐(0) 编辑
摘要: https://www.cnblogs.com/luoxn28/p/5767571.html 阅读全文
posted @ 2019-05-08 22:18 Leozi 阅读(118) 评论(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 阅读(213) 评论(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 阅读(191) 评论(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 阅读(208) 评论(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 阅读(383) 评论(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 阅读(301) 评论(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 阅读(1352) 评论(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 阅读(290) 评论(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 阅读(100) 评论(0) 推荐(0) 编辑