Codeforces Round #252 (Div. 2) A - Valera and Antique Items

OpenSoucre發表於2014-06-09

水題

#include <iostream>
#include <set>
#include <vector>
#include <algorithm>

using namespace std;

int main(){
    int n,v;
    cin >> n >> v;
    vector<int> res;
    for(int i = 0; i < n; ++ i){
        int k,s;
        bool flag = false;
        cin >> k;
        for(int j  =0 ; j < k; ++j){
            int s;
            cin >> s;
            if(!flag && s < v) res.push_back(i+1),flag = true;
        }
    }
    cout<<res.size()<<endl;
    for(int i = 0 ; i < res.size(); ++ i){
        if(i)cout<<" ";
        cout<<res[i];
    }
    cout<<endl;
}

 

相關文章