2

Regarding the time complexity of ABC 277 Ladder Takahashi

 1 year ago
source link: http://codeforces.com/blog/entry/109097
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.

Regarding the time complexity of ABC 277 Ladder Takahashi

By qotpwns123, history, 101 minute(s) ago,

Good evening all,

I am reaching out, as I had some questions about the editorial for ABC 277 problem C. The editorial for ABC 277 C — Ladder Takahashi states that the time complexity for the aforementioned problem is O(N * log (N)).

  1. Where is this logarithmic factor coming from ? Is this from the set and map data structures which take logarithmic time for insertion and search operation ?
  2. Would the time complexity reduce to O(N) on average if we were to use an unordered_map or unordered_set ?

About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK