-

   rss_rss_hh_new

 - e-mail

 

 -

 LiveInternet.ru:
: 17.03.2011
:
:
: 51

:


. 2017

, 23 2017 . 12:06 +

, , .. . , 48 . , .




. , . TopCoder, Marathon24, Deadline24, Google Hash Code . , .


, , , . .


, , , .


! , , . 18 . , , .



C
: : : :
2 256

. , , , , .


n m . k , k , . , k , k , . , , , . . , .



  • n, m k (3 <= n, m <= 50, 3 <= k <= 16) .
  • k rli, cli (0 <= rli <= n-1, 0 <= cli <= m-1) .
  • k rmi, cmi (0 <= rmi <=n-1, 0 <= cmi <= m-1) .
  • , , , .


n m : . , , . . k . . .



:


  • ( , , ), 0 ;
  • , , , , (. );
  • , 160 000 .

50 . . : , , . , .


250 (50 ). .



  • 40% : n, m, k, .
  • 40% : n, m, k, k . , d, d 1 4, .
  • 20% : n, m, k, s , 2s <= min(n, m) k <= 4(s - 1). sxs, k , k .

, .



4 6 3
0 0
1 3
3 0
3 5
2 4
2 2
aaabbc
aaabbc
aaabbc
cccccc


:


  • a: 9, 3 + 3 + 3 + 3 = 12, 0.0625
  • b: 6, 3 + 2 + 3 + 2 = 10, 0.06
  • c: 9, 4 + 6 + 1 + 5 + 3 + 1 = 20, 0.0225

0.048(3), 7733.


5 .




(, 7 )

- . . min-cost max-flow, , .

- . . , . - , . . , . : , .

, . , .

- , .

:
  • , , . , .
  • - . .
  • .

, 2 3, . .

, , .

, . : 2 3, , , . 200 .

:
, VK Cup' . , Russian code cup Distributed code jam, . , .

Eryx (, 2 )

. . , , ( ?). , ( ), , , .

:
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.

(, 6 )

- http://codeforces.com/blog/entry/51858?#comment-358766

, Java. :
  • min-cost-max-flow , .
  • , . , / . / ( + 10).
  • , / ( ).
  • , . : , 1 1,2.

Java C++ (~+150). , , . (, ) -, (. . , , ). simulated annealing , .
Original source: habrahabr.ru (comments, light).

https://habrahabr.ru/post/331482/

:  

: [1] []
 

:
: 

: ( )

:

  URL