18

Codeforces Round #757 (Div. 2) Editorial

 3 years ago
source link: http://codeforces.com/blog/entry/97283
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.
neoserver,ios ssh client

By 4qqqq, 8 hours ago,

5 hours ago, # |

Is the dynamic programming approach used in D1 a known concept?

  • 5 hours ago, # ^ |

    I'm not sure what you mean by "known" here, but the idea isn't too insanely extraordinary, at least for D1.

5 hours ago, # |

Why is the runtime for D2 log(log(n))? Does does the average number between 1 and n have about log(log(n)) unique prime factors or something? Why is that?

4 hours ago, # |

Imagine statements were this short

4 hours ago, # |

Here's an solution for E (with query time). For a given sequence of temperatures, let be the answer for the query . Then we have for different values of , and for all other values of . (I won't prove this, but you can try it out for yourself.) We solely have a data structure that stores the values of for which . On receiving , we add and to the data structure, where .

Answering a query reduces to determining how many stored values are below . I used a PBDS and binary searched to handle insertions which means the complexity is actually but in principle this can be made into .

Implementation: https://codeforces.com/contest/1614/submission/137071970

24 minutes ago, # |

For the second question, my approach seems to be

23 minutes ago, # |

Rev. 2  

+2

is the amount of .

Really? I think is the amount of such that .

20 minutes ago, # |

That feeling when you wasted 4 attempts on problem C because of wrong modulo :’)


About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK