POJ 1977 Odd Loving Bakers

上海计算机学会2020年5月月赛C++乙组T2经济普查 中国正在以前所未有的力度推进脱贫攻坚,国家计划在2020年使得在现行标准下的贫困人口实现全面脱贫,为此,需要对居民的经济状况进行普查。 题目描述 给定一个正整数n,表示人口数量。一开始,每个居民拥有的财产记为a1​,a2​,⋯,an​,财产可能发生两种变化: 一种来源于个体,由某个居民的经济活动而产生。在某个时刻,某个居民的财产会直接变成某个数值,可能升高也可能降低。 一种来源于政策,在某个时刻,国家会对财产低于某个标准线全部的居民,实施政策支持,使得他们的财产全部正好到达标准线。 给定这些变 阅读详情
Odd Loving Bakers
Time Limit: 2000MS Memory Limit: 30000K
Total Submissions: 1372 Accepted: 429

Description

There is a group of N bakers in the town of Utopia. These bakers hold a monthly celebration in which they award a prize to some of the luckier among themselves. These lucky guys are chosen as follows:

In the beginning there are some chalk marks on some of the bakers' houses. Each baker has a list of his/her favorite bakers. After each celebration each of the winners puts a chalk mark on the house of all the bakers in his/her favorite list. Before each celebration those bakers with an odd number of chalk marks on their house will be chosen as winners. As there will be a great prize for the winners of the t th celebration, you are asked to find the number of its winners.

Input

The first line of the input contains a single integer X (1 <= X <= 11), the number of test cases, followed by the input data for each test case. The input for each test case will be as follows:
The first line of each instance contains two integers n (the number of bakers) and t (the number of the celebration we want the winners of).
1 <= n <= 100
1 <= t <= 1,000,000,000
The next n lines of the instance each describe a baker. In each of these lines first comes the name of the baker (names are lower case strings of no more than 20 characters without spaces), then comes the number of chalk marks initially on the baker's house, then comes the number of bakers in this baker's favorite list, and after that come the names of the bakers in this baker's list.

Output

There should be one line per test case. For each test case write a line containing a single integer, the number of the winners of the t-th celebration.

Sample Input

2
3 2
bessie 2 3 bessie linda mary
mary 1 1 linda
linda 0 1 bessie
2 2	
siavosh 1 2 siavosh mohammad 
mohammad 1 0

Sample Output

2
0

Source

 

USB 基础学习:USB 电气信号介绍 USB电气信号技术解析 USB通信的核心是差分信号传输技术,通过D+和D-两根线传输相位相反的电压信号实现数据通信。USB信号系统包含三类关键信号:差分数据信号(抗干扰性强)、单端状态信号(用于设备识别)和电源信号(提供5V供电)。USB2.0采用400mV电压摆幅和NRZI编码,支持低速(1.5Mbps)至高速(480Mbps)传输;USB3.0则新增专用差分对,数据速率可达20Gbps。物理层通过上拉/下拉电阻检测设备连接,高速模式需特殊握手协议。抗干扰设计的关键在于保持差分线等长、阻抗匹配和使用共模扼 阅读详情

相关推荐

杭电计算机组成原理课程设计-实验七-寄存器堆设计实验

寄存器堆实验实验原理实验内容模块功能说明模块逻辑引脚图寄存器堆模块代码REG模块测试用例REG-ALU测试用例实验结果记录 寄存器堆实验结果及分析ALU_REG运算器模块实验结果及分析探索与思考 实验原理   32×32位的寄存器堆模块示意图如图所示,含有32个寄存器,每个寄存器32位。该寄存器堆具有A和B两个读端口,分别由 5 位的寄存器编号 R_Addr_A 和 R_Addr_B 来寻址 2 个寄存器,读出的数据则由 R_Data_A(32 位)和R_Data_B(32 位)输出。读访问时,没有使能或者

HDU-整蛊小子-⏰☂️/蚂蚁集团研发工程师 1万+

poj 1977 Odd Loving Bakers(矩阵)

poj 1977 Odd Loving Bakers 因为

yjCola 696

遥感常用相关指数和计算方法(植被指数/水体指数/雪和冰指数/矿物指数/地表温度指数/云和阴影指数/农业指数)

遥感常用相关指数和计算方法(植被指数/水体指数/雪和冰指数/矿物指数/地表温度指数/云和阴影指数/农业指数)

m0_64361769的博客 1万+

TOJ-1319 Odd Loving Bakers

There is a group of n (1 ≤ n ≤ 100) bakers in the town of Utopia. These bakers hold a monthly celebration in which they award a prize to some of the luckier among themselves. These lucky guys a...

222

OpenHarmony自定义Launcher

OpenHarmony源码版本:4.0release开发板:DAYU / rk3568DevEco Studio版本:4.0.0.600切换分支为OpenHarmony-4.0-Release,并下载源码。

Abner_Crazy的博客 1644

攻克TypeError: Cannot read properties of undefined (reading ‘NormalModule‘)的四种实战策略

本文详细解析了`TypeError: Cannot read properties of undefined (reading 'NormalModule')`错误的四种实战解决策略。从版本一致性检查、包管理器优化到依赖替换和构建环境配置,帮助开发者快速定位和解决Webpack构建过程中的常见问题,提升开发效率。

weixin_42523670的博客 250

Poj 1977 Odd Loving Bakers//矩阵

这道题,推一下关系式就出来了。  下面是代码: #include #include #include #include using namespace std; const int maxn = 100 + 10; string s; char str[maxn]; map Map; struct node { int m[maxn][maxn]; void init()

mr_zys的专栏 724

传感器模块的电路艺术:从引脚定义到系统集成的设计哲学

本文深入探讨传感器模块的电路设计艺术,从引脚定义到系统集成的完整设计哲学。重点解析电源管理、信号处理及I2C通信协议等核心电路原理,分享多模块协同中的电源架构、信号完整性和接地策略,为硬件工程师提供实用的系统级设计思维与实战案例。

o1p2q3r的博客 233

pku 1977 Odd Loving Bakers(矩阵快速幂)

Odd Loving Bakers Time Limit: 2000MS   Memory Limit: 30000K Total Submissions: 1908   Accepted: 629 Description There is a group of N bakers in the town of Utopia. Th

街角的花街糖 655

JHU ICBM DTI Atlas纤维束模板介绍

JHU ICBM DTI atlas 纤维束的定位与功能介绍

machinelearning_er的博客 6447

Oracle EBS财务模块(三)总账功能

(一)总账管理系统主要功能  总账管理系统(Oraclegeneralledger)是一个公司一切账务系统的核心,它好比是公司会计信息的中央处理器。总账管理系统提供了一个完整的财务管理核算及分析流程。它是所有子账户的信息存储器,因此反映了所有子账户的财务和现金活动。总账管理系统的主要作用是记录公司的财务活动,并生成财务报表和管理报表,以帮助公司内外人士进行决策。一个公司或组织的制造系统、项目管理系

苏南生的CSDN博客 2万+

POJ-1977 很好的矩阵乘法题..

题目是说有N面点师..每个面点师又有一些自己欣赏的面点师..每一轮的庆祝有投票权的面点师讲给自己所欣赏的所有面点师标记一笔.而当轮的投票权是说前面所有庆祝下来当前面点师的所得标记数总和为奇数时才有资格投票..题目最终是问在第t轮庆祝时,哪些面点师能够投票...值得注意的是题目初始是从第一天开始的..也就是初始的票数是第一轮的票数..若题目要求出第一天的投票权情况..就是输入的奇偶情况..第二天的.

zzyzzy12 1731

基于 Simulink 的双向 DC/AC 逆变器中 IGBT/MOSFET 寄生参数影响分析实战教程

摘要:本教程详细解析了Simulink中IGBT/MOSFET寄生参数对双向DC/AC逆变器的影响。通过对比理想模型与含寄生参数(如20nH内部电感、50nH回路电感)的仿真,揭示了电压尖峰、高频振荡等实际问题。建模步骤包括搭建基准电路、引入寄生参数、配置高精度求解器(步长10ns),并给出抑制措施:添加RC缓冲电路、调整驱动电阻。关键发现:寄生参数会显著增加开关损耗和EMI噪声,需通过参数扫描优化设计。教程还提供了代数环报错、仿真速度优化等实战技巧,帮助工程师从理想仿真过渡到高保真分析。

xiaoheshang_123的博客 74

poj 1977

<br /> Odd Loving BakersTime Limit: 2000MS Memory Limit: 30000KTotal Submissions: 1499 Accepted: 480<br />DescriptionThere is a group of N bakers in the town of Utopia. These bakers hold a monthly celebration in which they award a prize to some of the luck

志当存高远 965

Probability and Statistics - 4th edition

Probability and Statistics - 4th edition

全球国家地区城市数据

MySQL全球国家地区城市数据报。。。。。。。。。。。。

zcmu-1977

1977: 黑暗意志 Time Limit: 1 Sec  Memory Limit: 128 MB Submit: 89  Solved: 46 [Submit][Status][Web Board] Description 在数千年前潘达利亚从卡利姆多分离之时,迷雾笼罩着这块新形成的大陆,使它不被外来者发现。迷雾同样遮蔽着这片大陆古老邪恶的要塞——雷神的雷电王座。在雷神统治时期,他的要塞...

yu121380的博客 369

SAP B1中文培訓教材_SDK

公司内部培训资料,对开发工具 ,DIAPI, UIAPI,Add-ON有详细解说

POJ 1091 跳蚤

 跳蚤Time Limit: 1000MS Memory Limit: 10000KTotal Submissions: 3977 Accepted: 1002DescriptionZ城市居住着很多只跳蚤。在Z城市周六生活频道有一个娱乐节目。一只跳蚤将被请上一个高空钢丝的正中央。钢丝很长,可以看作是无限长。节目主持人会给该

bobten2008的专栏 5277

ssm框架搭建

这个是一个在idea上成功跑起来的ssm框架项目,保存在这里方便以后使用直接下载

POJ 1811 Prime Test

Prime TestTime Limit: 6000MS Memory Limit: 65536KTotal Submissions: 15434 Accepted: 2909Case Time Limit: 4000MSDescriptionGiven a big integer number, you are

bobten2008的专栏 2353

POJ 1090 Chain 递推 + 大数加法

 ChainTime Limit: 1000MS Memory Limit: 10000KTotal Submissions: 2025 Accepted: 684DescriptionByteland had not always been a democratic country. There were also bl

bobten2008的专栏 2350

POJ 1930 Dead Fraction

 Dead FractionTime Limit: 1000MS Memory Limit: 30000KTotal Submissions: 1198 Accepted: 354DescriptionMike is frantically scrambling to finish his thesis at the la

bobten2008的专栏 2000

POJ 1715 Hexadecimal Numbers

 Hexadecimal NumbersTime Limit: 1000MS Memory Limit: 10000KTotal Submissions: 1489 Accepted: 347DescriptionThe base of the hexadecimal system is 16. In order to w

bobten2008的专栏 1370

POJ 1142 Smith Numbers

 Smith NumbersTime Limit: 1000MS Memory Limit: 10000KTotal Submissions: 7141 Accepted: 2505DescriptionWhile skimming his phone directory in 1982, Albert Wilansky,

bobten2008的专栏 1335

POJ 1894 Alternative Scale of Notation

Alternative Scale of NotationTime Limit: 1000MS Memory Limit: 30000KTotal Submissions: 1530 Accepted: 538DescriptionOne may define a map of strings over an alphab

bobten2008的专栏 1323

POJ 1730 Perfect Pth Powers

Perfect Pth PowersTime Limit: 1000MS Memory Limit: 10000KTotal Submissions: 9722 Accepted: 2139DescriptionWe say that x is a perfect square if, for some integer b,

bobten2008的专栏 1244

POJ 1152 An Easy Problem

 An Easy Problem!Time Limit: 1000MS Memory Limit: 10000KTotal Submissions: 6264 Accepted: 1429DescriptionHave you heard the fact "The base of every normal number

bobten2008的专栏 1182

POJ 1728 A flea on a chessboard

A flea on a chessboardTime Limit: 1000MS Memory Limit: 10000KTotal Submissions: 1509 Accepted: 491DescriptionAn infinite chessboard is obtained by extending a finit

bobten2008的专栏 1158

POJ 1906 Three Powers

Three powersTime Limit: 1000MS Memory Limit: 30000KTotal Submissions: 3299 Accepted: 1405DescriptionConsider the set of all non-negative integer powers of 3. S = {

bobten2008的专栏 1057
上一篇: 点连通度 边连通度 最大流最小割 最小割点集 最小割边集 & POJ 1966 Cable TV Network
下一篇: POJ 1964 & 1494
bobten2008
博客等级 码龄18年 153粉丝 157原创
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

个

红包个数最小为10个

元

红包金额最低5元

当前余额3.43元 前往充值 >
需支付:10.00元
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付元
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值