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

1 | tourist | 3496 |

2 | Um_nik | 3337 |

3 | Petr | 3298 |

4 | W4yneb0t | 3218 |

5 | Radewoosh | 3216 |

6 | OO0OOO00O0OOO0O0…O | 3188 |

7 | Syloviaely | 3168 |

8 | izrak | 3109 |

9 | anta | 3106 |

10 | fateice | 3099 |

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

1 | tourist | 184 |

2 | rng_58 | 170 |

3 | csacademy | 164 |

4 | Petr | 158 |

5 | Swistakk | 154 |

6 | lewin | 149 |

7 | Errichto | 146 |

7 | matthew99 | 146 |

9 | adamant | 141 |

10 | Zlobober | 140 |

↑

↓

Codeforces (c) Copyright 2010-2018 Mike Mirzayanov

The only programming contests Web 2.0 platform

Server time: Feb/25/2018 14:35:48 (d1).

Desktop version, switch to mobile version.

User lists

Name |
---|

the content isn't working now: while opening file this message is found "the archive is either in unknown format or damaged"

Very strange. Anybody has a similar problem?

Yes, me too.

I had that problem too. But when I opened that file with 7zip, it has been opened normally.

reoutloaded

Does anyone know how to solve 3rd problem (C problem) in better complexity than

O(N*sqrt(N))?Consider a set of points (

l,r) on plane such that 0 ≤l≤r≤n- 1 where the point (l,r) corresponds to a segment [l,r].Consider some number

xand all its occurrences. Suppose that the numberxis one of the numbers that make some particular segment [l,r] be bad. Then one of the following situations should happen: either there are from 1 tox- 1 or more thanx+ 1 occurrences ofxin [l,r]. That means that for the fixedlthere are two segments of banned values forr. Actually, for any possiblellying between two consectuviex's, those two banned segments forrwill be the same. It can be reformulated that there areO(c_{x}) banned rectangles on a plane that point (l,r) isn't allowed to be in, wherec_{x}is the number of occurrences ofx.Construct all such rectangles for all numbers

x, there will beO(n) of them in total, and then calculate the number of points that do not lie in any banned rectangle in via sweeping line.Although this solution has better time complexity, there are solutions that work even faster because they do not utilize much memory and use only simple operations.

Code for reference:

solution by me: http://pastebin.com/k0GHWxuQ

solution by Errichto: http://pastebin.com/UXziv4iD

Sorry, just mixed up.

Why it's ?

Isn't there supposed to be an extra line between 26 and 27 which is like line 31?

Ask not me, but Errichto.

But you are good enough to check other's code right?

nah, I'm more about writing comments :)

:)) thanks for not helping :))

.

Can someone explain the solution of problem A Day1?

The download link doesn't work for me, can you share the problem statements somewhere else?

It's in Russian anyway

Oh ok. I thought it was in english since the discussion was in english.

Problem A

GL & HF :)