### LashaBukhnikashvili's blog

By LashaBukhnikashvili, 8 years ago,

Hi to everybody....

Today will be another round of COCI.

Those wishing to participate can enter/register here.

To LogIn choose COCI 2012/2013 — Contest #3.

Good luck to all in advance...

UPD: Here are results.

• +29

 » 8 years ago, # |   +2 How solve problem D (AERODROM) ???
•  » » 8 years ago, # ^ | ← Rev. 2 →   +5 you can view my O(N*T) solution where T=LOG(10^18) I use binary search for finding answer of 1-10^18 interval (10^18 max ans size in my opinion :D) I think this is correct,I will know in a few minutesUPD: This is correct.
•  » » 8 years ago, # ^ |   +2 It isn't hard. Binary search in answer. I suppose you can easy understand my code: Aerodrom
•  » » 8 years ago, # ^ |   +1 For M<300 000 I hope priority_queue (keeping in it Tk*how_many_people_occupy_it) solution works.
•  » » » 8 years ago, # ^ |   0 I had this solution also,
 » 8 years ago, # | ← Rev. 2 →   +1 Individual results update!UPD: My score is 350(50+80+100+120)
 » 8 years ago, # | ← Rev. 2 →   +1 Is problem F(PROCESOR) a graph problem?I'm sorry if this question is really stupid :(
•  » » 8 years ago, # ^ |   +17 Yes, it is 2-SAT problem. But memory limit is realy stupid.
•  » » » 8 years ago, # ^ | ← Rev. 2 →   +1 Can you explain more why problem F is 2-SAT problem? Thanks
•  » » » 8 years ago, # ^ |   +8 Why is it 2-SAT? You have a graph (32*N vertices) with edges which demand either different numbers on endpoints or the same. You can just DFS/BFS it to enumerate each connected component and since each component can be easily inverted — you can take the most significant vertice and assign 0 to it at the start of DFS/BFS.The only challenging point is to get it into memory limit.
•  » » » » 8 years ago, # ^ |   +1 And you can get into memory limit by making 2 optimizations: While you have 32*E edges, don't store 32*E edges, store just E, which I will call multiedge. Since every multiedge generates exactly one edge for each vertice in the given register, we can decode it while doing DFS/BFS. Use BFS, since it haven't got any overhead from recursion. Hence you only need 2 3.2M element arrays — one of char for storing assign bits (and simultaneously checking if we have been in that vertice) and one of int for the BFS queue.
•  » » » » » 8 years ago, # ^ |   0 We can use non-recursive DFS as well.
•  » » » » » » 8 years ago, # ^ | ← Rev. 2 →   +1 But why? BFS is meant to be non-recursive, while in DFS you would have to store a lot more information about each vertice to be able to emulate recursion. So it might not pass in ML either, or I am missing something.
•  » » » » » » » 8 years ago, # ^ |   0 I don't understand. Can't we just change queue to stack?
•  » » » » » » » » 8 years ago, # ^ |   0 Yeah, but you still need more information, like the pointer of what neighbor of that vertice we are currently analyzing.
•  » » » » » » » » » 8 years ago, # ^ |   -8 Why? I always wrote non-recursive BFS and DFS with the only difference of queue and stack. Or do you mean some specifics of your solution for this problem?
•  » » 8 years ago, # ^ |   0 Yes, you can use a modified Union-Find.
 » 8 years ago, # | ← Rev. 2 →   0 I had a bug in task 6 , when I finded it, the cotest ended :( This is my corrected code.UPD: my score is 453
•  » » 8 years ago, # ^ | ← Rev. 2 →   +3 You still have 64 points — you got MLE.Sorry, I don't mean to be rude, but your comment easily suggests that you claim that you have full solution to 6th task.
•  » » » 8 years ago, # ^ |   0 thanks, everything is ok :D
 » 8 years ago, # |   0 My score is 490(50+80+100+120+140+0). I couldn't find any solution on the last problem T.T
 » 8 years ago, # |   +9 Weak tests in problem AERODROM My solution fails test: 30 1000 1 1 1 1 ... 1 1 1 but passes systests. Have anybody the same bug?
•  » » 8 years ago, # ^ |   0 Not only that — shouldn't you have long long overflow in this case? 100000 whatever 1 1 1 ... 1 1 1 
•  » » » 8 years ago, # ^ |   0 Yes, and in my test I have overflow too.
•  » » » » 8 years ago, # ^ |   0 Well, luck is on your side then. :) Maybe they haven't thought of this specific error, while generating the test, although I thought that this could be the place where many could fail. But as it depends on binary search values, and from a quick look you have a little bit different binary search from what I usually see people writing (either not changing middle value at all when assigning it, or changing but only in one case, not in both), maybe you got away with this for that reason.
•  » » 8 years ago, # ^ |   +3 My solution is similar to your, but I set the bound to 2e18, and it fails on systests (105/120). Our solutions have the same bug, but I have less points than you have. It seems strange.
•  » » » 8 years ago, # ^ |   +5 I'm lucky today. I think it's impossible to catch all bugs using 8 tests.
•  » » 8 years ago, # ^ | ← Rev. 3 →   +9 Imho, it's very bad idea to test solutions on less than 10 test cases (for example, today's task "malcolm" has only 5 tests)... Then I see so few tests, I remember informatics olympiads in my school, where we always have 5 tests, and almost everything passes them ;)PS and, ofc, I have the same bug as tunyash in aerodrom, but my solution gets full score...wtf
•  » » » 8 years ago, # ^ | ← Rev. 2 →   +5 I wonder will they add some extra tests, as they don't display general results immediately ?
 » 8 years ago, # |   -8 Why am I getting "SIGABRT" while I am not using any assert method out there?
•  » » 8 years ago, # ^ |   +3 It seems that it is Memory Limit Exceeded.
•  » » » 8 years ago, # ^ |   -8 Then why? Isn't HERKABE supposed to be solved using trie? so keeping 3000 int-s and err... up to 3000*3000 nodes (which consists of two int-s one vector).
•  » » » » 8 years ago, # ^ |   0 I also submitted a solution with trie, but got lots of MLE. In the end you can do it by sorting the strings, and counting recursively, simulating you've got a trie.
•  » » » » » 8 years ago, # ^ | ← Rev. 3 →   0 I solved that by sorting the strings, but I don't know why it works in time. I just used strcmp to sort. Here's the codeIs just STL sort is fast to sort strings?
•  » » » » » » 8 years ago, # ^ |   -6 Does this solution passed from all the test cases? It seems wrong at the following: 6 aa aa ab ab a aThe correct answer should be 12 while this program outputs 6. I also used same technique as you, it seems that each function GetResult with unique parameter set corresponds to each node of the trie with which participants tried to solve this problem with. Therefore, our solutions seem to be base on creating this trie implicitly. :)
•  » » » » » » » 8 years ago, # ^ |   +14 "The names are distinct and given in no particular order."So, that test case isn't valid. :)
 » 8 years ago, # |   +6 32MB is a ridiculously small memory limit...
 » 8 years ago, # |   +3 This is the first time I participated to COCI, so I want to know when they usually publish results.
•  » » 8 years ago, # ^ |   0 A few days after the contest but no more than a week.
 » 8 years ago, # |   +11
•  » » 8 years ago, # ^ |   +5 As i thought, when I saw the problems after the contest — many guys with maximum score.
 » 8 years ago, # |   0 is there any way to log in there now?
•  » » 8 years ago, # ^ |   +1 Yes, you can use this link.
 » 8 years ago, # |   0 when is the next round of this contest ?
•  » » 8 years ago, # ^ |   +3