Блог пользователя Alex_2oo8

Автор Alex_2oo8, история, 9 лет назад, По-английски

New Year Greetings to the CodeForces Community!

Start off 2018 with some stimulating coding challenges as part of the January Long Challenge from CodeChef. I hope they will give you a pleasant beginning to your coding campaign this year. Joining me on the problem setting panel, we have:

I hope you will enjoy solving the problems. Please give your feedback on the problem set in the comments below after the contest.

Contest Details:

Time: 5th January 2018 (1500 hrs) to 15th January 2018 (1500 hrs). (Indian Standard Time — +5:30 GMT) — Check your timezone.

Details: https://www.codechef.com/JAN18

Registration: You just need to have a CodeChef handle to participate. For all those, who are interested and do not have a CodeChef handle, are requested to register in order to participate.

Prizes: Top 10 global and top 20 Indian winners get 300 Laddus each, with which the winners can claim cool CodeChef goodies. Know more here: https://www.codechef.com/laddu. For those who have not yet got their previous winning, please send an email to [email protected].

Good Luck! Hope to see you participating!

  • Проголосовать: нравится
  • +52
  • Проголосовать: не нравится

»
9 лет назад, скрыть # |
 
Проголосовать: нравится 0 Проголосовать: не нравится

Is there some kind of registration at this moment?

»
9 лет назад, скрыть # |
 
Проголосовать: нравится +20 Проголосовать: не нравится

Lets discuss the approaches for the harder questions of the contest.

  1. KILLING MONSTER : Is it parallel binary search + updates using square root n dp.Complexity=N*sqrt(N)*log(N)

  2. KILLJEE KTH LETTER: I think only approach (suffix array/suffix tree)+binary search.

  3. HUMONGUOUS QUERY: I hardly got my meet in the middle fit in TL.so to solve x1*x2+y1*y2=c . I tried going over all x1,x2<=1900 and the checked y1 and y2 by preprocessing the factors till 10^6.Any better ways.??

  4. SQUARE ROOT GOOD: Is it to implement some paper or are there any elegant solutions.

I would like to hear if there are some easy/better solutions for 1 and 3. Also good approaches for approximate problem is invited.

»
9 лет назад, скрыть # |
 
Проголосовать: нравится 0 Проголосовать: не нравится

Can anybody give derivation/reasoning on how to calculate X (number of humongous strings) in "HUMONGUOUS QUERY" . I spent 2 days in derivation and came up with, like ten wrong formulas before I gave up the question for good. The meet in the middle was quite apparent, but calculating X was what hindered me. Any help will be appreciated, thanks! :)

  • »
    »
    9 лет назад, скрыть # ^ |
     
    Проголосовать: нравится 0 Проголосовать: не нравится

    Well , This was how I calculated X

    int zero = 0 , one = 0 ;
    int z = (int) str.size() ;
    for (int j=z-1;j>=0;j--)
    {
    	if (str[j] == '0')
    	{
    		zero += (1 + one) ;
    	}else
    	{
    		one += zero ;
    	}
    }
    
    

    The value of X = one .

  • »
    »
    9 лет назад, скрыть # ^ |
     
    Проголосовать: нравится +6 Проголосовать: не нравится

    X=(A+1)*(C+1)-1 + B*D.
    A=10/1010 type in left string.
    B=1/101 type in left string.
    C=10/1010 type in right string.
    D=0/010 type in right string.

    For each type A seq, we can join it to a type C seq. We add +1 to each of these values to account for empty seq and subtract -1 finally to account for taking empty seq from both sides.

    For each B seq, we must combine it with some type D seq. So this contributes B*D sequences.

»
9 лет назад, скрыть # |
 
Проголосовать: нравится +57 Проголосовать: не нравится

The last problem is almost a subproblem of my problem Project Euler #193 on Hackerrank

»
9 лет назад, скрыть # |
← Rev. 2  
Проголосовать: нравится +4 Проголосовать: не нравится

Can someone explain his solution for Humongous Query using Meet in the Middle.

Thank you in advance.

»
9 лет назад, скрыть # |
 
Проголосовать: нравится 0 Проголосовать: не нравится

For the 4th problem, what is wrong with my greedy solution?

Link

»
9 лет назад, скрыть # |
 
Проголосовать: нравится 0 Проголосовать: не нравится

When can we expect the official editorials of all problems?

»
9 лет назад, скрыть # |
 
Проголосовать: нравится +3 Проголосовать: не нравится

Can we solve "Killing monsters" using Tries?

  • »
    »
    9 лет назад, скрыть # ^ |
     
    Проголосовать: нравится 0 Проголосовать: не нравится

    i don't think that ,it is can be solved with trie. There are 2^18 queries ,it is a one problem ,and also trie it is not good to this problem,because you don't uses prefixes.Trie is good for strings. I didn't solved this problem.I will solve after school's exams.

»
9 лет назад, скрыть # |
 
Проголосовать: нравится +1 Проголосовать: не нравится

Why my rating changed while it shows that I didn't participated? It considered me as last of contest :(

»
9 лет назад, скрыть # |
 
Проголосовать: нравится +5 Проголосовать: не нравится

Can someone explain the sqrt decomposition + sos dp approach for the MONSTER problem in details.

»
9 лет назад, скрыть # |
 
Проголосовать: нравится 0 Проголосовать: не нравится

I have a doubt regarding the time complexity of 'MONSTERS' using sqrt- decomposition + SOS DP approch. This is a accepted solution.

If we look at the last for loop, we are comparing all the queries in the current block with all the values of h[i]. We are doing for all the blocks.

So, shouldn't the time complexity of the solution be "number of blocks" * "size of each block" * n. In that case, wouldn't the time complexity be n *q ?

What am I missing?