- 博客(37)
- 收藏
- 关注
原创 提高组 模拟题训练
模拟题 训练https://www.luogu.org/problem/lists?name=&orderitem=pid&tag=1%7C83
2017-09-12 19:22:27
352
原创 hdu 1269 强联通分量题解;
// hdu 1269 强联通分量模板题 // 强连通分量的定义:1.在有向图里面,一个极大子图里面,任意两个点之间可以相互到达; // 2.单个结点也是一个强连通分量; // 强连通分量:有向图; // 连通分量:无向图; #include<iostream> using namespace std; #define maxn 10000...
2019-03-17 19:30:59
354
原创 虫食算 90
#include #include #include #include using namespace std; int n; char s[4][30]; bool used[30]; int f[30]; int id(char x) { return x-'A'+1; } void dfs(int x,int
2017-11-05 23:15:37
251
原创 选课-二叉2
#include using namespace std; int n,m; int a[1010],c[1010]; int f[1001][1001]; struct node { int l,r; }tree[1001]; void build() { int x; for(int i=1;i { x=a[i]; if (tree[x].
2017-10-25 22:32:23
255
原创 选课-二叉1
#include #include using namespace std; const int maxn=320; int dp[maxn][maxn]; int s[maxn],b[maxn],c[maxn]; int n,m; void dfs(int x,int y) { if(dp[x][y]>=0) return ; if(x==0||y=
2017-10-25 22:31:35
245
原创 hdu 1561
#include #include #include #include using namespace std; #define N 205 int n,m,edgeNum=0; int ans[N],dp[N][N],f[N][N]; int visit[N],head[N]; struct Line { int v,next; } edge[N]
2017-10-24 19:06:54
235
原创 Rebuilding Roads
#include #include #include using namespace std; const int maxn=10000; vector tree[200]; int dp[200][200]; int n,p; bool son[200]; void dfs(int root) { int len=tree[root]
2017-10-24 18:53:45
367
原创 poj 2342 Anniversary party
#include #include using namespace std; int n,m; int dp[10005][2]; int boss[10005]; int vis[10005]; void dis(int node) { vis[node]=1; for(int i=1;i { if(!vis[i]&&boss[i]==no
2017-10-24 18:53:15
195
原创 poj 1192
#include #include #include #include #include using namespace std; const int maxn=1010; int n; struct point { int x,y,c; }p[1010]; vector c[1010]; int dp[1010][2]; bool mark[1
2017-10-24 18:52:35
263
原创 【hdu 1520】
#include #include #include #include using namespace std; const int maxn=6005; int value[maxn]; struct node { int fa,son,next; }e[maxn]; int nume=0; int head[maxn]; int n; v
2017-10-24 18:52:14
212
原创 欧拉函数打表
#include using namespace std; bool v[10001]; int phi[10001],p[10001]; int num=0; int main() { int n; phi[1]=1; cin>>n; for(int i=2;i { if(!v[i]) { p[++num]=i; phi[i]=i-1; } for(i
2017-10-21 20:08:53
332
原创 【76】树网的核
#include #include using namespace std; const int inf=0x3f; int n,s1; int f[301][301]; int nd=0; int d[301]; int w; void floyd() { int maxx=0; int start,end; for(int k=1; k for(int i=
2017-10-18 00:38:25
229
原创 单源最短路径
#include #include using namespace std; int s; struct edge{ int from,to,len,nxt; }edge[500001]; int ne=0; int d[10001]; int head[10001]; void add(int u,int v,int w) { edge[++ne]
2017-10-17 23:17:32
210
原创 跳石头
#include #include using namespace std; int L,m,n; int d[50001]; int res=0; bool bz(int x) { int num=0; int key=0; for(int i=1;i { if(d[i]-key { num++; } else { key=d[i]; }
2017-10-17 00:45:09
279
原创 火柴棒等式
#include using namespace std; int a[2333]; int main() { int n; cin>>n; n-=4; a[0]=6;a[1]=2;a[2]=5;a[3]=5;a[4]=4;a[5]=5;a[6]=6;a[7]=3;a[8]=7; a[9]=6; for(int i=10;i { a[i]=a[i/10]+a
2017-10-17 00:37:09
240
原创 最优贸易
#include #include #include using namespace std; int n,m; int v[100001]; struct edge{ int from,to,nxt; }edge1[500001],edgen[500001]; int num_edge1,num_edgen; int head1[100001],headn[1
2017-10-17 00:36:11
195
原创 疫情控制 40
#include #include #include using namespace std; const int maxn=50001; int n,m; int head[maxn]; int num_edge=0; int f[maxn][20],d[maxn][20]; int deep[maxn]; struct edge{ int
2017-10-16 22:49:04
403
原创 火车运输 25 60
25 #include #include #include #include using namespace std; #define inf 0x7fffffff int head[10001]; struct edge{ int to,next,w; }e[50001]; int n,m; int cnt; void add
2017-10-03 19:03:51
233
原创 观光公交
#include using namespace std; int n,m,k; int f[1001]; int down[1001],up[1001]; int ready[1001]; int ans=0; int arrive[1001]; int ma[1001]; bool Wait[1001]; int time,where; int main(
2017-09-30 19:12:07
269
原创 合并果子
#include #include using namespace std; int n; int a[10001]; int size; int h[10001]; void put(int x) { h[++size]=x; int end,mid; end=size; while(end>1) { mid=end/2; if(h[end
2017-09-26 20:32:37
219
原创 国王游戏(50)
#include #include #include #include #include #include using namespace std; long long n; struct man1{ long long a,b,m; }man[1001]; int cmp(const man1 &a,const man1 &b) { //i
2017-09-26 18:47:14
428
原创 字串距离
#include #include using namespace std; int f[2001][2001]; char a[2001],b[2001]; int main() { cin>>a>>b; int lena=strlen(a); int lenb=strlen(b); // cout for(int i=0
2017-09-26 18:46:37
239
原创 转圈游戏
快速幂求模 #include using namespace std; int x,m,k,n; int f(int k) { if(k==1)return 10%n; int temp=f(k/2)%n; temp=temp*temp%n; if(k%2==1)temp=temp*10%n; return temp; } int main() { cin>>n>>m>
2017-09-23 23:18:29
272
转载 stl之 set deque map特性
http://blog.youkuaiyun.com/pirlck/article/details/51326547
2017-09-23 22:01:50
306
转载 stl set讲解
http://blog.youkuaiyun.com/qq_31785871/article/details/52456773 http://www.cnblogs.com/graphics/archive/2010/06/01/1749569.html
2017-09-23 17:12:33
248
原创 积木比赛
#include using namespace std; int h[100001]; int n; int main() { int n; cin>>n; for(int i=1;i { cin>>h[i]; } int ans=h[1]; for(int i=1;i { ans+=max(0,(h[i+1]-h[i]));
2017-09-16 22:49:18
288
原创 神奇的幻方
#include using namespace std; int n; int h[40][40]; int main() { cin>>n; int i=1,j=(1+n)/2; h[i][j]=1; for(int k=2;k { if(i==1&&j!=n) { i=n;j+=1;
2017-09-16 22:47:44
361
原创 无线网络发射器
#include using namespace std; int a[129][129]; int sum=1,maxx=0; int main() { int d; int n; cin>>d>>n; for(int i=1;i { int x,y,k; cin>>x>>y>>k; int x0=max(0,x-d),x1=min(
2017-09-16 21:54:49
365
原创 潜伏者
#include #include using namespace std; char zd[27]; bool v[27]; bool vb[27]; int main() { string a,b; cin>>a>>b; int len=a.length(); //64 zd[1]=a[1]; for
2017-09-16 21:54:06
851
原创 机器翻译
#include #include #include #include using namespace std; queue ram; int m,n; bool in[1001]; int z=1; int ans=0; int main() { cin>>m>>n; for(int i=1; i { int a; cin>>a; if
2017-09-12 22:34:58
423
原创 津津的储蓄计划
#include #include #include using namespace std; int ys; int m; int b=0; int main() { for(int i=1;i { cin>>ys; m+=300; m-=ys; if(m { cout return 0; } if(m>=100) {
2017-09-12 21:54:35
548
原创 Cantor表
#include #include using namespace std; int n; int main() { cin>>n; if(n==1) { cout return 0; } int i=1,j=2; bool down=1; for(int k=2;k {
2017-09-12 21:10:25
176
原创 数字统计二分实现
#include using namespace std; struct node{ int a; int count; }node[10005]; int k=1; int n; int search(int x,int l,int r) { if(l>r)return l; else { int mid=(l+r)/2; if(node[mid].a==x)
2017-09-12 21:01:57
219
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人
RSS订阅