Codeforces441A_Valera and Antique Items(水题)
1 second
256 megabytes
standard input
standard output
Valera is a collector. Once he wanted to expand his collection with exactly one antique item.
Valera knows n sellers of antiques, the i-th of them
auctioned ki items.
Currently the auction price of the j-th object of the i-th
seller issij.
Valera gets on well with each of the n sellers. He is perfectly sure that if he outbids the current price of one of the items in the auction (in other words,
offers the seller the money that is strictly greater than the current price of the item at the auction), the seller of the object will immediately sign a contract with him.
Unfortunately, Valera has only v units of money. Help him to determine which of the n sellers
he can make a deal with.
The first line contains two space-separated integers n, v (1 ≤ n ≤ 50; 104 ≤ v ≤ 106) —
the number of sellers and the units of money the Valera has.
Then n lines follow. The i-th line first contains
integer ki (1 ≤ ki ≤ 50) the
number of items of the i-th seller. Then go ki space-separated
integers si1, si2, ..., siki (104 ≤ sij ≤ 106) —
the current prices of the items of the i-th seller.
In the first line, print integer p — the number of sellers with who Valera can make a deal.
In the second line print p space-separated integers q1, q2, ..., qp (1 ≤ qi ≤ n) —
the numbers of the sellers with who Valera can make a deal. Print the numbers of the sellers in the increasing order.
3 50000
1 40000
2 20000 60000
3 10000 70000 190000
3
1 2 3
3 50000
1 50000
3 100000 120000 110000
3 120000 110000 120000
0
In the first sample Valera can bargain with each of the sellers. He can outbid the following items: a 40000 item from the first seller, a20000 item
from the second seller, and a 10000 item from the third seller.
In the second sample Valera can not make a deal with any of the sellers, as the prices of all items in the auction too big for him.
解题报告
切水题。
#include <iostream>
#include <cstdio>
#include <cstring>
using namespace std;
int n,v,hashh[10000],k,s;
int main()
{
int i,j;
while(cin>>n>>v)
{
memset(hashh,0,sizeof(hashh));
for(i=1; i<=n; i++)
{
cin>>k;
for(j=0; j<k; j++)
{
cin>>s;
if(s<v)
hashh[i]=1;
}
}
int cnt=0;
for(i=1; i<=n; i++)
{
if(hashh[i])
{
cnt++;
}
}
printf("%d\n",cnt);
for(i=1;i<n;i++)
{
if(hashh[i])
{
printf("%d ",i);
}
}
if(hashh[n])
printf("%d",n);
printf("\n");
}
return 0;
}
Codeforces441A_Valera and Antique Items(水题)的更多相关文章
- Poj 1552 Doubles(水题)
一.Description As part of an arithmetic competency program, your students will be given randomly gene ...
- codeforces 569B B. Inventory(水题)
题目链接: B. Inventory time limit per test 1 second memory limit per test 256 megabytes input standard i ...
- HDOJ 2317. Nasty Hacks 模拟水题
Nasty Hacks Time Limit: 3000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others) Tota ...
- ACM :漫漫上学路 -DP -水题
CSU 1772 漫漫上学路 Time Limit: 1000MS Memory Limit: 131072KB 64bit IO Format: %lld & %llu Submit ...
- ytu 1050:写一个函数,使给定的一个二维数组(3×3)转置,即行列互换(水题)
1050: 写一个函数,使给定的一个二维数组(3×3)转置,即行列互换 Time Limit: 1 Sec Memory Limit: 128 MBSubmit: 154 Solved: 112[ ...
- [poj2247] Humble Numbers (DP水题)
DP 水题 Description A number whose only prime factors are 2,3,5 or 7 is called a humble number. The se ...
- gdutcode 1195: 相信我这是水题 GDUT中有个风云人物pigofzhou,是冰点奇迹队的主代码手,
1195: 相信我这是水题 Time Limit: 1 Sec Memory Limit: 128 MBSubmit: 821 Solved: 219 Description GDUT中有个风云人 ...
- BZOJ 1303 CQOI2009 中位数图 水题
1303: [CQOI2009]中位数图 Time Limit: 1 Sec Memory Limit: 162 MBSubmit: 2340 Solved: 1464[Submit][Statu ...
- 第十一届“蓝狐网络杯”湖南省大学生计算机程序设计竞赛 B - 大还是小? 字符串水题
B - 大还是小? Time Limit:5000MS Memory Limit:65535KB 64bit IO Format: Description 输入两个实数,判断第一个数大 ...
随机推荐
- Excel的vlookup函数的用法
VLOOKUP函数用于搜索指定区域内首列满足条件的元素,确定待检测单元格在区域中的行序号,再进一步返回选定单元格的值. 为了讲解的需要,特制作如图所示的表格.当然,大家也可以根据自己的实际情况设计合适 ...
- C# 过滤sql特殊字符串方法
1. /// <summary> /// 过滤不安全的字符串 /// </summary> /// <param name="Str" ...
- 判断浏览器 插件 jquery.ua.js
判断浏览器 插件 jquery.ua.js /*! * jquery.ua.js * @link https://github.com/cloudcome/jquery.ua * @author yd ...
- DES c#加密后java解密
public static String byteArr2HexStr(byte[] bytIn) { StringBuilder builder = new StringBuilder(); for ...
- android inflate压力泵,将视图发生整合的过程
转自:https://blog.csdn.net/u012702547/article/details/52628453?utm_source=copy inflate方法从大范围来看,分两种,三个参 ...
- 在 Azure Web 应用中创建 .NET 应用程序
本快速入门帮助你在数分钟内将你的第一个 ASP.NET Web 应用部署到 Azure 应用服务.完成本教程后,你将能够在云中启动并运行一个简单的 Web 应用.在本教程中完成的所有操作均符合1 元试 ...
- Java学习--扑克牌比大小的小游戏
实现:生成五十四张牌,然后进行洗牌,输入两名玩家,然后分别发两张牌,进行比较大小,两张牌中拥有较大一张牌的玩家获胜 Card.java代码如下: package com.cardgame; publi ...
- [LeetCode]Remove Duplicates from Sorted Array题解
Remove Duplicates from Sorted Array: Given a sorted array, remove the duplicates in place such that ...
- MySQL:PyMySQL&ORM
一.PyMySQL介绍 PyMySQL 是在 Python3.x 版本中用于连接 MySQL 服务器的一个库,Python2中则使用mysqldb. Django中也可以使用PyMySQL连接MySQ ...
- redux、immutablejs和mobx性能对比(二)
三.分析数据 1.前提说明 我对测试出的10个数据摘除最大值与最小值,然后求平均值 根据平均值我绘制了一个曲线图一个柱状图 曲线图用于查看1000-100000的性能趋势 柱状图用于比较在相同条数下r ...