I am trying to solve this problem: NEKAMELEONI I have read the tutorial but I can not understand what it says. Can anyone tell me more about this interesting problem? Thank in advance!
№ | Пользователь | Рейтинг |
---|---|---|
1 | tourist | 3993 |
2 | jiangly | 3743 |
3 | orzdevinwang | 3707 |
4 | Radewoosh | 3627 |
5 | jqdai0815 | 3620 |
6 | Benq | 3564 |
7 | Kevin114514 | 3443 |
8 | ksun48 | 3434 |
9 | Rewinding | 3397 |
10 | Um_nik | 3396 |
Страны | Города | Организации | Всё → |
№ | Пользователь | Вклад |
---|---|---|
1 | cry | 167 |
2 | Um_nik | 163 |
3 | maomao90 | 162 |
3 | atcoder_official | 162 |
5 | adamant | 159 |
6 | -is-this-fft- | 158 |
7 | awoo | 155 |
8 | TheScrasse | 154 |
9 | Dominater069 | 153 |
10 | nor | 152 |
I am trying to solve this problem: NEKAMELEONI I have read the tutorial but I can not understand what it says. Can anyone tell me more about this interesting problem? Thank in advance!
Название |
---|
You are given an array with N integers ar ( for all i (1<=i<=N) 1<=ar[i]<=K ) and you have M task in each task you are given a x number . if x is 1 you are given 2 more numbers a and b it means you must change ar[a] into b if x is 2 you must find a subarray that contains all [1,K] numbers and it must be the shortest contiguous subarray and you must print its length if there is no subarray that contains all [1,K] numbers you must print "-1" (that is what i understand on the problem , it can be wrong) (sorry for bad english)
How can we solve this problem? I have read tutorial but I can not understand the way we solve this. Could you tell me how to solve this one? You can find the tutorial here : Tutorial
segment tree :D but this problem is not easy :D I think the merge function is hard . (I know the solution but It's really hard for me to explain it) how ever I think if you learn segment tree and then you take a look at Petr code , you will understand the solution
Could you give me Petr's code? I know Segment tree, but I can not understand how can I merge, the solution seems very difficult for me to understand.
oh , sorry . I saw your comment now
here is the code : http://hsin.hr/coci/solutions/PetrM/contest3_nkamel.cpp
You have solution on this site https://www.hsin.hr/coci/
I read that solution but I can not understand. Could you give me any hints to solve this problem?