imesecan | Mar.17.2012 at 02:16:37 PM | |
0 | If you search the buses all the time, it will give "Time limit error". Because it says that 500.000 restrictions and 10.000 buses.
|
imesecan | Mar.17.2012 at 03:21:38 PM
|
1 | Сообщение скрыто
|
imesecan | Mar.17.2012 at 06:45:24 PM | |
2 | It's up to your coding. You can read using normal methods. This is just an extra info.
|
imesecan | Mar.17.2012 at 07:46:34 PM | |
3 | Here in this question, we have buses from 1 to n. Then, putting them in order is easy. Because every number (bus) appears once.
Such sorting is called bucket sort.
When getting bus orders, we can directly assign that bus position to its bucket.
Later, when asking for the position of that bus just go into its bucket and take the position and compare the positions.
if the position of the first bus is smaller than the second one, then this is OK. Otherwise increment the wrong number counter.
|
imesecan | Mar.17.2012 at 07:55:24 PM
|
4 | Сообщение скрыто
|
imesecan | Mar.17.2012 at 08:29:11 PM
|
5 | Сообщение скрыто
|
imesecan | Mar.17.2012 at 08:30:51 PM
|
6 | Сообщение скрыто
|
imesecan | Mar.17.2012 at 09:07:13 PM | |
7 | Post is deleted
|
imesecan | Mar.17.2012 at 09:43:56 PM | |
8 | Post is deleted
|
imesecan | Mar.19.2012 at 02:54:32 PM | |
9 | I can send a test but I don't have your email.
|
imesecan | Mar.19.2012 at 03:01:03 PM | |
10 | Your program doesn't give error on the second and third input sets because their result is 0 (in a way which is easy to be produced).
In this question, you are asked to find out how many of the restrictions are not satisfied. Thus, when checking you need to know the current bus order. Your program reads the bus order while checking.
This is not acceptable. Because you cannot know the which bus is the first and which is last.
You must first read all the input, then start processing.
|
imesecan | Mar.19.2012 at 03:40:20 PM | |
11 | Post is deleted
|
imesecan | Mar.19.2012 at 10:01:47 PM | |
12 | Post is deleted
|
imesecan | Mar.21.2012 at 08:27:21 AM | |
13 | Our thanks goes to CLig.
He has found a mistake in the question. Now I fixed and re-evaluated your previous submissions.
And congratulations.
|