10014 - Simple calculations
Moderator: Board moderators
Re: 10014 Run Time Error
Your recursive function cannot work if n>1.
Then the function continues infinitely, so the judge said RE.
Best regards.
Then the function continues infinitely, so the judge said RE.
Best regards.
10014 WA WHO CAN GIVE ME TESTDATA!!!
10014 WA WHO CAN GIVE ME TESTDATA!!!
- tmdrbs6584
- Learning poster
- Posts: 98
- Joined: Sat Jan 21, 2006 12:45 pm
- Location: Busan,Corea(Republic of)
Hmm
Why don't you make bigger array size?
Archaan
CAN YOU BEAT ME?
http://acm.uva.es/problemset/usersjudge.php?user=19788
AND,
http://acm.uva.es/problemset/submit.php
http://online-judge.uva.es/problemset/submit.php
SUBMIT AND GET AC!!!
CAN YOU BEAT ME?
http://acm.uva.es/problemset/usersjudge.php?user=19788
AND,
http://acm.uva.es/problemset/submit.php
http://online-judge.uva.es/problemset/submit.php
SUBMIT AND GET AC!!!
- dust_cover
- New poster
- Posts: 23
- Joined: Tue Sep 12, 2006 9:46 pm
10014--output of the judge's data!!!!!!!
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
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

i wanna give it a try....
- dust_cover
- New poster
- Posts: 23
- Joined: Tue Sep 12, 2006 9:46 pm
-
- New poster
- Posts: 7
- Joined: Mon Mar 05, 2007 9:59 am
- Debashis Maitra
- Learning poster
- Posts: 62
- Joined: Sun Jul 09, 2006 8:31 am
- Location: University of Dhaka
- Contact:
try to read carefully the output format of the problem
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
I hope it will help youPrint a blank line between the outputs for two consecutive test cases.
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

Akash chhoyar swopno
Dream to touch the sky
Dream to touch the sky
-
- New poster
- Posts: 7
- Joined: Mon Mar 05, 2007 9:59 am
- Debashis Maitra
- Learning poster
- Posts: 62
- Joined: Sun Jul 09, 2006 8:31 am
- Location: University of Dhaka
- Contact:
Your question is not clear...
If your question is how can you print a blank line between 2 test case
Answer is
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
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*/
....
.....
.....
}
}
it prints a new line before the output (except first case)
I hope it will help you
Best of luck

Last edited by Debashis Maitra on Sat Mar 10, 2007 4:12 pm, edited 1 time in total.
Akash chhoyar swopno
Dream to touch the sky
Dream to touch the sky
- Debashis Maitra
- Learning poster
- Posts: 62
- Joined: Sun Jul 09, 2006 8:31 am
- Location: University of Dhaka
- Contact:
-
- New poster
- Posts: 7
- Joined: Mon Mar 05, 2007 9:59 am
- Debashis Maitra
- Learning poster
- Posts: 62
- Joined: Sun Jul 09, 2006 8:31 am
- Location: University of Dhaka
- Contact:
simple calculations 10014
I'm got wrong answer. I need sample outputs for inputs. Please help.
Solving for fun..
10014 - Simple Calculations
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 :
Can anybody help me out of this ????!!!!!!!!
for ( ; ; )
{
cout << "Thankx in advance";
}
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;
}
for ( ; ; )
{
cout << "Thankx in advance";
}