
洛谷
红点雷龙XL
这个作者很懒,什么都没留下…
展开
-
The Cow Prom -Tarjan求强连通分量-模板
题目描述The N (2 <= N <= 10,000) cows are so excited: it's prom night! They are dressed in their finest gowns, complete with corsages and new shoes. They know that tonight they will each try to pe...原创 2018-07-29 16:12:36 · 173 阅读 · 0 评论 -
P2850-虫洞Wormholes-bellman_ford找负环
题目描述While exploring his many farms, Farmer John has discovered a number of amazing wormholes. A wormhole is very peculiar because it is a one-way path that delivers you to its destination at a time ...原创 2018-07-27 16:16:51 · 220 阅读 · 0 评论 -
P2855 ]河跳房子River Hopscotch-最大最小值-二分
题目描述Every year the cows hold an event featuring a peculiar version of hopscotch that involves carefully jumping from rock to rock in a river. The excitement takes place on a long, straight river wit...原创 2018-07-27 11:38:46 · 241 阅读 · 0 评论 -
P2854-牛的过山车Cow Roller Coaster -dfs剪枝
题目描述The cows are building a roller coaster! They want your help to design as fun a roller coaster as possible, while keeping to the budget.The roller coaster will be built on a long linear stretch...原创 2018-07-27 10:28:58 · 238 阅读 · 0 评论 -
P1019-单词接龙
链接:https://www.luogu.org/problemnew/show/P1019思路:搜索,标记判断;需要一个判断两个单词的连接情况,包括连接字母的数目a,需要一个结构体,word变量中需要包括字母数和剩余使用数,需要搜索以及对开头单词的搜索;代码:#include<iostream>#include<cstring>#include<algorith...原创 2018-06-21 01:30:02 · 415 阅读 · 0 评论 -
P1219 八皇后问题-1
链接:https://www.luogu.org/problemnew/show/P1219思路:回溯,搜索,标记方法;可以用四个数组判断+标记;a[i]=j--可以表示第i行第j个; b[j]==1--表示这一行已经有了;c[i+j]==1--表示从左上到右下的对角线有了;d[i+n-j]==1--表示从右上到左下的对角线有了;代码:#include<iostream>using ...原创 2018-06-20 23:37:21 · 263 阅读 · 0 评论 -
快排
#include<iostream>using namespace std;int a[1000010];int n;void paixu(int *a,int l,int r){ int mid; int i=l,j=r; mid=a[(l+r)/2]; do { while(a[i]<mid) ...原创 2018-06-04 23:06:47 · 196 阅读 · 0 评论 -
P2024-食物链
#include<iostream>using namespace std;int f[100001],l[100001],i,j,n,k,x,y,z,ans=0;int father(int x){ if(x==f[x]) return x; else { int t1; t1=f[x]; f...原创 2018-05-09 17:40:04 · 182 阅读 · 0 评论 -
P1111-修复公路
#include<bits/stdc++.h>using namespace std;int f[10010],totalroad,ans=0;int i,j,n,m;struct EDG{ int x,y,t;}a[100001];bool cmp(EDG a,EDG b){ return a.t<b.t;}int father(int x){ if (f[x...原创 2018-05-08 23:56:11 · 290 阅读 · 0 评论 -
P1991-无限通讯网
#include <bits/stdc++.h>using namespace std;int xx[1005],yy[1005],s,p;int i,j,f[1000005],total=0,alnum=0;double ans;struct point{ double x,y,v;}a[1000005];bool cmp(point a,point b){ return...原创 2018-05-08 11:50:07 · 1519 阅读 · 0 评论 -
洛谷-R718171繁忙的都市
#include <bits/stdc++.h>using namespace std;int i,j,n,m,mmax;int f[100000]; //开大点,省的再改struct EDG{ int x,y,v;}node[100000];bool panduan(EDG a,EDG b){ ...原创 2018-05-08 01:12:50 · 461 阅读 · 0 评论 -
P1546-最短网络
#include<bits/stdc++.h>using namespace std;struct node{ int x,y,w;}a[100000]; //w是权值int f[100000];bool cmp(node xx,node yy){ return xx.w<yy.w; //从小到大}int find(i...原创 2018-05-07 23:45:46 · 229 阅读 · 0 评论 -
洛谷-R6694501
#include<iostream>#include<cstring>#include<cstdio>using namespace std;void find(string in,string after){ if(in.size()>0) { char ch=after[after.size()-1]; cout...原创 2018-04-09 12:54:10 · 187 阅读 · 0 评论 -
洛谷-R6691633
#include<iostream>using namespace std;char s[10010];void tree(int x,int y){ if(x<y) { tree(x,(x+y)/2); tree((x+y+1)/2,y); } int B=1,I=1; for(int i=0;i<=y-x;i++...原创 2018-04-09 00:17:16 · 139 阅读 · 0 评论 -
洛谷-1739
#include<iostream>#include<stack>using namespace std;int main(){ char a[300]; int i=0; stack<char>m; cin>>a; while(a[i]!='@') { if(a[i]=='(') ...原创 2018-04-06 23:27:29 · 204 阅读 · 0 评论 -
洛谷-P1996
#include<iostream>#include<queue>using namespace std;int main(){ int n,m,i; int id=1; //记录输出的 queue<int>q; cin>>n>>m; for(i=1;i<=n;i++) q.pu...原创 2018-04-06 10:40:43 · 313 阅读 · 0 评论