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

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

Hello Codeforces,

Manthan, Codefest'18 will take place on Sep/02/2018 17:35 (Moscow time) with a duration of 2 hours (tentative). The round is rated for both Div1 and Div2 participants and will consist of 8 problems.

The Department of Computer Science and Engineering, IIT (BHU) is conducting Codefest from 31st August-2nd September. Manthan (मंथन in Hindi, meaning Brainstorming), the algorithmic programming contest under the banner of Codefest, is being held as a special Codeforces round. The round follows regular Codeforces rules.

The round has been prepared by hitman623, karansiwach360, GT_18, Ezio07, Enigma27, csgocsgo and me (dhirajfx3). Special thanks to TooDumbToWin and DeshiBasara for their contribution in the preparation of the round.

We express our heartiest thanks to KAN, vintage_Vlad_Makeev, 300iq, isaf27 and cdkrot for their help in preparing the contest and MikeMirzayanov for the awesome Codeforces and Polygon platforms!

Prizes

Overall 1st place: INR 25000, Overall 2nd place: INR 18000, Overall 3rd place: INR 12000

1st place in India: INR 10,000

1st place in IIT(BHU) Varanasi: INR 4,000 1st place in freshman/sophomore year, IIT(BHU) Varanasi: INR 1,000

About Codefest: Codefest is the annual coding festival of the Department of Computer Science and Engineering, IIT (BHU) Varanasi, which is held online and is open to participation by all! Register on the Codefest website now! Total prizes worth ₹500,000/- up for grabs with events covering domains from Math, Machine Learning, Natural Language Processing and Capture The Flag style competitions. Go to the Codefest website to find out more!

As usual, the scoring distribution will be announced just before the round.

UPD1: Scoring 500-750-1000-1500-2250-3000-3500-4000

UPD2: Following are the winners of the contest

1. tourist

2. DearMargaret

3. LHiC

Best in India

amit_swami

Good luck and have fun!

UPD3: Link to editorial

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

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

The best part of Codefest <3...

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

I hope it will be easier than last year

Last year problem B was a DP :((

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

I hope for better problems and better statements than the last year's contest.

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

Here it comes 2-SAT on splay trees of 3D persistent segment trees of dynamic convex hulls tasks.

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

National day of vietnam <3

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

Is there a place in the CodeForces website, showing your division? I know division boundaries don't change frequently, but it would be nice to see.

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

Email says that duration is 2.5 hours but here I see 2

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

I hope for more problems that can be solved by the amazing SSE/AVX algorithm.

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

Manthan in hindi is " मन + थन " which means " mind + boobs ".

So, I guess it means boobs on my mind :P

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

Is it rated for division 3?

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

So is it 2 or 2.5 hours finally?

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

It's my first Manthan,hope to become blue!

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

Can anyone tell what मंथन (manthan) actually means in Hindi? My Hindi is too bad...

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

Hope the problem statement will be too much interesting and funny. :)

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

I didn't see 4000 problem before this round.

»
8 лет назад, скрыть # |
Rev. 2  
Проголосовать: нравится -36 Проголосовать: не нравится

.

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

For Problem D, what should be the output for following input:-
4
1 2
1 3
2 4
4 2 1 3

Should it be "Yes" because as stated in announcement, a[1] is not necessarily 1?

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

 4 problems under 10 mins, who said 2 hours isn't enough for 8 problems???

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

Hack for D?

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

How to solve E?

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

Pretest 4 for D ?

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

Can someone please tell me what is wrong with this solution: 42389932

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

I'm trying to submit now, but it redirects me to this blog. Why?

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

https://pastebin.com/71wMF7nP Could someone help me figure out what's wrong> failing pretest 4.

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

Can anyone help why does this code give R.E on CF? For Problem E.

Works fine on Local Compiler as well as Ideone.

https://ideone.com/B8dFH9

[Resolved]. I was iterating and deleting the set simultaneously.

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

Great problem statements! No fluff and extreme clarity.

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

How to solve F?

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

    The problem is equivalent to counting for every vi = 1 + i * (k - 1) the sum .

    Assume that with two equal numbers, the one with higher index is larger.

    To solve this, find for every i the values prev[i] and next[i], where prev[i] is the minimum index i such that maximum value in [prev[i], i] = val[i], and next[i] the maximum index such that the maximum value in [i, next[i]] = val[i]. Now:

    Let cou[i] =  the number of intervals [a, b] such that len([a, b]) = vj for some j and prev[i] ≤ a ≤ i ≤ b ≤ next[i]. We can calculate this with inclusion-exclusion: let count(len) be the number of intervals [a, b] such that len([a, b]) = vj for some j, and 1 ≤ a ≤ b ≤ len. Now cou[i] = count(next[i] - prev[i] + 1) - count(i - prev[i]) - count(next[i] - i).

    The answer is .

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

I tried to hack someone but I got "generator crashed". Can someone tell me what that means?

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

my D will fail because I forgot about that a[0] condition :(

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

What's intended solution for H? My O(n log2 n) solution got TLE on test 10. :(

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

    Could you please share your idea with me? I tried to solve it with Suffix Automaton and Link-cut Trees but didn't manage to finish debugging in time.

  • »
    »
    8 лет назад, скрыть # ^ |
    Rev. 3  
    Проголосовать: нравится +23 Проголосовать: не нравится

    I can suggest the following solution:

    Build suffix automaton for string s. Append symbols to s one by one and answer queries whenever we reach their right border r. To answer the query with string x: feed symbols of x to automaton one by one and iterate over the next (bigger than current in x) symbol. Now we need to check is last occurrence so far of suffix of particular length of current state of automaton  ≥ l. It could be done in the following way: consider the tree of suffix links of automaton, call it T. Then you append new symbol to s, update biggest right border for the state corresponding to the current prefix of s (we must also update right borders for all suffix links of that state, but lets don't do that and ask queries for maximum in subtree of T instead).

    This is in a way I implemented it during the contest (and had wa2 due to some typos). I think it should pass (you will make much less queries than n·A).

    UPD: it passed in 405 ms 42402008

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

Username russianpig get hacked 6 times in a duration of 13 minutes, which sound suspicious to me.

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

How to solve... A?

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

((Sorry for my bad english ㅠ~ㅠ I'm not englisher)) I have two question. 1. I didn't lock during Round. than I can't hack?

  1. What is ?? at page [Standing]? ( http://codeforces.me/contest/1037/standings )

  2. i solve A and B during Round and failed C. than what is in [problems]? ( http://codeforces.me/contest/1037 ) I am now A red-B none-C red

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

I was wondering why I did well this contest, and then I realized that most of the really good people are at IOI right now.

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

whats wrong with my solution for problem D? I check distances from vertex 1 to a[i] it gives wa4. Who can help? Thanks in advance.

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

In problem D, can the answer be YES if a[1] is not 1 ?

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

can you please tell me what mistake i am making http://codeforces.me/contest/1037/submission/42395202 i am getting WA on test 11.

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

For problem D is it sufficient to check if for the given order, the levels are increasing and the parent indices are increasing?

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

Aside from D's pretests, this year's problemset is much better compared to the last year.

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

Easy solution for D: for each vertex sort the neighbour list by the order they appear in the given sequence.

Then perform a standard BFS from node 1 on the tree and check if your BFS sequence is equal to the sequence in the input.

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

I was using binary search without sorting the vectors in D...corrected the bug in last 10 seconds,,,couldn't submit it...The world doesn't want to see me purple :(

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

There should be auto refresh of problem statement whenever it is updated.

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

First time I managed to solve 4 problems, feels amazing :D

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

Today I encountered an extremely strange behavior of std::stack. I managed to fail today's F problem because of the vector of stacks (42392892). What is strange: I've got an MLE verdict. After the contest I changed the vector of stacks to the vector of vectors and got AC with 20 MB (42402332). Does anyone know what's wrong. Don't I know something about std::stack? Why does it consume so much memory. Or maybe it's just stupid me and I don't know how to use it?

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

Any hint for my solution 42402189 of problem D ? I got Wrong Answer on testcase 11 .UPD: Accepted

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

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

Who is DearMargaret? LGM in 8 contests. Seems like a fake account, but I wonder whose.

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

it was a good contest,i could have become candidate master today if i had solved D more fastly

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

Seems like there are three groups of problems in this contest. [A-D], [E,F], and [G,H]

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

1 2 1 5 2 3 2 4 5 6 1 5 2 3 4 6

How is this not a BFS Traversal of the given tree?

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

    You start at 1, visit the neighbors 5 and 2 and put them in the queue. Then you are at node 5, visit the neighbor 6 and put it in the queue -> Error

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

    Following the BFS,

    • You arrived at 1
    • You push 1's neighbors into the queue using your order
    • Queue is now 5 2
    • You pop queue's head and thus arrive at 5
    • You push 5's neighbors into the queue
    • Queue is now 2 6
    • This means that after processing 2, you will definitely have to process 6, while your sample order says 3.
»
8 лет назад, скрыть # |
 
Проголосовать: нравится 0 Проголосовать: не нравится

I solved D by comparing the precedence of parents of ai and ai + 1.

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

Got TLE in F because cin ( even with sync_with_stdio ) I'll never use cin again in my life.

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

Problem D. a [1] must be equal to 1. I missed it( I'm crying (

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

D problem : Don't know why it is giving wrong answer on 11th test case. My idea is I will keep on matching parent of an array element with front element and when all children of front element get finished I will pop first element of queue and start the whole process with new first element. Someone please look into it. My submission : http://codeforces.me/contest/1037/submission/42406584

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

How two learn trees and graph implementation and algorithms for competitive programming ? Any help would be highly appreciated !

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

Can someone tell me why i am getting this error in my code it is working fine in my compiler 42407188

please help me i am not getting what is wrong

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

why this testcase for D should be NO? Can someone explain?

6

1 2

1 5

2 3

2 4

5 6

1 5 2 3 4 6

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

Can somebody tell me what is wrong with my code (42403836) for 4th problem.Actually I am getting WA on test case no.11 which is a large test case that is why I am not able to debug it.

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

In problem E Trips , If we had to find the largest group of friends which could go for a walk, Given the condition that at most 1 group can go for walk. (Extra condition added to the question is that all people going on walk should be connected by some links (possibly greater than one link) , the at least k friends of each person condition also remains there).

Then how can we solve this question?

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

    You said that at most one group can go for a walk but think about it. If you had 2 groups that matched the criteria and you combine them, isn't the new group still correct? :) And about how to solve it. Think of the problem as reversed. If you know the group after all the m edges (friendships) are made then you can substract one edge at every step and calculate the new group. If you want the detailed solution you can look at the editorial but I suggest trying it yourself before.

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

      It is not necessary that we can combine two groups. The intersection of the two groups can be a null set. And they both independently would be satisfying these conditions.

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

        You can always combine 2 groups.

        The rule is that if someone is in a group he has to have at least k friends in the same group.

        Now if we have 2 valid groups and we combine them, every person will still have at least k friends because he already had those k friends in the small group.

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

          Yaa right but if the question was to find the largest connected friends group. (The largest among all small group) then how can we find it?

          We cannot combine 2 groups if they dont have any common person.

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

But Is It Rated?