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????
10458 - Cricket Ranking
Moderator: Board moderators
-
- Learning poster
- Posts: 94
- Joined: Sat Oct 05, 2002 5:34 pm
- Location: CS - AIUB, Dhaka, Bangladesh.
- Contact:
10458 - Cricket Ranking
Sajid Online: www.sajidonline.com
-
- Learning poster
- Posts: 83
- Joined: Wed Feb 27, 2002 2:00 am
- Location: Taiwan
10458 Cricket Ranking
I have no idea about this problem.
Can anybody give me a hint?
Thanks in advance.
Can anybody give me a hint?
Thanks in advance.
-
- Experienced poster
- Posts: 128
- Joined: Fri Nov 15, 2002 7:45 am
- Location: Kyrgyzstan
Use IEP.
Hello, LittleJohn!
I've recently solved the problem. I used so-called Inclusion-Exclusion Principle. I guess you can google it
And the main badness of the problem is that you are to use long arithmetic. Rather dull, I think.
Bye.
Andrey.
I've recently solved the problem. I used so-called Inclusion-Exclusion Principle. I guess you can google it
![:wink:](./images/smilies/icon_wink.gif)
And the main badness of the problem is that you are to use long arithmetic. Rather dull, I think.
![:-?](./images/smilies/icon_confused.gif)
Bye.
Andrey.
Re: 10458 - Cricket Ranking
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.
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/
-
- Guru
- Posts: 5947
- Joined: Thu Sep 01, 2011 9:09 am
- Location: San Jose, CA, USA
Re: 10458 - Cricket Ranking
There is always a newline char at the end of the input.
Check input and AC output for thousands of problems on uDebug!