My issue
plz expain this i’m little bit confused about how to take input if nothing is mention about how many element enter in any particular row.
My code
#include <bits/stdc++.h>
#define ll long int
using namespace std;
int main() {
// your code goes here
int t;
cin>>t;
while(t--){
ll n,k;
cin>>n>>k;
}
return 0;
}
Problem Link: DISHLIFE Problem - CodeChef
@deepak_5047
u can take input like this
#include <bits/stdc++.h>
#define ll long int
using namespace std;
int main() {
// your code goes here
int t;
cin>>t;
while(t--){
ll n,k;
cin>>n>>k;
for(int i=0;i<n;i++)
{
ll p;
cin>>p;
lli val[p];
for(int j=0;j<p;j++)
{
cin>>val[p];
}
}
}
return 0;
}
It is not mention in que.
If let say any row like this -->1 5 6 18
@deepak_5047
In any row first element will be the size of the array and rest will be its elements.
Its mentioned in the input section that first element would be the size of the array.