码迷,mamicode.com
首页 >  
搜索关键字:nyoj 608 畅通工程    ( 2465个结果
NYOJ 题目113
描述: 编写一个程序实现将字符串中的所有"you"替换成"we" #include<stdio.h>#include<string.h>int main(){ char s[1005]; int a,b,n,i; while(gets(s)!=NULL)//gets能接收含空格的字符串 { a=st ...
分类:其他好文   时间:2017-07-24 10:02:33    阅读次数:133
并查集
一、问题引入 原题:杭电hdu1232畅通工程 题意:首先在地图上给你若干个城镇,这些城镇都可以看作点,然后告诉你哪些对城镇之间是有道路直接相连的。最后要解决的是整幅图的连通性问题。比如随意给你两个点,让你判断它们是否连通,或者问你整幅图一共有几个连通分支,也就是被分成了几个互相独立的块。像畅通工程 ...
分类:其他好文   时间:2017-07-24 00:07:00    阅读次数:162
hdu1863 畅通工程 基础最小生成树
1 #include 2 #include 3 #include 4 #define N 110 5 #define M 5000 6 using namespace std; 7 8 int n, m, u[M], v[M], w[M], r[M], p[N]; 9 bool cmp(int i,... ...
分类:其他好文   时间:2017-07-23 21:00:58    阅读次数:120
NYOJ 题目477 A+B Problem III
题目描述: 求A+B是否与C相等。 #include<stdio.h>int main(){ int N; scanf("%d",&N); while(N--) { double a,b,c; scanf("%lf %lf %lf",&a,&b,&c); if(a+b-c>=-0.0001&&a+b ...
分类:其他好文   时间:2017-07-23 21:00:03    阅读次数:120
hdu1233 还是畅通工程 基础最小生成树
1 //克鲁斯卡尔 2 #include 3 #include 4 using namespace std; 5 const int maxn = 10005; 6 struct node 7 { 8 int begin, end, len; 9 }cun[maxn]; 10 int n, fa[m... ...
分类:其他好文   时间:2017-07-23 19:56:39    阅读次数:170
NYOJ 38 布线问题_(解法1 Kruskal算法)
时间限制:1000 ms | 内存限制:65535 KB 难度:4 描写叙述南阳理工学院要进行用电线路改造。如今校长要求设计师设计出一种布线方式,该布线方式须要满足下面条件: 1、把全部的楼都供上电。 2、所用电线花费最少 输入第一行是一个整数n表示有n组測试数据。(n<5) 每组測试数据的第一行是 ...
分类:编程语言   时间:2017-07-23 19:48:34    阅读次数:133
hdu1232 畅通工程 基础并查集
1 #include 2 #include 3 #include 4 #include 5 using namespace std; 6 7 #define MAXN 1005 8 int n, m; 9 int fa[MAXN]; //父节点 10 int mark[MAXN]; 11 12 vo... ...
分类:其他好文   时间:2017-07-23 19:47:29    阅读次数:185
NYOJ题目96 n-1位数
题目描述: 已知w是一个大于10但不大于1000000的无符号整数,若w是n(n≥2)位的整数,则求出w的后n-1位的数。 #include<stdio.h>#include<math.h>int main(){ int M; scanf("%d",&M); while(M--) { long in ...
分类:其他好文   时间:2017-07-23 19:37:20    阅读次数:151
NYOJ题目57 日期计算
题目描述: 输入一个日期,格式如:2010 10 24 ,判断这一天是这一年中的第几天。 #include<stdio.h>int main(){int a,b=0,c,y,m,d,fib;scanf("%d",&a);while(a--){scanf("%d %d %d",&y,&m,&d);if ...
分类:其他好文   时间:2017-07-23 18:28:54    阅读次数:181
NYOJ 题目94 cigarettes
题目描述: Tom has many cigarettes. We hypothesized that he has n cigarettes and smokes them one by one keeping all the butts. Out of k > 1 butts he can ro ...
分类:其他好文   时间:2017-07-23 18:13:10    阅读次数:139
2465条   上一页 1 ... 31 32 33 34 35 ... 247 下一页
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!