- 博客(303)
- 收藏
- 关注
原创 Manacher算法模板(救救蒟蒻在 HDU T了)http://acm.hdu.edu.cn/
#include<iostream>#include<cstdio>#include<cstring>#include<vector>#include<algorithm>using namespace std;long long int p[710000];void ma(string s){ string t=...
2019-08-20 22:12:20
288
原创 1459:friends
#include<iostream>#include<cstdio>#include<algorithm>#include<cstring>using namespace std;char s[3000110];unsigned long long int power[3000110];unsigned long long int h[...
2019-08-20 19:20:48
1012
原创 1458:Seek the Name, Seek the Fame
没看见有人用哈希做的,发一下哈希代码,思路就是算出每一段哈希值,进行比较;(太弱不会KMP)#include<iostream>#include<cstdio>#include<algorithm>#include<cstring>using namespace std;char s[500009];unsigned lo...
2019-08-18 20:37:34
619
原创 1447:靶形数独
#include<iostream>#include<cstdio>#include<algorithm>#include<cstring>using namespace std;int f1[12][12];int f2[12][12];int f3[12][12];int c[12][12];int map[12][12];i...
2019-08-10 20:14:22
563
原创 1446:素数方阵 90'代码
#include<iostream>#include<cstdio>#include<cstring>#include<algorithm>#include<math.h>using namespace std;bool qz[100000];bool hz[100000];int djx1,djx2;int l[6]...
2019-08-10 11:59:58
947
原创 1445:平板涂色
#include<iostream>#include<cstdio>#include<algorithm>#include<cstring>using namespace std;int map[150][150];struct node{ int x1,y1,x2,y2,co;};node bl[30];int flag...
2019-08-08 19:08:20
624
原创 1444:埃及分数
#include<iostream>#include<cstdio>#include<cstring>#include<algorithm>using namespace std;long long int ans[10009];//相乘要long long;long long int now[10009];long long int ...
2019-08-07 22:24:13
929
原创 1443:【例题4】Addition Chains
#include<iostream>#include<cstdio>#include<cstring>using namespace std;int ans[20];int now[20];int m,n;void dfs(int p){ if(p>=m)return; if(now[p]>n)return; ...
2019-08-04 20:34:59
535
原创 「一本通 1.3 例 3」小木棍
#include<iostream>#include<cstdio>#include<cstring>#include<algorithm>using namespace std;int a[70];int used[70];int m;int x;int lent;bool cmp(int a,int b){ retu...
2019-08-04 19:20:52
258
原创 数学精编
#include<iostream>#include<cstdio>#include<cstring>#include<deque>using namespace std;long long int a[50009];long long int f[50009];deque<int> q;long long int m,n...
2019-07-26 10:32:44
187
原创 跳房子
#include<cstdio>#include<iostream>#include<cstring>#include<algorithm>using namespace std;struct node{ long long int dis,va;};node c[500009];long long int f[500009...
2019-07-24 23:28:29
220
原创 P1314 聪明的质监员
#include<iostream>#include<cstdio>#include<algorithm>using namespace std;struct node{ long long int vv,ii;};struct node2{ long long int r,l;};node2 c[2000009];node...
2019-07-24 11:18:16
164
原创 1439:【SCOI2010】传送带
#include<iostream>#include<cstdio>#include<math.h>using namespace std;double ax,bx,ay,by,cx,cy,dx,dy;double p,q,r;double cal(double x1,double x2,double y1,double y2){ retu...
2019-07-23 22:08:55
520
原创 1438:灯泡
#include<iostream>#include<cstdio>using namespace std;double h1,h2,d;double cal(double x){ double a=h2*x/(h1-h2); if(a+x<=d)return a; else { double y=d-x;...
2019-07-23 20:33:28
322
原创 1436:数列分段II
#include<iostream>#include<cstdio>#include<cstring>using namespace std;int a[100009];int m,n;int cal(int x){ int num=0; int tot=0; for(int i=1;i<=m;i++) {...
2019-07-21 20:28:38
333
原创 推销员
#include<iostream>#include<algorithm>#include<cstdio>#include<queue>using namespace std;struct node{ int lo,tot,from;};struct ddd{ int si,vi;};ddd data[10000...
2019-07-19 10:39:35
253
原创 洛谷 P2123 皇后游戏 80'WA。
#include<iostream>#include<cstdio>#include<algorithm>#include<cstring>using namespace std;struct node{ long long int tot; int left,right;};node a[30000];bool c...
2019-07-17 22:32:50
229
原创 P1233 木棍加工
#include<iostream>#include<cstdio>#include<algorithm>#include<cstring>using namespace std;struct node{ int left,right;};node p[6000];node s[6000];int m;bool cmp(...
2019-07-17 10:02:53
289
原创 P1080 国王游戏
#include<iostream>#include<cstdio>#include<cstring>#include<algorithm>using namespace std;struct node{ char left[10009],right[10009]; int tot[10009],maxx[10009];...
2019-07-17 09:05:33
144
原创 factory
#include<iostream>#include<cstdio>#include<algorithm>using namespace std;struct node{ int pro,co;};node a[1009];bool cmp(node a,node b){ return a.co>b.co;}int m...
2019-07-14 21:32:25
108
原创 武装
#include<iostream>#include<cstdio>#include<algorithm>using namespace std;struct node{ int start,end;};node s[20009];int w[20009];int flag[20009];bool cmp(node a,node b)...
2019-07-14 21:10:53
173
原创 1432:糖果传递
#include<iostream>#include<cstdio>#include<algorithm>using namespace std;int s[1000009];int a[1000009];int main(){ int m; long long tot=0; scanf("%d",&m); ...
2019-07-13 21:39:21
652
原创 1431:钓鱼
#include<iostream>#include<cstdio>#include<queue>using namespace std;struct node{ int ti,num,re;};node p[50];bool operator <(const node& a,const node& b){ ...
2019-07-11 22:38:43
470
原创 1429:线段
#include<iostream>#include<cstdio>#include<algorithm>using namespace std;struct node{ int s,e;};node a[1000009];bool cmp(node a,node b){ return a.e<b.e;}int mai...
2019-07-10 21:18:07
621
原创 1428:数列分段
#include<cstdio>#include<algorithm>#include<iostream>using namespace std;int a[100009];int main(){ int m,n; scanf("%d%d",&m,&n); for(int i=1;i<=m;i++)...
2019-07-09 22:32:10
384
原创 1427:数列极差
#include<iostream>#include<cstdio>#include<algorithm>#include<queue>using namespace std;int a[50009];priority_queue<int,vector<int>,greater<int> > q;in...
2019-07-09 21:45:07
369
原创 1425:【例题4】加工生产调度
#include<iostream>#include<cstdio>using namespace std;int ans[1005],n,k,i,j,t,a[1005];int b[1005],m[1005],s[1005];int main(){ int n; scanf("%d",&n); for(int i=1;i<...
2019-07-08 10:00:26
631
原创 1424:【例题3】喷水装置
#include<iostream>#include<cstdio>#include<cstring>#include<math.h>#include<algorithm>using namespace std;struct node{ double s,e;};node ro[20009];bool cmp(...
2019-07-07 22:46:20
555
原创 P1137 旅行计划
#include<iostream>#include<cstdio>#include<cstring>#include<stack>using namespace std;stack<int> s;int in[100009];int out[100009];int f[100009];struct node{ ...
2019-07-04 18:57:42
192
原创 test for job
#include<iostream>#include<cstdio>#include<stack>using namespace std;int f[100009];struct node{ int from,to,next;};node edge[1000009];int w[100009];int head[100009];in...
2019-07-04 17:44:02
325
原创 竞赛班的奖金
#include<iostream>#include<cstdio>#include<stack>using namespace std;int in[300];int out[300];int f[300];int a[300][2000];stack<int> s;int main(){ int m,n,k; ...
2019-07-04 17:02:25
164
原创 1395:烦人的幻灯片(slides)
#include<iostream>#include<cstdio>using namespace std;int x[30];int y[30];int p[30][5];int q[30][3];int main(){ int m; scanf("%d",&m); for(int i=1;i<=m;i++) ...
2019-07-02 19:59:00
1401
原创 上网统计(vector练习)
#include<iostream>#include<cstdio>#include<vector>using namespace std;vector<string> g[1009];int main(){ int m,n; scanf("%d%d",&m,&n); int s=0; st...
2019-07-01 16:34:30
711
原创 frogger
#include<iostream>#include<cstdio>#include<queue>#include<cstring>#include<math.h>using namespace std;queue<int> q;double m[209][209];int p[209][500];int a...
2019-06-30 21:29:29
224
原创 想越狱的小杉
#include<iostream>#include<cstdio>#include<cstring>#include<queue>using namespace std;struct node{ int from,to,va,next;};queue<int> que;node edge[400009];in...
2019-06-30 10:06:15
494
原创 1394:连接格点(grid)
#include<iostream>#include<cstdio>#include<algorithm>using namespace std;struct node{ int x,y,v;};node a[2000009];int f[2000009];bool cmp(node a,node b){ return a.v...
2019-06-27 20:16:55
1059
1
原创 1393:联络员(liaison)
#include<iostream>#include<cstdio>#include<algorithm>using namespace std;struct node{ int x,y,v,flag;};node a[10009];int f[10009];int findx(int i){ if(f[i]!=i)f[i]=...
2019-06-27 18:54:40
964
原创 1392:繁忙的都市(city)
#include<iostream>#include<cstdio>#include<algorithm>using namespace std;struct node{ int x,y,v;};node a[100009];int f[100009];int findx(int i){ if(f[i]!=i)f[i]=fin...
2019-06-27 18:34:32
461
原创 1391:局域网(net)
#include<iostream>#include<cstdio>#include<algorithm>using namespace std;struct node{ int x,y,v;};node a[109];int f[109];int findx(int i){ if(f[i]!=i)f[i]=findx(f[i...
2019-06-27 18:23:21
519
原创 P1653 猴子
#include<iostream>#include<cstdio>#include<cstring>#include<algorithm>using namespace std;int f[200010];int a[200010][3];int b[400010][3];||数组开大,搞了两天;int ans[200010];i...
2019-06-26 20:08:22
171
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人