poj 2345 Central heating】的更多相关文章

Central heating Time Limit: 1000MS   Memory Limit: 65536K Total Submissions: 614   Accepted: 286 Description Winter has come, but at the Ural State University heating is not turned on yet. There's one little problem: the University is heated only if…
Central heating Time Limit: 1000MS   Memory Limit: 65536K Total Submissions: 678   Accepted: 310 Description Winter has come, but at the Ural State University heating is not turned on yet. There's one little problem: the University is heated only if…
[题目链接] http://poj.org/problem?id=2345 [题目大意] 给出n个开关和n个人,每个人可以控制一些开关,现在所有的开关都是关着的 一个指令可以让一个人掰动所有属于他控制的开关,使得开关的状态变化, 现在要求求出最少的指令,使得开关全开,按字典序输出指令的人 [题解] 我们将人的操作作为变元建立方程组,因为一个人相同的两次操作对结果是没有影响的 我们可以认为这是无效操作,所以每个人操作的次数只是一次或者零次, 我们解01方程组即可得到答案. [代码] #includ…
/******************************************************************* *输出全国各省辖市下拉列表项writeCitys() *输出企业性质下拉列表项writeProperity() *输出工作岗位类别下拉列表项writeJobs() *输出行业类别下拉列表项writeCalling() *输出学历下拉列表项writeDegree() *输出更新时间下拉列表项writeUpdateDate() *Date:2004-06-28 *…
Air pollution from coal combustion likely cut life expectancy in parts of China by more than five years during the 1990s, a study has found, adding weight to increasing public demands for Beijing to clean up the environment. Lifespan:寿命 combustion:燃烧…
餐具:coffee pot 咖啡壶coffee cup 咖啡杯paper towel 纸巾napkin 餐巾table cloth 桌布tea -pot 茶壶tea set 茶具tea tray 茶盘caddy 茶罐dish 碟plate 盘saucer 小碟子rice bowl 饭碗chopsticks 筷子soup spoon 汤匙knife 餐刀cup 杯子glass 玻璃杯mug 马克杯picnic lunch 便当fruit plate 水果盘toothpick 牙签中餐:bear's…
题意:建一个家庭树,找出有第d代子孙的名字,按照要求的第d代子孙的数从大到小输出三个人名,如果有一样大小子孙数的,就按字母序从小到大将同等大小的都输出,如果小于三个人的就全输出. 题目链接:http://poj.org/problem?id=2732 分析:数据量很小,直接建树,枚举暴力输出.我直接套模板用map建树的. 注意:1.每次测试数据时要清空map和vector!!! 2.注意输出要从大到小输出答案,如果答案有一样的按名字的字母序从小到大输出.答案用vector保存,vector排序:…
题目链接:http://poj.org/problem?id=1240 本文链接:http://www.cnblogs.com/Ash-ly/p/5482520.html 题意: 通过一棵二叉树的中序和后序遍历序列,就可以得到这颗二叉树的前序遍历序列.类似的,也能通过前序和中序遍历序列来得到后序遍历序列.但是,通常来说,不能通过前序和后序遍历序列来确定一棵二叉树的中序遍历序列.如下面这四颗二叉树: 所有的这四颗二叉树都有着相同的前序(abc)和后序遍历(cba)序列.这个现象不仅仅在二叉树中存在…
题目链接 问题描述 : We are all familiar with pre-order, in-order and post-order traversals of binary trees. A common problem in data structure classes is to find the pre-order traversal of a binary tree when given the in-order and post-order traversals. Alte…
Maya Calendar Time Limit: 1000MS   Memory Limit: 10000K Total Submissions: 64795   Accepted: 19978 Description During his last sabbatical, professor M. A. Ya made a surprising discovery about the old Maya calendar. From an old knotted message, profes…