11341 - Term Strategy

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

Moderator: Board moderators

shakil
Learning poster
Posts: 74
Joined: Sat Jul 15, 2006 6:28 am
Location: CUET , bangladesh
Contact:

11341 - Term Strategy

Post by shakil » Mon Nov 12, 2007 10:00 am

Why WA?? please help......

Code: Select all

Cut after AC.....
Last edited by shakil on Mon Nov 12, 2007 10:17 am, edited 1 time in total.
SHAKIL

User avatar
rio
A great helper
Posts: 385
Joined: Thu Sep 21, 2006 5:01 pm
Location: Kyoto, Japan

Post by rio » Mon Nov 12, 2007 10:14 am

Try this.

Code: Select all

printf("Maximal possible average mark - %.2lf.\n",d+1e-9); 
----
Rio

User avatar
emotional blind
A great helper
Posts: 383
Joined: Mon Oct 18, 2004 8:25 am
Location: Bangladesh
Contact:

Post by emotional blind » Mon Nov 12, 2007 10:48 am

I am also getting WA

Code: Select all

Code Removed
Last edited by emotional blind on Mon Nov 12, 2007 4:42 pm, edited 1 time in total.

User avatar
rio
A great helper
Posts: 385
Joined: Thu Sep 21, 2006 5:01 pm
Location: Kyoto, Japan

Post by rio » Mon Nov 12, 2007 2:10 pm

Try this.
Input:

Code: Select all

1
2 2
9 10
1 2
Output:

Code: Select all

Peter, you shouldn't have played billiard that much.
----
Rio

User avatar
emotional blind
A great helper
Posts: 383
Joined: Mon Oct 18, 2004 8:25 am
Location: Bangladesh
Contact:

Post by emotional blind » Mon Nov 12, 2007 4:40 pm

Thanks
Accepted now..

armansuleimenov
New poster
Posts: 15
Joined: Tue Sep 25, 2007 3:07 am
Location: Astana, Kazakhstan
Contact:

Post by armansuleimenov » Tue Nov 13, 2007 6:56 am

I don't think I completely understand what I am asked in this problem. Could someone explain me?

sclo
Guru
Posts: 519
Joined: Mon Jan 23, 2006 10:45 pm
Location: Vancouver, BC, Canada
Contact:

Post by sclo » Tue Nov 13, 2007 10:57 pm

armansuleimenov wrote:I don't think I completely understand what I am asked in this problem. Could someone explain me?
Think of the input in terms of nxm matrix. (0 based indexed)
Row i, column j means the studying ith course for j+1 hours can get you a score of L[j]
We want to find an solution vector x[] such that L[x]>=5 and sum(x+1,i=0..n-1)<=m and sum(L[x],i=0..n-1) is maximal.

luishhh
New poster
Posts: 26
Joined: Mon Oct 25, 2004 8:11 pm
Location: Spain

Post by luishhh » Tue Nov 13, 2007 11:06 pm

Is there any tricky i/o for this problem?
I use a very simple dp which gives WA

Edit: got AC, precision issue printing the output
"From lost to the river" --> Spanish quote

sclo
Guru
Posts: 519
Joined: Mon Jan 23, 2006 10:45 pm
Location: Vancouver, BC, Canada
Contact:

Post by sclo » Tue Nov 13, 2007 11:10 pm

luishhh wrote:Is there any tricky i/o for this problem?
I use a very simple dp which gives WA
Did you handle the case where every number on a row is less than 5?

jaywinyeah
New poster
Posts: 19
Joined: Sun Aug 17, 2003 10:40 pm

Post by jaywinyeah » Sun Nov 18, 2007 11:09 pm

Thanks for the suggestion above to add 1e-9 to my answer before rounding to two decimal places. With that one change, I got AC instead of the many WA's I was getting. Why do we need to add 1e-9 and how did you figure that out?
LL Cool Jay
The Formula Wizard
Jason Winokur

Leonid
Experienced poster
Posts: 146
Joined: Thu Dec 22, 2005 5:50 pm
Contact:

Post by Leonid » Sun Nov 18, 2007 11:25 pm

jaywinyeah wrote:Thanks for the suggestion above to add 1e-9 to my answer before rounding to two decimal places. With that one change, I got AC instead of the many WA's I was getting. Why do we need to add 1e-9 and how did you figure that out?
Because you may have the result 6.125 or something similar. The computer represents this number as: 6.12499999999, that is why the result may be rounded to 6.12, instead of 6.13.

jaywinyeah
New poster
Posts: 19
Joined: Sun Aug 17, 2003 10:40 pm

Post by jaywinyeah » Mon Nov 19, 2007 12:11 am

That makes sense. Is it a good practice to add 1e-9 to every problem that requires a decimal answer? Thanks.
LL Cool Jay
The Formula Wizard
Jason Winokur

cegomes
New poster
Posts: 2
Joined: Thu Jan 03, 2008 3:39 pm

Post by cegomes » Thu Jan 03, 2008 3:47 pm

I tried to solve the problem using DP but, even I'm almost sure that my solution is right, I'm still getting WA. Could someone post some test cases for me to try to find the error?

Thanks!

cegomes
New poster
Posts: 2
Joined: Thu Jan 03, 2008 3:39 pm

Post by cegomes » Fri Jan 04, 2008 4:10 pm

Ah! Finally I got AC. Believe or not my mistake was that I was using " ` " instead of " ' ".

BUET
New poster
Posts: 22
Joined: Sun Jun 13, 2010 8:38 am

11341 - Term Strategy(Clarification)

Post by BUET » Thu Nov 29, 2012 1:10 pm

I think there is no test case where all grade value are less than 5 for a particular case.

So i think this input is invalid

Code: Select all

1
2 2
9 10
1 2
I got accepted by considering the fact that at least one grade value is greater than or equal to 5 for a particular course.

Shadek
BUET,CSE-07

Post Reply

Return to “Volume 113 (11300-11399)”