Codeforces Round #252 (Div. 2) A. Valera and Antique Items
来源:互联网 发布:xlsx 另存为xml数据 编辑:程序博客网 时间:2024/05/21 22:27
#include <iostream>
#include <cstdio>
#include <cstring>
using namespace std;
int order[60];
int main(){
int n,v;
int k,s;
int cnt,i,j;
scanf("%d %d",&n,&v);
cnt=0;
j=0;
for(i=1;i<=n;i++){
scanf("%d",&k);
int flag=0;
while(k--){
scanf("%d",&s);
if(s<v)
flag=1;
}
if(flag){
cnt++;
order[j++]=i;
}
}
printf("%d\n",cnt);
if(cnt!=0){
printf("%d",order[0]);
for(i=1;i<j;i++)
printf(" %d",order[i]);
printf("\n");
}
return 0;
}
#include <vector>
using namespace std;
int main() {
int n, v;
int i,j;
cin >> n >> v;
vector <int> ans;
for(i=1;i<=n;i++){
bool u = false;
int k, s;
cin >> k;
for(j=1;j<=k;j++) {
cin >> s;
if (!u && v > s) {
u = true;
ans.push_back(i);
}
}
}
cout << ans.size() << endl;
for(i=0;i<ans.size();i++)
cout << ans[i] << " ";
return 0;
}
0 0
- Codeforces Round #252 (Div. 2)A. Valera and Antique Items
- Codeforces Round #252 (Div. 2) A. Valera and Antique Items
- Codeforces Round #252 (Div. 2) 441A Valera and Antique Items
- Codeforces Round #252(Div. 2) 441A. Valera and Antique Items 水题
- CodeForces 252A-Valera and Antique Items
- CodeForces 441 A. Valera and Antique Items
- CodeForces 441A Valera and Antique Items
- CodeForces 441A Valera and Antique Items
- codeforces 441A Valera and Antique Items
- A. Valera and Antique Items
- Codeforces Round #216 (Div. 2) A. Valera and Plates
- Codeforces Round #237 (Div. 2) A. Valera and X
- Codeforces Round #252 (Div. 2) 441B. Valera and Fruits
- Codeforces Round #252 (Div. 2) C. Valera and Tubes
- Codeforces Round #252 (Div. 2) 441C. Valera and Tubes
- Codeforces Round #252 (Div. 2)441D. Valera and Swaps
- Codeforces Round #252 (Div. 2)B. Valera and Fruits
- Codeforces Round #252 (Div. 2)-B. Valera and Fruits
- linux设备驱动之USB主机控制器驱动分析 (一)
- 开发人员管理
- a<b extends c> 学习
- 什么是透明通道,如何使用?
- Linux 3.10 ARM Device Tree 的初始化
- Codeforces Round #252 (Div. 2) A. Valera and Antique Items
- 复数矩阵和快速傅里叶变换
- 基于注解的Spring MVC
- linux高级技巧:heartbeat+lvs(二)
- 使用事务提升sqlite insert的性能
- Equinox p2 详细图示讲解(Eclipse 4.3)
- 电阻电容相同容量不同封装的区别
- POJ2492 A Bug's Life (并查集)
- 如何做系统分层