10014 - Simple calculations

All about problems in Volume 100. If there is a thread about your problem, please use it. If not, create one with its number in the subject.

Moderator: Board moderators

tan_Yui
Experienced poster
Posts: 155
Joined: Sat Jul 10, 2004 12:41 am

Re: 10014 Run Time Error

Post by tan_Yui » Tue Jan 03, 2006 9:09 am

Your recursive function cannot work if n>1.
Then the function continues infinitely, so the judge said RE.

Best regards.

Staryin
New poster
Posts: 12
Joined: Fri Dec 16, 2005 4:22 pm
Location: shanghai/china
Contact:

10014 WA WHO CAN GIVE ME TESTDATA!!!

Post by Staryin » Wed Feb 08, 2006 6:17 am

10014 WA WHO CAN GIVE ME TESTDATA!!!

User avatar
tmdrbs6584
Learning poster
Posts: 98
Joined: Sat Jan 21, 2006 12:45 pm
Location: Busan,Corea(Republic of)

Hmm

Post by tmdrbs6584 » Sun Feb 12, 2006 11:22 am

Why don't you make bigger array size?

taskin
New poster
Posts: 22
Joined: Sun Jan 01, 2006 1:43 pm
Location: Bangladesh

Post by taskin » Thu Jun 22, 2006 11:55 am

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.

User avatar
dust_cover
New poster
Posts: 23
Joined: Tue Sep 12, 2006 9:46 pm

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

Post by dust_cover » Tue Nov 14, 2006 8:32 pm

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 :D
i wanna give it a try....

User avatar
dust_cover
New poster
Posts: 23
Joined: Tue Sep 12, 2006 9:46 pm

10014

Post by dust_cover » Wed Nov 15, 2006 12:29 pm

Hello,
I got ACC. I made wrong calculation!
Thanx in advance!
:P
i wanna give it a try....

rana_cse_ruet
New poster
Posts: 7
Joined: Mon Mar 05, 2007 9:59 am

10014

Post by rana_cse_ruet » Mon Mar 05, 2007 7:25 pm

t
Last edited by rana_cse_ruet on Thu Mar 15, 2007 5:46 pm, edited 1 time in total.

User avatar
Debashis Maitra
Learning poster
Posts: 62
Joined: Sun Jul 09, 2006 8:31 am
Location: University of Dhaka
Contact:

Post by Debashis Maitra » Tue Mar 06, 2007 10:19 pm

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 :D
Akash chhoyar swopno
Dream to touch the sky

rana_cse_ruet
New poster
Posts: 7
Joined: Mon Mar 05, 2007 9:59 am

Post by rana_cse_ruet » Fri Mar 09, 2007 4:35 am

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...

User avatar
Debashis Maitra
Learning poster
Posts: 62
Joined: Sun Jul 09, 2006 8:31 am
Location: University of Dhaka
Contact:

Post by Debashis Maitra » Fri Mar 09, 2007 9:44 pm

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 :lol:
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

User avatar
Debashis Maitra
Learning poster
Posts: 62
Joined: Sun Jul 09, 2006 8:31 am
Location: University of Dhaka
Contact:

Post by Debashis Maitra » Fri Mar 09, 2007 10:10 pm

Rana

Now Remove your code
Akash chhoyar swopno
Dream to touch the sky

rana_cse_ruet
New poster
Posts: 7
Joined: Mon Mar 05, 2007 9:59 am

Post by rana_cse_ruet » Sat Mar 10, 2007 1:53 pm

Thanks a lot. I got the point.

User avatar
Debashis Maitra
Learning poster
Posts: 62
Joined: Sun Jul 09, 2006 8:31 am
Location: University of Dhaka
Contact:

Post by Debashis Maitra » Sat Mar 10, 2007 4:11 pm

Thats good
Now remove your code
Akash chhoyar swopno
Dream to touch the sky

User avatar
linux
Learning poster
Posts: 56
Joined: Sat Jul 01, 2006 12:21 pm
Location: CA-95054
Contact:

simple calculations 10014

Post by linux » Wed Nov 28, 2007 2:09 pm

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

aeiou
New poster
Posts: 21
Joined: Wed May 07, 2008 11:32 am

10014 - Simple Calculations

Post by aeiou » Thu Jun 19, 2008 4:12 pm

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";
}

Post Reply

Return to “Volume 100 (10000-10099)”