for the easy level question Birthday Candles : http://www.codechef.com/problems/CANDLE/ i have tried all the test cases that i could but i m still getting wrong answer.
Please tell me the tell case for which my code is failing or tell me the error that i am able to find.
Here is the code :
#include<iostream>
#include<math.h>
using namespace std;
int main()
{
int t;
cin>>t;
while(t--)
{
int arr[10];
for(int i=0;i<10;i++)
cin>>arr[i];
int min_value=arr[1],min_index=1;
for(int i=1;i<10;i++)
{
if(min_value>arr[i])
{
min_value=arr[i];
min_index=i;
}
}
if(min_value==0)
cout<<min_index<<endl;
else if(min_value!=0&&arr[0]==0)
cout<<10<<endl;
else if(min_value!=0&&arr[0]!=0)
{
if(arr[0]<min_value)
cout<<min_index*pow(10,arr[0]+1);
else if(arr[0]>=min_value)
{
for(int i=0;i<=min_value;i++)
cout<<min_index;
cout<<endl;
}
}
}
}