10226 - Hardwood Species

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

Moderator: Board moderators

alimbubt
New poster
Posts: 39
Joined: Tue Aug 07, 2012 10:40 pm
Location: BUBT,Dhaka, Bangladesh
Contact:

Re: 10226 - Hardwood Species

Post by alimbubt » Thu Dec 13, 2012 9:58 am

brianfry713 wrote:post your updated code

Code: Select all

Accepted :D 
Last edited by alimbubt on Fri Dec 14, 2012 8:02 pm, edited 1 time in total.
Give me six hours to chop down a tree and I will spend the first four sharpening the axe...(BUBT ILLUSION)
http://uhunt.felix-halim.net/id/155497
http://onlyprogramming.wordpress.com/

brianfry713
Guru
Posts: 5947
Joined: Thu Sep 01, 2011 9:09 am
Location: San Jose, CA, USA

Re: 10226 - Hardwood Species

Post by brianfry713 » Fri Dec 14, 2012 12:39 am

Instead of adding every tree to the vector check the map to see if that tree already exists.
Check input and AC output for thousands of problems on uDebug!

alimbubt
New poster
Posts: 39
Joined: Tue Aug 07, 2012 10:40 pm
Location: BUBT,Dhaka, Bangladesh
Contact:

Re: 10226 - Hardwood Species

Post by alimbubt » Fri Dec 14, 2012 8:03 pm

brianfry713 wrote:Instead of adding every tree to the vector check the map to see if that tree already exists.
Thanks a lot......now Accepted :D
Give me six hours to chop down a tree and I will spend the first four sharpening the axe...(BUBT ILLUSION)
http://uhunt.felix-halim.net/id/155497
http://onlyprogramming.wordpress.com/

User avatar
@ce
Learning poster
Posts: 71
Joined: Mon May 28, 2012 8:46 am
Location: Ranchi, India

Re: 10226 - Hardwood Species

Post by @ce » Fri Dec 28, 2012 7:36 am

Getting WA....plzz help

Code: Select all

AC
Last edited by @ce on Sun Dec 30, 2012 7:42 pm, edited 1 time in total.
-@ce

brianfry713
Guru
Posts: 5947
Joined: Thu Sep 01, 2011 9:09 am
Location: San Jose, CA, USA

Re: 10226 - Hardwood Species

Post by brianfry713 » Sat Dec 29, 2012 9:50 pm

Print a blank line between 2 consecutive data sets.
Check input and AC output for thousands of problems on uDebug!

User avatar
@ce
Learning poster
Posts: 71
Joined: Mon May 28, 2012 8:46 am
Location: Ranchi, India

Re: 10226 - Hardwood Species

Post by @ce » Sun Dec 30, 2012 7:37 pm

Thanks brianfry713...i got AC. :)
-@ce

MauriWilde
New poster
Posts: 14
Joined: Sun Jan 20, 2013 1:58 am

10226 - Hardwood Species submission error?

Post by MauriWilde » Sun Jun 09, 2013 8:41 pm

Why am I getting submission error in this problem? I sent it like six times and always is the same.

You can see my submissions here: http://uhunt.felix-halim.net/id/129605

And here is my code:

Code: Select all

Removed after AC
Please help me :(
Last edited by MauriWilde on Sun Jun 01, 2014 9:27 pm, edited 1 time in total.

MauriWilde
New poster
Posts: 14
Joined: Sun Jan 20, 2013 1:58 am

Re: 10226 - Hardwood Species submission error?

Post by MauriWilde » Mon Jun 10, 2013 12:41 am

I checked and this problem is giving submission error to everybody since 25 days ago u.u

brianfry713
Guru
Posts: 5947
Joined: Thu Sep 01, 2011 9:09 am
Location: San Jose, CA, USA

Re: 10226 - Hardwood Species submission error?

Post by brianfry713 » Tue Jun 11, 2013 12:30 am

Try a different problem.
Check input and AC output for thousands of problems on uDebug!

aranjuda
New poster
Posts: 1
Joined: Thu Jul 04, 2013 9:47 am

Re: 10226 - Hardwood Species submission error?

Post by aranjuda » Thu Jul 04, 2013 9:53 am

I am getting submission error too. Is this a problem with the judge or with my code?

brianfry713
Guru
Posts: 5947
Joined: Thu Sep 01, 2011 9:09 am
Location: San Jose, CA, USA

Re: 10226 - Hardwood Species submission error?

Post by brianfry713 » Fri Jul 05, 2013 11:01 pm

It's probably an issue with the judge.
Check input and AC output for thousands of problems on uDebug!

User avatar
uDebug
A great helper
Posts: 475
Joined: Tue Jul 24, 2012 4:23 pm

Re: 10226 - Hardwood Species submission error?

Post by uDebug » Sat Jan 04, 2014 1:07 pm

aranjuda wrote:I am getting submission error too. Is this a problem with the judge or with my code?
I tried this problem today and got a submission error as well.

But the strange thing is that I got an e-mail saying
Your submission with number XXXXXXXX for the problem 10226 - Hardwood Species has succeeded with verdict Accepted.
And it shows up as being solved on UVA Online when I click on the statistics for this problem. I see my ranking, submission ID run time and other details. However, it doesn't show any of these on uHunt. So, I wonder if there's something else going on.

Also, I found this on Submission Errors

http://uva.onlinejudge.org/index.php?op ... 1&Itemid=1

Update: After trying to submit this several times and not getting anywhere, I tried submitting it when there were relatively few submissions going on - and sure enough it went through. It looks like the problem has a very big dataset or seems to use a lot of the judge's resources. So, maybe given that my problem was the only one being judged for a few minutes when I submitted it helped.
Check input and AC output for over 7,500 problems on uDebug!

Find us on Facebook. Follow us on Twitter.

User avatar
uDebug
A great helper
Posts: 475
Joined: Tue Jul 24, 2012 4:23 pm

Re: 10226 - Hardwood Species submission error?

Post by uDebug » Sat Jan 04, 2014 1:41 pm

Here's some input / output that helped me test/ debug my program.

Note that there's no newline after the last set of output. There's only one in between output sets.

Input:

Code: Select all

3

Red Alder
Ash
Aspen
Basswood
Ash
Beech
Yellow Birch
Ash
Cherry
Cottonwood
Ash
Cypress
Red Elm
Gum
Hackberry
White Oak
Hickory
Pecan
Hard Maple
White Oak
Soft Maple
Red Oak
Red Oak
White Oak
Poplan
Sassafras
Sycamore
Black Walnut
Willow

Tree1
Tree2
Tree3
Tree1

Tree5
Tree6
Tree1
Tree2
AC Output:

Code: Select all

Ash 13.7931
Aspen 3.4483
Basswood 3.4483
Beech 3.4483
Black Walnut 3.4483
Cherry 3.4483
Cottonwood 3.4483
Cypress 3.4483
Gum 3.4483
Hackberry 3.4483
Hard Maple 3.4483
Hickory 3.4483
Pecan 3.4483
Poplan 3.4483
Red Alder 3.4483
Red Elm 3.4483
Red Oak 6.8966
Sassafras 3.4483
Soft Maple 3.4483
Sycamore 3.4483
White Oak 10.3448
Willow 3.4483
Yellow Birch 3.4483

Tree1 50.0000
Tree2 25.0000
Tree3 25.0000

Tree1 25.0000
Tree2 25.0000
Tree5 25.0000
Tree6 25.0000
Last edited by uDebug on Wed Feb 12, 2014 1:23 pm, edited 1 time in total.
Check input and AC output for over 7,500 problems on uDebug!

Find us on Facebook. Follow us on Twitter.

piyukr
New poster
Posts: 17
Joined: Sun Jan 26, 2014 10:35 am

Re: 10226 - Hardwood Species submission error?

Post by piyukr » Tue Feb 11, 2014 9:17 pm

There are a few common pitfalls in this problem.Be sure to check the following:
1.)Between two input test cases, there is a blank line.
2.)There is EOF at the end of the last case , not a blank line.
3.)The names of the trees should be sorted in the output.
4.)Output cases should be separated by a printing blank line.
5.)There will not be any blank line after the last case's output.
6.)There may be a test case in which there is no tree at all i.e. a blank test case. For such a case do not print anything.
7.)In a case when there are no trees , if you are calculating the % of each tree , divide by zero may occur.
8.)There may be leading/trailing white spaces in the input lines. Be sure to remove them.
Last edited by piyukr on Wed Feb 12, 2014 10:41 am, edited 3 times in total.

brianfry713
Guru
Posts: 5947
Joined: Thu Sep 01, 2011 9:09 am
Location: San Jose, CA, USA

Re: 10226 - Hardwood Species submission error?

Post by brianfry713 » Wed Feb 12, 2014 12:09 am

It looks like you figured it out
Check input and AC output for thousands of problems on uDebug!

Post Reply

Return to “Volume 102 (10200-10299)”