随笔分类 -  枚举

uva216 Getting in Line
摘要:Getting in Line Computer networking requires that the computers in the network be linked. This problem considers a ``linear" network in which the computers are chained together so that each is... 阅读全文

posted @ 2014-07-25 15:38 katago 阅读(246) 评论(0) 推荐(0) 编辑

uva140 - Bandwidth
摘要:Bandwidth Given a graph (V,E) where V is a set of nodes and E is a set of arcs in VxV, and an ordering on the elements in V, then the bandwidth of a node v is defined as the maximum distance in ... 阅读全文

posted @ 2014-06-24 15:20 katago 阅读(1959) 评论(0) 推荐(3) 编辑

UVa11218 KTV
摘要:// Rujia Liu // 题意:给出n个带权集合,每个集合包含1~9中的三个整数。找出其中三个集合,使得1~9恰好各出现一次,且权和最大 // 算法:暴力n^2枚举前两个集合,直接计算出第三个集合。用位运算让代码更简单,速度也更快 学习点: 1、全集ALL为(1#include#includeusing namespace std;const int maxn = 1000 +... 阅读全文

posted @ 2014-06-13 16:09 katago 阅读(238) 评论(0) 推荐(0) 编辑

Uva592 Island of Logic
摘要:题意:神人鬼三个种族,神只说真话,鬼只说假话,人白天说真话,晚上说假话。根据对话内容区分种族和白天黑夜。 最多有A, B, C, D, E五个人 算法:枚举A, B, C, D, E的种族情况和白天黑夜的情况。每个人有可能是神人鬼,所以用两个bit表示,白天黑夜用1个bit表示。一共需要11 bits. #include#include#includeusing names... 阅读全文

posted @ 2014-06-09 15:18 katago 阅读(308) 评论(0) 推荐(0) 编辑

UVa11205 The Broken Pedometer
摘要:// 题意:有P个LED灯,以及N个字符,要求选出个数最少的LED灯,使得即使只有这些灯正常工作,也能区分出这N个字符 // 题意抽象:输入两个整数P, N以及N行P列的01矩阵,找少的列,能区分所有行 // 规模:P#include#include#include#include#includeusing namespace std;const int P=15;const i... 阅读全文

posted @ 2014-04-25 15:44 katago 阅读(231) 评论(0) 推荐(0) 编辑

Uva 10167 - Birthday Cake 暴力枚举 随机
摘要:Problem G. Birthday Cake Background Lucy and Lily are twins. Today is their birthday. Mother buys a birthday cake for them.Now we put the cake onto a Descartes coordinate. Its center is at (... 阅读全文

posted @ 2014-04-25 11:35 katago 阅读(358) 评论(0) 推荐(0) 编辑

< 2025年3月 >
23 24 25 26 27 28 1
2 3 4 5 6 7 8
9 10 11 12 13 14 15
16 17 18 19 20 21 22
23 24 25 26 27 28 29
30 31 1 2 3 4 5

统计

点击右上角即可分享
微信分享提示