I suppose answer for test AAA is 4. There is no path from 2 to 3 at your picture.
I am sorry. The correct answer is 3, but picture is wrong.
Thanks, I've fixed it.
By the way, I've changed the problem description to allow a change of arcs at every city. Proving the (near-)equivalence of both forms of the problem is an academic exercise that has no business whatsoever in a programming contest. So I guess this change won't make the problem a lot easier .
Do all arc segments of the circles have to point in the same direction? I guess yes, otherwise I think the answer to the first case would be 2:use arcs 1->2, 2->3, 3->1 and 2->1, 3->2, 1->3, every arc segment can be used as a channel.But if the answer to my question is yes, I can't see how to get a result of 5 for the 2nd test case.
Let us call the direct route between adjacent cities a section (of A, B or C type). Given a pair of cities, you can travel between them either clockwise or anticlockwise, but only if the sections you go along are [BC]* in the former case, [BA]* in the latter.
The task is as follows: For every ordered pair of cities (X, Y), construct exactly one travel route (an arc) X->Y provided this is possible, no route if it is impossible. You need to determine the maximum number of routes going along a single section in the solution which minimises this sought value.
Sorry that I have to ask another stupid question:if I understand it correct, for the first test case I have to create an arc between 1 and 2, 1 and 3, 2 and 3, 2 and 1, 3 and 1, 3 and 2, because for every pair there is a path in the original graph.But why then is the 2 circle solution not possible, where I use exactly one segment for each arc (assignment is obvious)?Edit: nevermind, I think I understand what you mean by "travel route". So I can only construct arcs which belong to the original graph, right?
Because you can't go up a waterfall . An 'A' means a section can only be traversed by a boat one-way (anticlockwise).
Przy rozwiązywaniu zadania należy zwrócić uwagę na testy tego typu gdzie najbliższy palindrom znajduje się w następnej godzine.
Np.00:59 -> 01:01
A nie jak nie raz błędnie liczone 00:66 <- raczej nie ma takiej godziny.
To taka mała dygresja 8)
Również nie mam pewności co do poprawności testów. Wiem, że pewnie się mylę, ale też dla wszystkich danych mam dobre wyniki, a spoj nie zalicza. Nawet sobie sprawdzałem odpowiedzi na stronie:tiny.pl/3pzk - nr zadania 11309 i wszystkie odpowiedzi miałem takie same.Tak więc proszę osoby, które to zrobiły o jakąś podpowiedź.
Powiedziałem, że nie mam racji, a to, że powiedziałem też, że mam wątpliwości, co do poprawności testów miało na celu pokazanie mojego zdziwienia, że mi nie akceptuje, bo naprawdę dużo testów zrobiłem i wszystkie były poprawne.
testy są dobre. OK za pierwszym razem 8)
Tak więc wiem, że testy są dobre.
Gratuluję. Ale nie wszyscy są tak mądrzy, jak ty, ale za to uczą się na błędach.
tutaj sprawdzenie poprawności programu jest dość proste -> mamy skończoną ilość przypadków do rozpatrzenia. 24*60 = 1440
@kokosek: a jaką masz koncepcję algorytmu?a tego uczenia się na błędach nie rozumiem.
Przeszukałem te 1440 możliwości i znalazłem błąd - 1 test! No ale warto było.
A co do tego o uczeniu się na swoich błędach, to miałem na myśli, że gdy ktoś mi zwróci na coś uwagę - że coś źle robię, to staram się w przyszłości nie popełniać więcej tych błędów. - Ot cała filozofia. Nic skomplikowanego.
czy wszystkich palindromow jest 79?
jakim sposobem liczyłaś?
rozpisalem wszystkie. miedzy 00:00 a 01:00 jest 15, pozniej od 01:00 do 10:00 jest 6 w kazdej godzinie, od 10 do 16 jest 6, no i pozniej jeszcze od 20 d0 00:00 sa 4. chyba ze cos zle kombinuje.
jest 79
Dla:
00:09
odpowiedź to:
00:11