Skip to content

Instantly share code, notes, and snippets.

@Pranavpaharia
Created March 11, 2019 11:47
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Pranavpaharia/1df652a087d0a9fb9d362ca8156c0b8f to your computer and use it in GitHub Desktop.
Save Pranavpaharia/1df652a087d0a9fb9d362ca8156c0b8f to your computer and use it in GitHub Desktop.
vector<vector <long int>> ArrayList;
long int Nelements, nQueries;
long int q1, q2, p1, p2;
cin >> Nelements >> nQueries;
vector<long int> cList;
long int a1, a2;
//for(vector <vector<long int>>::iterator it = ArrayList.begin();it != ArrayList.end();++it)
for (long int i = 0; i < Nelements; i++)
{
cList.clear();
int parameter;
cin >> parameter;
for (long int j = 0; j < parameter; j++)
{
long int data;
cin >> data;
cList.push_back(data);
}
ArrayList.push_back(cList);
}
cin >> q1 >> q2;
cin >> p1 >> p2;
cList = ArrayList.at(q1);
a1 = cList.at(q2);
cList.clear();
cList = ArrayList.at(p1);
a2 = cList.at(p2);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment