Page **2** of **3**

### Re: 10014 Run Time Error

Posted: **Tue Jan 03, 2006 9:09 am**

by **tan_Yui**

Your recursive function cannot work if n>1.

Then the function continues infinitely, so the judge said RE.

Best regards.

### 10014 WA WHO CAN GIVE ME TESTDATA!!!

Posted: **Wed Feb 08, 2006 6:17 am**

by **Staryin**

10014 WA WHO CAN GIVE ME TESTDATA!!!

### Hmm

Posted: **Sun Feb 12, 2006 11:22 am**

by **tmdrbs6584**

Why don't you make bigger array size?

Posted: **Thu Jun 22, 2006 11:55 am**

by **taskin**

thanks. yes, this program falls in an infinite recursion when n > 1. in fact, it's not possible to solve this by using recursive call.

### 10014--output of the judge's data!!!!!!!

Posted: **Tue Nov 14, 2006 8:32 pm**

by **dust_cover**

hi Revenger,

I was trying to solve the problem. But getting WA.

CAn u please tell me the output of the judges's data so I can match it with my one!

--thnx in advance

### 10014

Posted: **Wed Nov 15, 2006 12:29 pm**

by **dust_cover**

Hello,

I got ACC. I made wrong calculation!

Thanx in advance!

### 10014

Posted: **Mon Mar 05, 2007 7:25 pm**

by **rana_cse_ruet**

t

Posted: **Tue Mar 06, 2007 10:19 pm**

by **Debashis Maitra**

try to read carefully the output format of the problem

Print a blank line between the outputs for two consecutive test cases.

I hope it will help you

And remember dont open a new thread if there is one already. you can find old posts using search and use them to post

Best of luck

Posted: **Fri Mar 09, 2007 4:35 am**

by **rana_cse_ruet**

Thanks, but i thought a have already printed that after each output. Is there any other way to print a blank line? Please help me about the new line if can...

Posted: **Fri Mar 09, 2007 9:44 pm**

by **Debashis Maitra**

Your question is not clear...

If your question is how can you print a blank line between 2 test case

Answer is

Code: Select all

```
.......
main()
{
....
....
char btwn_case=0;
...........
while(tast_case--)
{
...
....
......
if (btwn_case)printf("\n");/*print it before printing any output*/
else btwn_case=1;
/*Now print your output of this test case*/
....
.....
.....
}
}
```

This code prints new line between 2 test cases because

it prints a new line before the output

**(except first case)**
I hope it will help you

Best of luck

Posted: **Fri Mar 09, 2007 10:10 pm**

by **Debashis Maitra**

**Rana**

Now Remove your code

Posted: **Sat Mar 10, 2007 1:53 pm**

by **rana_cse_ruet**

Thanks a lot. I got the point.

Posted: **Sat Mar 10, 2007 4:11 pm**

by **Debashis Maitra**

Thats good

Now remove your code

### simple calculations 10014

Posted: **Wed Nov 28, 2007 2:09 pm**

by **linux**

I'm got wrong answer. I need sample outputs for inputs. Please help.

### 10014 - Simple Calculations

Posted: **Thu Jun 19, 2008 4:12 pm**

by **aeiou**

Hi,

I ve been trying this problem for a long time...but getting WA..

I m sure about my calculations....

I used the formula : (n+1)a1=n*a0 + (an+1) - 2(n*c1 + (n-1)*c2 + (n-2)*c3 + ... + 1*cn)

Here's my code :

Code: Select all

```
#include<iostream>
#include<cmath>
#include<vector>
using namespace std;
int main ()
{
int t;
while ( scanf ( "%d" , &t ) == 1 )
{
while ( t -- )
{
int n , m;
double a0 , an;
scanf ( "%d %lf %lf" , &n , &a0 , &an );
vector <double> ci(n);
for ( int i = 0 ; i < n ; i ++ )
scanf ( "%lf" , &ci[i]);
m = n;
a0 = ( n * a0 );
a0 += an;
double x = 0.0;
for ( int i = 0 ; i < n ; i ++ )
{
x += ( n * ci[i] );
n --;
}
x *= 2;
double ans = ( a0 - x ) / ( m + 1.0 );
printf ( "%.2lf\n" , ans);
if ( t > 0 )
cout << endl;
}
}
return 0;
}
```

Can anybody help me out of this ????!!!!!!!!

for ( ; ; )

{

cout << "Thankx in advance";

}