Codeforces and Polygon may be unavailable from December 6, 19:00 (UTC) to December 6, 21:00 (UTC) due to technical maintenance. ×

govind53's blog

By govind53, history, 5 months ago, In English

Need help with figuring out best possible solution for this problem: There are two strings of same length representing numbers, we can swap the elements at corresponding index in both strings. There exist some integer k such that k swaps results in strings with minimum absolute difference. Task is to find k. Example of one of possible swap: s = "123" and t = "456" -> swap at index 0 makes s = "423" and t = "156" -> abs diff is 267 a possible solution is using back tracking but there should be better solution for this.

A follow-up question, given some k we want to find minimum possible absolute difference after k swaps.

Full text and comments »

  • Vote: I like it
  • +1
  • Vote: I do not like it

By govind53, history, 6 months ago, In English

There is a network graph given, in which we need to remove few edges to form at the most k connected components. Resulting graph should have minimum possible bandwidth (by bandwidth we mean maximum number of data packets which can pass through the graph). We need to identify the minimum bandwidth possible. Can someone please suggest possible approach to solve this problem?

Full text and comments »

  • Vote: I like it
  • +1
  • Vote: I do not like it