here is my code :
#includestdio.h
#includestdlib.h
int main()
{
long long cand,sum;
int T,N,i,j,*temp;
scanf(%d,T);
temp= (int*)calloc(T, sizeof( int));
sum = 0;
for(i=0;iT;i++)
{
scanf(%d,N);
for(j=0;jN;j++)
{
scanf(%lld,cand);
Initialize sum as zero for all test cases ie inside 1st for loop.
On Jun 21, 2012 5:22 PM, Mayank Singh singh13490may...@gmail.com wrote:
here is my code :
#includestdio.h
#includestdlib.h
int main()
{
long long cand,sum;
int T,N,i,j,*temp;
scanf(%d,T);
temp=
@Mayank coding style not seems gud.. try this...
int main()
{
int testCases;
scanf(%d,testCases);
while(testCases--0)
{
//perform ur logic
//print output for each test case here instead of storing it into
an array.
}
}
return 0;
}
On Thu, Jun 21, 2012 at 10:35 PM,