MVernik's blog

By MVernik, 2 years ago, In English

No words.

Julia, died in Kharkiv during a rocket attack.

  • Silver medal in EGMO (European Girls` Mathematical Olympiad)

Why? Is it fare?

@Julia_123

https://www.facebook.com/mechmatKNU/posts/4882718811784008

https://www.facebook.com/andrn/posts/2988081374837285

https://www.facebook.com/kvantaxyz/posts/4942715709151407

Full text and comments »

Tags war
  • Vote: I like it
  • +1244
  • Vote: I do not like it

By MVernik, history, 3 years ago, In English
Good Morning

Problem

You're given a set of hotel rooms, each room has it's own priority and each room has a client.

You have to minimize the number of repeating clients in the hotel rooms, according to the rules:

  • You can only swap clients with the same priority.
  • You are not allowed to swap rooms.
  • You are not allowed to swap priorities.

Limitations:
0 < Rooms < 1000
0 < Priority < 10^9
'A' < Client < 'Z'

Example


Input:
image
Output:
image


The following example shows:
- in the picture1 — client "B" is repeating.
- in the picture2 — there are no repeating clients.


Thoughts

  1. I converted it to the graph and tried DFS + Multiset, but the complexity was exponential
    image
  2. Tried to create a solution using randomization, but I didn't get to it.
  3. I googled and didn't find similar problems.


Full text and comments »

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

By MVernik, history, 3 years ago, translation, In English

Often I notice in CF posts apology sentences about bad English. I think this time has come!

English Resources

Useful sites, videos, podcasts, books, and other resources for learning English.

Websites and apps for learning English

Useful tools and links

Recommendations from British Council Russia

source: https://www.facebook.com/BritishCouncilRussia/

YouTube

Telegram

Full text and comments »

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

By MVernik, history, 4 years ago, translation, In English

Hi there!

I'm searching for good algorithms for the "Recommendation system". If you have any suggestions about what could be good, please let me know.

Full text and comments »

  • Vote: I like it
  • -17
  • Vote: I do not like it

By MVernik, history, 4 years ago, In English

Confused...


Back-end part: int[][] matrix = new int[n][m]; int[] array = new int[n*m]; traversMatrix(matrix); traversArray(array); Client part: function traversMatrix(matrix : int[][]) for (i..n) for (j..m) doActions(); function traversArray(array : int[]) for (i..array.size()) doActions(); =================================== Time Complexity for traversMatrix: Quadratic Time Complexity for traversArray : Linear? Why?

Full text and comments »

  • Vote: I like it
  • 0
  • Vote: I do not like it

By MVernik, history, 4 years ago, In English

Hello, the community!

  • I and my friend decided to create a channel where we post real code from production and show people where algorithmic code used in real life.

  • Actually we'd be thrilled to see you here

Code Snippets

Full text and comments »

  • Vote: I like it
  • 0
  • Vote: I do not like it