1 solutions

  • 1
    @ 2025-11-9 11:43:02
    #include<bits/stdc++.h>
    using namespace std;
    const int N=2e5+10; 
    vector<int> g[N];
    int main()
    {
    	int n,q;
    	cin>>n>>q;
    	for(int i=1;i<=n;i++)
    	{
    		int t;
    		cin>>t;
    		g[i].push_back(t);
    		while(t--)
    		{
    			int x;
    			cin>>x;
    			g[i].push_back(x); 
    		}
    	}
    	while(q--)
    	{
    		int a,b;
    		cin>>a>>b;
    		cout<<g[a][b]<<endl;
    	}
    	return 0;
    }
    
    
    • 1

    Information

    ID
    2718
    Time
    1000ms
    Memory
    256MiB
    Difficulty
    1
    Tags
    # Submissions
    14
    Accepted
    7
    Uploaded By