poj1129 Channel Allocation】的更多相关文章

题目链接:poj1129 Channel Allocation 题意:要求相邻中继器必须使用不同的频道,求需要使用的频道的最少数目. 题解:就是求图的色数,这里采用求图的色数的近似有效算法——顺序着色算法(实质是一种贪心策略:在给任何一个顶点着色时,采用其邻接顶点中没有使用的,编号最小的颜色). 注:中继器网络是一个平面图,即图中不存在相交的边. 看讨论后发现这组数据,AC代码没过orz: 6 A:BEF B:AC C:BD D:CEF E:ADF F:ADE 正确答案应该是3 : A(1)B(…
Channel Allocation Time Limit: 1000MS   Memory Limit: 10000K Total Submissions: 14361   Accepted: 7311 Description When a radio station is broadcasting over a very large area, repeaters are used to retransmit the signal so that every receiver has a s…
Channel Allocation Time Limit: 1000MS   Memory Limit: 10000K Total Submissions: 12334   Accepted: 6307 Description When a radio station is broadcasting over a very large area, repeaters are used to retransmit the signal so that every receiver has a s…
Description When a radio station is broadcasting over a very large area, repeaters are used to retransmit the signal so that every receiver has a strong signal. However, the channels used by each repeater must be carefully chosen so that nearby repea…
POJ 1129 Channel Allocation Time Limit: 1000MS   Memory Limit: 10000K Total Submissions: 14191   Accepted: 7229 Description When a radio station is broadcasting over a very large area, repeaters are used to retransmit the signal so that every receive…
Channel Allocation Time Limit: 1000MS Memory Limit: 10000K Total Submissions: 13231 Accepted: 6774 Description When a radio station is broadcasting over a very large area, repeaters are used to retransmit the signal so that every receiver has a stron…
Language: Default Channel Allocation Time Limit: 1000MS   Memory Limit: 10000K Total Submissions: 12367   Accepted: 6325 Description When a radio station is broadcasting over a very large area, repeaters are used to retransmit the signal so that ever…
Channel Allocation Time Limit : 2000/1000ms (Java/Other)   Memory Limit : 20000/10000K (Java/Other) Total Submission(s) : 18   Accepted Submission(s) : 7 Problem Description When a radio station is broadcasting over a very large area, repeaters are u…
Channel Allocation Time Limit: 1000MS   Memory Limit: 10000K Total Submissions: 13173   Accepted: 6737 Description When a radio station is broadcasting over a very large area, repeaters are used to retransmit the signal so that every receiver has a s…
Channel Allocation Time Limit: 1000MS   Memory Limit: 10000K Total Submissions: 15546   Accepted: 7871 Description When a radio station is broadcasting over a very large area, repeaters are used to retransmit the signal so that every receiver has a s…
Channel Allocation Time Limit: 1000MS   Memory Limit: 10000K Total Submissions: 13357   Accepted: 6836 Description When a radio station is broadcasting over a very large area, repeaters are used to retransmit the signal so that every receiver has a s…
Channel Allocation 1 #include <iostream> 2 #include <cstdio> 3 #include <cstring> 4 #include <cmath> 5 #include <algorithm> 6 #include <string> 7 #include <vector> 8 #include <set> 9 #include <map> 10…
题目:http://poj.org/problem?id=1129 题意:求最小m,使平面图能染成m色,相邻两块不同色由四色定理可知顶点最多需要4种颜色即可.我们于是从1开始试到3即可. #include <iostream> #include<cstdio> #include<cstring> #include<cstdlib> #include<stack> #include<queue> #include<iomanip&…
题目: http://poj.org/problem?id=1129 开始没读懂题,看discuss的做法,都是循环枚举的,很麻烦.然后我就决定dfs,调试了半天终于0ms A了. #include <stdio.h> #include <string.h> ][], vis[][]; int n, ans; void calc() { ; ; i < ; i++) { ; j < n; j++) { if(vis[j][i]) { cnt++; break; } }…
Time Limit: 1000MS   Memory Limit: 10000K Total Submissions: 10897   Accepted: 5594 Description When a radio station is broadcasting over a very large area, repeaters are used to retransmit the signal so that every receiver has a strong signal. Howev…
http://poj.org/problem?id=1129 import java.util.*; import java.math.*; public class Main { public static boolean flag=false; public static int ans=0; public static void main(String []args) { Scanner cin=new Scanner(System.in); int n; String str; whil…
染色问题:相邻不能染同一种颜色 最少需要的颜色的数量=最大团点的数量 #include<bits/stdc++.h> using namespace std; #define N 27 int n; int mp[N][N]; int ans; int alt[N][N]; int Max[N]; bool dfs(int cur,int tot)//cur是s1集合的个数 { ==cur) { if(tot>ans) { ans=tot;return true; } return fa…
题意是有若干个接收器,给出每个接收器的相邻接收器.相邻的接收器不能使用同一信号频道.问所需要的信号频道数. 求该无向图的极大团. #include<iostream> #include<cstring> #include<string> #define maxn 30 using namespace std; int stack[maxn],map[maxn][maxn]; int n,cn,bestn; void dfs(int x){ if (x>n){ be…
题目大意建模: 一个有N个节点的无向图,要求对每个节点进行染色,使得相邻两个节点颜色都不同,问最少需要多少种颜色? 那么题目就变成了一个经典的图的染色问题 例如:N=7 A:BCDEFG B:ACDEFG C:ABD D:ABCE E:ABDF F:ABEG G:ABF 画成图就是: 首先考虑四色定理:任何一张地图只用四种颜色就能使具有共同边界的国家着上不同的颜色 judge(int x,int y)枚举判断x的邻接点中是否着色y颜色的 1.正向考虑dfs(int num,int color)从…
题意: N个中继站,相邻的中继站频道不得相同,问最少需要几个频道. 输入输出: Sample Input 2 A: B: 4 A:BC B:ACD C:ABD D:BC 4 A:BCD B:ACD C:ABD D:ABC 0 Sample Output 1 channel needed. 3 channels needed. 4 channels needed. 题意抽象+思路: 一张有N个点的无向图,对每个点进行染色,相邻的点颜色不得一致,最少需多少种颜色.DFS即可. 代码: <span s…
※Recorded By ksq2013 //其实这段时间写的题远远大于这篇博文中的内容,只不过那些数以百记的基础题目实在没必要写在blog上; ※week one 2016.7.18 Monday a)bzoj4034[HAOI2015 T2](树链剖分+线段树) http://blog.csdn.net/keshuqi/article/details/51944955 b)luogu1328[NOIP2014 T1]生活大爆炸版石头剪刀布(模拟) http://blog.csdn.net/k…
poj1010--邮票问题 DFSpoj1011--Sticks dfs + 剪枝poj1020--拼蛋糕poj1054--The Troublesome Frogpoj1062--昂贵的聘礼poj1077--Eightpoj1084--Square Destroyerpoj1085--Triangle War(博弈,極大極小搜索+alpha_beta剪枝)poj1088--滑雪poj1129--Channel Allocation 着色问题 dfspoj1154--letters (dfs)p…
Channel Allocation Time Limit: 1000MS   Memory Limit: 10000K Total Submissions: 14601   Accepted: 7427 Description When a radio station is broadcasting over a very large area, repeaters are used to retransmit the signal so that every receiver has a s…
Oracle数据库软件标准版的一个限制:仅仅能用一个rman channel Restrictions in "Standard Edition" Rman channel allocation does not allow parallelism/having multiple channels allocated. 来源于: RMAN DUPLICATE FROM 'ACTIVE DATABASE' in "Standard Edition" fails wit…
Log 2016-3-21 网上找的POJ分类,来源已经不清楚了.百度能百度到一大把.贴一份在博客上,鞭策自己刷题,不能偷懒!! 初期: 一.基本算法: (1)枚举. (poj1753,poj2965) (2)贪心(poj1328,poj2109,poj2586) (3)递归和分治法. (4)递推. (5)构造法.(poj3295) (6)模拟法.(poj1068,poj2632,poj1573,poj2993,poj2996) 二.图算法: (1)图的深度优先遍历和广度优先遍历. (2)最短路…
HDU 模拟题, 枚举1002 1004 1013 1015 1017 1020 1022 1029 1031 1033 1034 1035 1036 1037 1039 1042 1047 1048 1049 1050 1057 1062 1063 1064 1070 1073 1075 1082 1083 1084 1088 1106 1107 1113 1117 1119 1128 1129 1144 1148 1157 1161 1170 1172 1177 1197 1200 1201…
初期:一.基本算法:     (1)枚举. (poj1753,poj2965)     (2)贪心(poj1328,poj2109,poj2586)     (3)递归和分治法.     (4)递推.     (5)构造法.(poj3295)     (6)模拟法.(poj1068,poj2632,poj1573,poj2993,poj2996)二.图算法:     (1)图的深度优先遍历和广度优先遍历.     (2)最短路径算法(dijkstra,bellman-ford,floyd,hea…
初期: 一.基本算法:      (1)枚举. (poj1753,poj2965)      (2)贪心(poj1328,poj2109,poj2586)      (3)递归和分治法.      (4)递推.      (5)构造法.(poj3295)      (6)模拟法.(poj1068,poj2632,poj1573,poj2993,poj2996) 二.图算法:      (1)图的深度优先遍历和广度优先遍历.      (2)最短路径算法(dijkstra,bellman-ford…
题目:Channel Allocation 题意:要求A:BCD,A与B,C,D都不相同,求不同的值,典型的四色定理: #include <iostream> #include <algorithm> #include <stdlib.h> #include <time.h> #include <cmath> #include <cstdio> #include <string> #include <cstring&…
leetcode代码 利用堆栈:http://oj.leetcode.com/problems/evaluate-reverse-polish-notation/http://oj.leetcode.com/problems/longest-valid-parentheses/ (也可以用一维数组,贪心)http://oj.leetcode.com/problems/valid-parentheses/http://oj.leetcode.com/problems/largest-rectang…