ГлавнаяСборникиТурнирыРазделыФорумыУчастникиПечатьПомощьО системе

Форумы > Обсуждение задач > тема:


Задача "Parking Buses"

Идёт турнир!

В настоящий момент идёт турнир. Некоторая информация и функции сервера недоступны до его окончания.

imesecan17.мар.2012 в 14:16:37
0If you search the buses all the time, it will give "Time limit error".
Because it says that 500.000 restrictions and 10.000 buses.

imesecan17.мар.2012 в 15:21:38
1Сообщение скрыто

imesecan17.мар.2012 в 18:45:24
2It's up to your coding.
You can read using normal methods.
This is just an extra info.

imesecan17.мар.2012 в 19:46:34
3Here 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.

imesecan17.мар.2012 в 19:55:24
4Сообщение скрыто

imesecan17.мар.2012 в 20:29:11
5Сообщение скрыто

imesecan17.мар.2012 в 20:30:51
6Сообщение скрыто

imesecan17.мар.2012 в 21:07:13
7Реплика удалена

imesecan17.мар.2012 в 21:43:56
8Реплика удалена

imesecan19.мар.2012 в 14:54:32
9
(6: CLig)
I can send a test but I don't have your email.

imesecan19.мар.2012 в 15:01:03
10
(7: devidduma)
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.

imesecan19.мар.2012 в 15:40:20
11Реплика удалена

imesecan19.мар.2012 в 22:01:47
12Реплика удалена

imesecan21.мар.2012 в 08:27:21
13Our thanks goes to CLig.

He has found a mistake in the question. Now I fixed and re-evaluated your previous submissions.

And congratulations.


www.contester.ru