10458 - Cricket Ranking

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

Moderator: Board moderators

Post Reply
Sajid
Learning poster
Posts: 94
Joined: Sat Oct 05, 2002 5:34 pm
Location: CS - AIUB, Dhaka, Bangladesh.
Contact:

10458 - Cricket Ranking

Post by Sajid »

I think, my program is ok. but it has a error msg TLE.... i have to do somthing for the less CPU time.

What can i do now????
Sajid Online: www.sajidonline.com
User avatar
mathijs
New poster
Posts: 7
Joined: Tue Mar 04, 2003 5:15 pm
Location: Groningen, The Netherlands
Contact:

Formula?

Post by mathijs »

Is there some fixed formula for this one?
I have thought of some sort of formula-building type of solution, but haven't tried to implement it. Is there a simpler way?
LittleJohn
Learning poster
Posts: 83
Joined: Wed Feb 27, 2002 2:00 am
Location: Taiwan

10458 Cricket Ranking

Post by LittleJohn »

I have no idea about this problem.
Can anybody give me a hint?
Thanks in advance.
Andrey Mokhov
Experienced poster
Posts: 128
Joined: Fri Nov 15, 2002 7:45 am
Location: Kyrgyzstan

Use IEP.

Post by Andrey Mokhov »

Hello, LittleJohn!

I've recently solved the problem. I used so-called Inclusion-Exclusion Principle. I guess you can google it :wink:

And the main badness of the problem is that you are to use long arithmetic. Rather dull, I think. :-?

Bye.
Andrey.
sdipu
New poster
Posts: 23
Joined: Sun May 19, 2013 1:50 am

Re: 10458 - Cricket Ranking

Post by sdipu »

There are some problems with End Of File definition in this problem.

I used Java's Scanner to take input. And got many WA just because I did not check for EOF before every time I take a number. So I assume there are some extra numbers or characters after the last dataset in the input file. Although I was promised to get EOF after the last dataset.
Check out UVA Arena - a software build for UVA solvers @ http://dipu-bd.github.io/UVA-Arena/
brianfry713
Guru
Posts: 5947
Joined: Thu Sep 01, 2011 9:09 am
Location: San Jose, CA, USA

Re: 10458 - Cricket Ranking

Post by brianfry713 »

There is always a newline char at the end of the input.
Check input and AC output for thousands of problems on uDebug!
Post Reply

Return to “Volume 104 (10400-10499)”