vector of vector(stl)
#include<bits/stdc++.h>
using namespace std;
#define shailesh ios::sync_with_stdio(false); cin.tie(0); cout.tie(0);
#define ll long long int
#define vi vector<int>
#define pii pair<int, int>
#define vii vector<pii>
#define rep(i, a, b) for(int i=a; i<b; i++)
#define ff first
#define ss second
void printVec(vector<int> &v){
cout<<"size : "<<v.size()<<" "<<endl;
for (int i = 0; i < v.size(); i++)
{
cout<<v[i]<<" ";
}
cout<<endl;
}
int main(){
shailesh
int N;
cin>>N;
vector<int> v[N];
for (int i = 0; i < N; i++)
{
int n;
cin>>n;
for (int j = 0; j < n; j++)
{
int x;
cin>>x;
v[i].push_back(x);
}
}
for (int i = 0; i < N; i++)
{
printVec(v[i]);
}
return 0;
}
//
output
3
2
1 2
3
1 2 3
4
1 2 3 4
size : 2
1 2
size : 3
1 2 3
size : 4
1 2 3 4
Comments
Post a Comment