Tutorial is loading...

Tutorial is loading...

Tutorial is loading...

Tutorial is loading...

Tutorial is loading...

Tutorial is loading...

# | User | Rating |
---|---|---|

1 | tourist | 3624 |

2 | Um_nik | 3468 |

3 | wxhtxdy | 3329 |

4 | V--o_o--V | 3309 |

5 | Petr | 3297 |

6 | mnbvmar | 3255 |

7 | LHiC | 3250 |

8 | TLE | 3186 |

9 | Vn_nV | 3182 |

10 | dotorya | 3165 |

# | User | Contrib. |
---|---|---|

1 | Radewoosh | 195 |

2 | Errichto | 181 |

3 | neal | 159 |

4 | Ashishgup | 157 |

4 | PikMike | 157 |

6 | Petr | 156 |

7 | majk | 154 |

7 | rng_58 | 154 |

9 | Um_nik | 153 |

10 | Vovuh | 152 |

Tutorial is loading...

Tutorial is loading...

Tutorial is loading...

Tutorial is loading...

Tutorial is loading...

Tutorial is loading...

Tutorial of Educational Codeforces Round 19

↑

↓

Codeforces (c) Copyright 2010-2019 Mike Mirzayanov

The only programming contests Web 2.0 platform

Server time: Feb/22/2019 16:28:27 (d1).

Desktop version, switch to mobile version.

Supported by

User lists

Name |
---|

Can't understand C's explanation.

Alternately F can be solved with Divide and Conquer Optimisation as well.

I seem to get TLE with Divide and Conquer Optimization , was any pruning required to pass the time limit ?

It's Complexity O(n^2logn)?

Problem E can also be solved offline with an O(n) memory complexity, by sorting the queries w.r.t k and solving all queries with the same k together using dynamic programming.

Intuitions about the time complexity:I don't know exactly how to calculate a generalized upper bound for the time complexity, but I had the intuition that it would fit in time using this approach

Implementation:26497630(1/2 + 1/3 + 1/4 + ... + 1/n) = O(logn)

Oh yes you're right, it's logn. I got confused about it. Thanks.

dropped

Note, it's order.

Hint for proof:

I didn't learn integrals in school yet. But I could see that your formula is not correct:

Seems that functions are crossing and lying nearby but not equal.

click

Actually, it's not . And you can see that the difference between (a.k.a harmonic number) and go smaller as n go bigger. It will eventually equal 0 when n big enough. Furthermore, is smaller than and as we can ignore constant, we can say it's O(logn)

Thank you, I thought

`log`

always means`log2`

in informatics, not`ln`

.But the time is worse than using sqrt precalculation..

Look, if all k will be different your code will make this Q times:

`memset(dp, -1, sizeof(dp));`

It is optimized of course but making your complexity bigger.Sorry for necropost, but in this case your solution works in

`O(n sqrt(n))`

time:Because your solution takes

O(n) operations per one block, but this isO(n) memory, u are righthi excuse me but if all queries have different k's then you say if (k != prev) {memset(dp, -1, sizeof(dp));} so you basically fill the dp with -1's in every query but isn't this O(n^2)? could you explain why you don't get TLE? thanks ,and sorry to bothering you :D

can anyone please explain Problem c editorial

I understand that this contest is quite old but 797C - Minimal string has a typo and says "lexigraphically" instead of "lexicographically". I'm not sure if this is correct way to report typos but don't see any other.

Fixed, thanks.

Help me please, I don't know what is wrong with my code I am getting the wrong answer for test-case 17 of the question Minimal String (question C), here is my solution link. https://ideone.com/mc0zjt

can you give me some test cases I am getting WA at test 21?

In Problem C's solution, instead of — 'any letter left in string s' in

"Pop letters from the top of stack and push them to answer while they are less or equal than any letter left in string s."

It should be --- 'while they are less or equal than all the letters left in string s'.

Can anyone give me a DP solution for Problem B? Why is this approach wrong?

Here is the DP solution in case you need it still.

http://codeforces.com/contest/797/submission/41646680

Someone help me please getting the wrong answer. what is wrong with my code? here is my ideone link to my code https://ideone.com/mc0zjt

Can anyone tell me where am I wrong in this code. It is giving wrong answer for an input. I am not getting why my code is giving wrong output for that input. Printing o before n. http://codeforces.com/contest/797/submission/33380771

Why i am getting WA on test Case 16 in problem no C? Here is my submission 35083720.Anyone please help.

can you give me some test cases I am getting WA at test 21?

can anyone can give me some test cases on the question C I am getting WA at test 21?

test this maybe it would help :D

input: czzbaz output should be: abzzcz

Wow dude, thanks for that test case. I was forgetting like half the problem. Thanks.