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

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

Hi!

I'm back with a new contest, a new color, and a new batch of xor problems.

Codeforces round #525, rated for the second division, is taking place on Dec/04/2018 17:35 (Moscow time). As usual, first division participants can take part out of competition.

I'm the problemsetter of the round. I'd like to thank 300iq for the great effort coordinating the round, isaf27, cdkrot, budalnik, and vintage_Vlad_Makeev for testing the round, scanhex for translating the statements to Russian, mahmoudbadawy for giving his opinions about the problems, and MikeMirzayanov for the great codeforces and polygon platforms.

Like my previous round, you'll be given 6 problems and 2 hours to solve them.

After the contest, I'll be on the community Discord server to discuss the problems.

UPD: the scoring distribution will be 500-1000-1500-2000-2500-3000.

UPD: something wrong happened and the editorial was deleted. I'll post it as soon as possible :(

UPD: the editorial has been re-written.

Good luck & Have fun!

UPD: congratulations to the winners!

Div.1+Div.2:-

  1. Madball
  2. Shayan
  3. ei133333
  4. paula
  5. Kuroni

Div.2:-

  1. paula
  2. DXC
  3. 0101-1001
  4. problem_destroyer420
  5. knil_GMO
  • Проголосовать: нравится
  • +476
  • Проголосовать: не нравится

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

xor problems

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

Egyptian problem setters , great ^^

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

Generally xor problems are really nice problems, hope this contest will be nice too.

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

Good!

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

Thanks :)

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

your previous round was one of the best rounds i've seen since i join codeforces

hope to see such a great contest again

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

my favourite colour is green

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

i will try my best to solve some problem , and get higher rating :')

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

Mahmoud and Ehab and the Xor, Mahmoud and Ehab and Xor-MST. These problems are freaking difficult and awesome. Expecting more difficult and great problems ;)

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

good

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

Let the strongest be lucky at the contest. All the will of Allah. You can't keep an eagle in a cage.Inshallah!

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

Whats up with long submission queues!

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

Good Luck for us all

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

GO vintage_Vlad_Makeev GO for newbie this time :P.

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

With the kind of determination vintage_Vlad_Makeev is showing in making his rating fall, he'll definitely beat the lowest rating of worse one day.

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

Is it rated?

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

sorry i cant read

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

I can't submit my code. Please help me.

I tried to send some codes with several languages, but the system always says "You have submitted exactly the same code before", even though "My submission" is still empty.

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

The scoring distribution provided here seems not matching the ones in standings page.
Please have a look.

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

Problem C seems buggy

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

I have a dream...

that one day...

problems will go from easy to hard GRADUALLY and not like this

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

Someone else having problems with the interactor of problem D???

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

what's wrong with problem D ??? i test it in my system and in custom test and i get correct answer in test 1 and when i submit that i gave wrong :///////

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

Is the idea for F that output tree must be a strict min heap. And now first value is hoax. For second value we need what is min value in 2^i distance tree from every vertex? How to do find min value in 2^i distance tree for all vertices ??

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

    F is only about extracting information from the statement. Let's interpret w as sum of cost of edges. Now, what we need is to find the minimum spanning tree. In the first tree, root at minimum value vertex. For each vertex, we only concern about edges connect it with 2i-th ancestor or root.

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

2o50s2

me.

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

Oh God I forgot question marks in D

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

In any universe will this code print 30 for problem D???

link

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

i'm so stupid today. I don't think that a and b in problem A can be equal :(

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

-

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

    Solution for E: Observation: the biggest fraction is always equal to the answer for k = 1 : the subtree with maximum sum. How to choose more components now? They all must have sum equal to maximum sum in a subtree, otherwise the fraction won't be the biggest

    So first we find answer for k = 1 dp on trees. dp[x] = the best subtree rooted at x

    dp[x] = val[x] + sum(max(0, dp[y]) | y is son of x); We calculate this dp using dfs.

    Let us denote maximum sum of a subtree with M.

    Now we can do a greedy to find maximum number of subtrees. We reapply the first dp algorithm again, but now when we obtain that dp[x] = M, we pick this subtree in answer, and disregard node x so it won't influence answer for father of x.

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

How to solve D?

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

interesting problems, thank you

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

xor + interactive

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

Can anyone explain the second sample of problem F? I can't get 44 from the optimal tree.

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

I felt like tourist when I solved A in 1 min xD

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

i do not care

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

make this platform hacker free..... my solution just got hacked.. use good antivirus

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

This is not cool. C — 1500 and D — 1750. And D is way more difficult than C.

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

Why system testing is late today? Any specific reason?

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

Thanks for an interesting content! And, I have a question on prob. D, which I've been getting on it for an hour. It annoys me.... My question is why I always get a WA on case 1. I don't think I have printed anything larger than 2^30.. Could anyone help me? Thanks a lot! here is my solution.46617886

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

    I don't really understand why people don't test their solutions for interactive problems.

    Just set the number of bits to 2 instead of 30 (so that you have less questions) and interact with your program. Just don't forget (like me) to set the number of bits back to 30 when submitting.

    Had you checked, you would've seen that your program outputs some weird numbers. The problem seems to be you used uninitialized variables, i.e. you wrote int a, b; instead of int a = 0, b = 0;.

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

      Yeah, you are right! It works. Thanks. I'm so frustrated that I should have made such a mistake. Actually, I tested my solution. That'y why I posted this. Maybe my complier optimized such a mistake so that I couldn't notice. Thank you for your help. It's a stupid mistake.

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

How to solve E?

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

Umm was this round not rated?

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

Why is he doing it? 46594591, 46591499

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

Happened to be my last Div2 contest, and it was a good one. Thank you!

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

paula ANIMALLLLLLL

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

Got stuck on D for 1.5h during contest without reading E. After contest I read E and solve it in 25 mins :D.

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

ok. guys. i am new in competetive programming. please help me.

i have a source code on mergesort whenever i need to use that on problem, i just reform that.

include<stdio.h>

int temp[100000];

void mergesort(int low, int high, int num[]){

if(low == high){

    return;
}
int mid = (low + high)/2;

mergesort(low, mid,num);

mergesort(mid + 1, high,num);

int i,j,k;

for(i = low,j = mid + 1, k = low; k <= high; k++){

    if(i == mid + 1){

        temp[k] = num[j++];
    }
    else if(j == high + 1){

        temp[k] = num[i++];
    }
    else if(num[i] < num[j]){

        temp[k] = num[i++];
    }
    else{

        temp[k] = num[j++];
    }
}
for(k = low; k <= high; k++){

    num[k] = temp[k];
}

} int main(){

int n,i,num[100003];

scanf("%d",&n);

for(i = 0; i < n; i++){

    scanf("%d",&num[i]);
}
mergesort(0,n - 1,num);

for(i = 0; i < n; i++){

    printf("%d ",num[i]);
}
return 0;

} i used the code with just a little change of a book here

at B, i just got my solution coincides. why.

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

How would one approach problem C if we were to determine the minimum number of steps to make the array strictly increasing??

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

problem D was a really nice up and down dp tnx codeforces and authors for these problems ;)