. 2017 |
, , .. . , 48 . , .
. , . TopCoder, Marathon24, Deadline24, Google Hash Code . , .
, , , . .
, , , .
: | : | : | : |
---|---|---|---|
2 | 256 |
. , , , , .
n m . k , k , . , k , k , . , , , . . , .
n m : . , , . . k . . .
:
50 . . : , , . , .
250 (50 ). .
, .
4 6 3 0 0 1 3 3 0 3 5 2 4 2 2 |
aaabbc aaabbc aaabbc cccccc |
:
0.048(3), 7733.
5 .
- . . min-cost max-flow, , .
- . . , . - , . . , . : , .
, . , .
- , .
:
- , , . , .
- - . .
- .
, 2 3, . .
, , .
, . : 2 3, , , . 200 .
:
, VK Cup' . , Russian code cup Distributed code jam, . , .
. . , , ( ?). , ( ), , , .
:
https://www.mimuw.edu.pl/~erykk/yandex/solution.cpp
, ( ). min-cost max-flow . , , , .
Thanks for the great contest and the very interesting task! It was a pleasure to work on it. The only thing I did not like was a bit unclear
statement of the test case generation (some random distribution but what distribution?), possibly a 'official' test generator could be even included (with no seeds), with the non-trivial part make sure that a solution exists left for us to implement (or solve manually).
The commented version of my solution can be found at:
https://www.mimuw.edu.pl/~erykk/yandex/solution.cpp
I see that I have failed some final tests (the public tests were all okay). I did not get the idea to use min-cost-max-flow to generate paths; I think using this as an alternative approach could help me get positive scores on these few tests, and possibly improve the results on other tests.
- http://codeforces.com/blog/entry/51858?#comment-358766
, Java. :
- min-cost-max-flow , .
- , . , / . / ( + 10).
- , / ( ).
- , . : , 1 1,2.
Java C++ (~+150). , , . (, ) -, (. . , , ). simulated annealing , .