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

Автор sigma_g, история, 3 года назад, По-английски

Hello all!

We are proud to invite you to CodeCraft-21, which takes place on 29.03.2021 17:35 (Московское время). It is rated for all Div2 participants (rating under 2100).

This contest comes under Threads'21, as a part of our annual techno-cultural fest Felicity, IIIT Hyderabad. We have special prizes for Indian participants!

You will be given six problems to solve in a duration of two hours.

We have tried our best to keep clean statements, useful samples with good explanations, and strong pretests! We have written step-wise editorials, and will also release video editorials!

We would like to thank these amazing people for helping make the contest happen:

There will be an interactive problem! You are recommended to read the corresponding guide.

We hope you enjoy the contest as much as we did preparing it! Good luck!

Update: The scoring distribution is 500/1000/1750/2500/2500/3000.

Update: Editorial is up! Video editorials available on our YouTube channel.

We are sorry for the sudden increase in difficulty from C to D. Nonetheless we hope you enjoyed the problems! :)


PRIZES: The following twenty lucky participants receive a tshirt:

  • top 10 Indian participants
  • random 10 from top 100 (ranks 11-100) Indian participants

These ranks are determined from the combined unofficial ranklist. We are coordinating with the CF team for the tshirt design, and we'll update the blog post when it is finalized. We also have INR 7K worth prizes exclusively for IIIT-Hyderabad students!

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

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

Hope I remain a specialist after this Round;)

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

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

Wishing all Indians as well as all members of codeforces community " A very happy holi(Festival of colors celebrated in india) in advance.

Although the contest will clash with holi celebrations nevertheless will try to give it. :)

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

How you decide if a participant is from India or not.

  • »
    »
    3 года назад, # ^ |
      Проголосовать: нравится -15 Проголосовать: не нравится

    Scrapping the leader board and applying simple script where data-field of country is India for a participant. As it is public for every user.

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

Hopefully I'll reach Green after this contest! I love bright colors, not this Grey :(

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

Hope I become expert in this contest

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

video editorials ! hmmmm.... NICE =)

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

I can vouch that the clean statements, good samples with useful explanations and strong tests part is definitely true. This is also one of those rounds where basically everything seems to be contest-ready (statements, tests, sample explanations etc) more than 48 hours before the contest, which is good (not having this is more common than you would think, sadly...). Kudos to the Codecraft team. I would recommend participation.

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

As a tester, I found the problems to be very interesting and I had a lot of fun solving them..... Don't miss this contest!

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

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

5

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

what about score distribution?

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

Video Editorials. Excited. I wish there is more of it in codeforces.

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

High hopes with this round

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

What if there is less than 10 indian participants in the rank range 11-100?

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

CodeCraft is a new way to learn to program by constructing things in a virtual 3D world => Google's Definition

What a deep meaning :)

»
3 года назад, # |
Rev. 3   Проголосовать: нравится +77 Проголосовать: не нравится
Happy Holi Everyone
  • »
    »
    3 года назад, # ^ |
      Проголосовать: нравится +21 Проголосовать: не нравится

    Hockey team?

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

    No offense, but ironically your new year message was the same except "holi" in it lol.

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

    That hockey team sarcasm is so good!

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

    Hey guys i want to wish you all a happy holi. Discord is full of copypasted holi messages, that people don't even read and just forward to other servers. I don't like that. I like to write what i deeply wish and what comes from my heart. Our friendships, from the most deep ones to the most virtual ones are very important and will never be represented by a simple message copied from elsewhere. This being said I would like to thank all of you. You are the best hockey team i've ever played with.

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

    Posts that are so sarcastic that they return to normal!

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

How do you know if a participant is Indian or not? On CF it is very easy to change the country. And some participants don't even include country name in their profile.

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

    We will post the relevant details after the contest is over (when standings+rank deltas are finalized). So keep following this blog for future updates!

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

Hope I can add a new colour to my CF account ( Specialist :: Cyan ) in this festival of colours :)

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

Hopefully, I will try to sit and make efforts till the end of the contest and won't give up in between :)

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

Forgot to mention earlier, there will be an interactive problem! You are recommended to read the corresponding guide. Good luck! :D

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

interactive, you mean binary search problem? :p

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

Hope I become expert in this contest.

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

Finally India's contest. i challenge any non-indian to win the contest

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

Please announce the scoring distribution of the contest!!!

Upd: Announced

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

Kudos to IIIT-H, hoping for small and clear problem statement

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

Another Div 1.5 is coming :(

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

after seeing score distribution i'm like my limitation is up to problem C

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

make it 16:40 please,, eating my lunch :D

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

Whatta jump between C and D :'(

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

    test cases are very limited in C where k=1,2,3 and then direct 250 fuck me up !!

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

      the k = 250 is actually good tho since if you pass that test case then the chance your solution is wrong is too low. Stop whining and go improve instead

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

If your div2B is harder to prove than your div2E then miss me with that shit

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

    Seriously though, I felt the necessity for a proof, otherwise I would've solved that. How does one prove that the greedy thing works?

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

      It is allways better to place a piece in a row instead of not using the free space.

      Then, we can allways put two of a shorter length where we can put a longer one.

      So, if we simply put allways the biggest possible piece into the remaining space of the current row, then it is optimal.

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

Good sample cases :)

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

India is an actually a good country :D

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

A= An Easy Problem

B = Bad Statement

C= classical DP

D/E/F ---> Sorry Don't want to kill myself.

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

Weak pretests in D (:

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

what is pretest 8 in problem E?

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

My notebook just went full as I tried to solve Problem C with a diagram for the big K value.

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

How to solve Div2 E ?

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

was there any special algo for problem D ? or just looping and bruteforce like sieve ?

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

Can't believe I passed 40 pretests on E. If I do not get FST, that problem is better suited for the April fools contest. I didn't even understand the problem correctly IMO.

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

    What did you do ?

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

      random solution which I thought would fail within the first few pretests. I can't even explain my solution because I have no idea why I did it. 18 mins left, I just wrote something.

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

    Same thing here — I took a gut-shot: while there is a city with 0 incoming roads, remove it and decrease all other values of K by one. Then take the max remaining K and min remaining K as your answer, unless you end up with no array left, in which case there never was a strongly connected component.

    Let's think about why this works. Suppose every road has >= 1 incoming road and >= 1 outgoing road

    • If we are at node X, and we perform DFS, every time we reach a new node, we will be able to continue, because no city is an end point

    • The graph is connected, so we will reach every city, and use every road

    • Therefore the remaining graph is strongly connected

    This means that once we've removed the cities with only outgoing edges, we can just take largest remaining K value and the smallest remaining K value.

    EDIT: I am clearly missing something — my solution should have failed according to uphacking.

    EDIT 2: The above is wrong — all nodes must either be part of a strongly connected component, or they must connect other strongly connected components. So the correct approach is actually to sort all pairs by the absolute differences in k-value, and if the smaller k-value city is reachable from the bigger k-value city, that's the correct answer.

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

      I somehow missed this line — There is exactly one directed road between every pair of houses" even though it was in bold. Now I understand why this works. Just now I received a message that my solution has been uphacked so system tests were weak.

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

        My code failed the same test yours did as I just managed to hack myself with it! So I must also have missed something.

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

    Same for me. I didn't even understand why I am writing the solution but alas, it passed all the test cases. !!!

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

Can someone explain Problem E? I sorted it by descending |ka -kb| pairs and queries a b if a>b and b a otherwise until I get a match. I did not expect it to work but somehow it passed test cases.

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

    I think it's because the structure is that you can group houses into groups of biconnected components (which are also cliques). Then the meta-graph on these biconnected components form a total ordering, where all edges between two biconnected components all go in the same direction. Any house in a lower rung in this total ordering must have strictly more incoming edges than any on a higher rung.

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

    I did the same thing after removing all nodes that do not belong to a cycle, failed on pretests :(

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

    Well I used the pigeonhole principle — Say we have two vertices A and B and $$$k_B > k_A$$$, then we know that there are $$$n-k_A$$$ edges outgoing from A and $$$k_B$$$ edges incoming to B. Now by the pigeonhole principle we know that if the some of the above two quantities is greater than the total vertices apart from A and B, and if there exists a path from B to A, then we have a A and B in a directed cycle — and notice by choosing $$$k_B > k_A$$$, $$$n-k_A+k_B > n-2$$$ is true by default. Therefore if we query ? B A and get Yes as response, then we have A and B in a directed cycle — which is what we want. I'm still little sus about this being sufficient.

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

Nooooo I was like 1 minute away from solving E! Was it just to loop through all possible combinations of A and B where B has more incoming edges than A, in order from best to worst according to the cost function, and if A is reachable from B then it's the answer?

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

any one tell me how to solve div2 b?

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

I am not a native Indian, but one by heart. Do I get a t-shirt too?

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

    Makes me wonder, if a participant changed his country of origin in the settings to Indian as of now (or maybe prior to the contest), does the system consider that participant to be an Indian? Now that's just a scam if possible right...

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

    Change your country tag to INDIA. As simple as that

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

How to solve C ?

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

    2-D DP. One for the index other for k.

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

    let f(k, n) be the count of multisets with "k" decay age and n planes available in its direction.
    Reflecting on a particular plane, we get another ray with N — n planes (direction inverted) and k — 1 decay age.
    The original ray continues to travel with n — 1 planes remaining.
    so, f(k, n) = f(k — 1, N — n) + f(k, n — 1)

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

    Simple TOp Down DP.

    ll recur(ll i,ll n,ll k,ll dir) {
        if(i==n+1 ||i==0) {
            return 0;
        }
        if(dp[i][k][dir+1]!=-1) {
            return dp[i][k][dir+1];
        }
        long long int ans=0;
        if(k>1) {
            ans=(1LL+recur(i+dir,n,k,dir))%P;
            ans=(ans+recur(i-dir,n,k-1,-1*dir))%P;
        }
        else {
            ans=(ans+recur(i+dir,n,k,dir))%P;//same dir
        }
        return dp[i][k][dir+1]=ans;
    }
    
    
»
3 года назад, # |
  Проголосовать: нравится +16 Проголосовать: не нравится

Am I the only one who thinks that the time limit for problem E is too tight for Java 8/11 ?

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

    Sorry to hear that! We've a AC submission in Python on our side.

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

      Thanks for the confirmation. I might have to optimize my solution more if it doesn't pass System Test Cases. !!!

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

      Just an FYI for the future, Java often runs slower than Python in interactive or output heavy problems. For example, during the testing of 1451E2 - Bitwise Queries (Hard Version), the limits on $$$n$$$ had to be reduced from $$$2^{17}$$$ to $$$2^{16}$$$ as Java couldn't pass it without using PrintWriter or custom IO classes instead of the default System.out functions, while Python easily passed.

      Similarly, while setting a problem on Codechef (which usually has a much faster judging environment, especially with respect to IO) that required a large string to be printed, Java failed to print $$$5 \times 10^{5}$$$ characters in 2 seconds while C++ and Python easily managed to print $$$10^{6}$$$ characters in the same time, all without any fast IO.

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

        Then I guess the time limit should be a bit more, else the solution with CPP/Python having the same Java logic gets passed and Java solution gets TLE.

        It may seem unfair.

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

HAAPPY HOLI EVERYONE !!

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

I am afraid of system test :(

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

Well, even if I sadly bugged my C (actually I just realized I was doing useless transitions lmao), I really enjoyed the round ! Problems were nice, statements clean, sample useful... I hope you'll do more CodeCraft rounds !

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

It is much easier than Div2 i think. But anyways problems were well framed with very short codes for all. But i personally feel that problemset is too easy or the problems should be shifted one level back for DEF , D->C, E->D, F->E. Thanks for the contest.

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

It's very sad, when tasks are sorted out of order of increasing difficulty...

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

fst :(

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

btw i believe F is easier than D and have less solves just because it is on position F

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

    No way. It miiiiight be easier for those who memorize random algorithms but can't think. And even then it is dubious.

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

Somehow, I didn't think of a dynamic programming solution for C. I just ended up counting the number of particles with decay ages from i=1 to i=k and obtained that by using prefix sums.

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

Please help in this submission of C : https://codeforces.com/contest/1498/submission/111405668

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

Can anyone tell how to solve C using iterative dp?

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

      Thanks.

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

      Can you explain your approach.

      i solved it iterative dp too but yours look eaiser

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

        Consider some DP where the state is represented by:

        1. $$${hits}$$$: The number of planes in front of the particle

        2. $$${age}$$$: The age of the particle

        And our answer for the state is the total number of particles that are produced during this state.

        So, formally: $$${dp[hits][age]=}$$$ number of total particles produced when we shoot a particle with age $$${age}$$$ towards $$${hits}$$$ planes

        So how to calculate the current state from previously calculated states? It seems tricky at the first glance but it's actually kind of simple.

        When we shoot a particle towards $$${hits}$$$ planes what happens?

        1. A new particle with age $$${age−1}$$$ gets reflected by the first plane in front of the current particle and it will now face $$${n−hits}$$$ planes, which is the state $$${[n−hits][age−1]}$$$.

        2. The same particle goes through the first plane in front of it then continue to face $$${hits−1}$$$ planes (obviously it's age won't change), which is the state $$${[hits−1][age]}$$$

        So now we know the transitions from our current state, the recurrence becomes:

        $$${dp[hits][age]=dp[n−hits][age−1]+dp[hits−1][age]}$$$

        Of course, this can be optimized to get rid of the second dimension since we only need the information from states with $$${age}$$$ and $$${age−1}$$$, this improves our space complexity to $$${O(n)}$$$, Code

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

          I had to read that many times to understand it but worth

          great solution, Thank you!

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

My submission of E is still "Pretests passed". I'm very confused by this crazy verdict.

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

To not keep you waiting, the ratings updated preliminarily. In a few hours, I will remove cheaters and update the ratings again!

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

    I get "Accepted" only now after rating changes (on E, which I solved on contest), hope you will fix this.

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

Wow rating changes came so fast

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

sigma_g please have a look at my submissions for problem E with the same source code.
1. Submission during contest — It gives TLE.
2. Submission after contest — It gets Accepted.

Please have a look over this issue and do update the ranking if possible.

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

Can we solve c using prefix sums and iterations for each k??plz tell ..i think we can do this..but am not able to get correct ans using modulo

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

Could someone pls help me on what is wrong with this submission for D ? Also I defined int as long long and double as long double.

https://codeforces.com/contest/1498/submission/111408649

I did the old fashioned dp solution. But it seems to fail on test 12. Is it due to the fact I am using long double (precision error) ?

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

    I think it's precision error. Actually there's no need to use double in this problem.

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

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

Can anyone please tell me why this solution 111375843 for problem B is wrong. I solved using 2 pointers. Thanks in advance :)

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

Etdiroail is too good :}

<3

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

MikeMirzayanov

These two codes are exactly the same, but the first code was submitted during the contest got TLE on test 15 but the other code submitted after the contest got accepted.

The code, getting TLE: 111380434 The code got AC: 111417474

Due to which my rating got affected. Please have a look at it. Thanks

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

    Your accepted code also passes in 982 ms and there is usually a +- 50 ms difference during execution times on different runs.

    Also, avoid using long long when unnecessary. It takes longer to read integers into long long. For instance, this is your exact code with the line "#define int long long" removed. It ran under 600 ms which is significantly faster.

    https://codeforces.com/contest/1498/submission/111420403

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

      Yeah, thank you for your explanation. I Will avoid using it next time when unnecessary. But can nothing happen this time? As the code is correct only, even the judge is giving accepted sometimes. So, during the contest, it is difficult to think of such a reason for a new coder even though it passes all the pretest. MikeMirzayanov

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

        Don't worry, these things average out with time. There'll be another time when you'll get lucky. Everyone goes through such issues.

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

Problem Explanation was very poor for Problem C, D. It could have been better. I understood it only after reading sample input output.

Problem Writers should participate in Codeforces contests to understand how problem statements are written. It looked like problem setter was deliberately trying to confuse participants. If you can't write problems upto standards of codeforces, at least you can keep the contest private to your college, Don't make it Div2 contest.

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

When will t-shirt prices be announced ?

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

Python doesn't support too deep recursion for problem C, even though I changed the limit.


import sys sys.setrecursionlimit(1000000) def dfs(i, k, cache, n): if i == 0 or k == 1: return 1 if (i, k) in cache: return cache[(i, k)] ans = dfs(i-1, k, cache, n) + dfs(n-i, k-1, cache, n) cache[(i, k)] = ans return ans def solve(): n, k = map(int, raw_input().split()) print dfs(n, k, {}, n) % (10**9+7) for _ in xrange(int(raw_input())): solve()
»
3 года назад, # |
  Проголосовать: нравится 0 Проголосовать: не нравится

When solving problem B using the binary search method, we select the height of the box and check whether all rectangles will be included in it. I cannot figure out how to account for the space that has already been used. How this formula works from the analysis ci = ci + 2 × ci + 1 + 4 × ci + 2…. Where does this formula come from? Explain someone. Thanks.

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

    One block of width $$$2^{i+1}$$$ occupies the same space as two blocks of width $$$2^{i}$$$. Therefore, to account for space used by the $$$i+1$$$-th block, we add $$$2\cdot c_{i+1}$$$ to $$$c_i$$$. The same reasoning can be extended to larger blocks.

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

When will problem ratings for this contest be updated ?

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

You guys are not able to make a random generator in two days which can decide 10 from 11 to 100 ranks lol.

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

MikeMirzayanov please update problem rates for this round. It's been a week.

»
3 года назад, # |
Rev. 3   Проголосовать: нравится +94 Проголосовать: не нравится
Congratulations to winners of CodeCraft-21 and Codeforces #711 (Div. 2)!

We will soon contact you regarding prize distribution.

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

Now that more businesses are gradually reopening, we can finally distribute the tshirts. We have sent out the form link to all the 20 winners (as well as the testers and the writers). The design of the tshirt is:

(credits to victorknox for the design)

We hope you like it! :) We will try to send the tshirts as soon as possible.
Cheers! :D