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

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

Hi everyone!

I am pleased to announce that Codeforces Round #304 (Div.2), of which I am the author, will take place today. This will be my first round, so I hope that it will be cool and interesting. Traditionally Div.1 participants can take part out of the competition.

I want to thank znirzej, Dakurels and Zlobober for help with preparing the problems, thank Delinur for translating the problems, and thank to MikeMirzayanov and all who created polygon for this great system.

I wish you all good luck!

UPD Scoring will be 500-1000-1250-1500-2250.

UPD editorial

UPD Congratulations for winners in div.2:

  1. phoenix__jpn
  2. Hujishiro_otone
  3. lzw4896s
  4. jinzhao
  5. jabbawookiees

And in div.1:

  1. ngfam_kongu
  2. uwi
  3. anta
  4. W4yneb0t
  • Проголосовать: нравится
  • +237
  • Проголосовать: не нравится

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

Thank You. :)

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

Hope to participate officially on your next contest :)

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

Hope next time you arranged problems for both division . thanks .

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

.

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

Wow, polish round!

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

"Scoring will be announced later." Hope it's not just a minute before the contest starts.

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

Radewoosh fought a lot in yellow but at the end he is red congrats and all the best for next rounds.

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

I wish all participants of Div2 to reach Div1.;)

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

An only div2 round from a red.it will be interesting.

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

I hope this round will be not easy like last contest

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

Scoring : 500-1000-1250-1500-2250. Looks like that the problems are not hard except E

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

My first contest (:

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

Too many unrated participants in top 20 -_-

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

farnasirim has n badges.

Who are the n lucky coders who want to receive badges ?

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

    No badges for those who use these kinds of names for innocent variables.

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

      This was a joke, but please here is not write a bad word.
      Admin please delete this message.
      sorry for my poor English.

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

        This is not a joke, this is a screenshot. I am sorry I should have set an age guard so it wouldn't teach bad words to 2 year olds. Also your age is not elligible for receiving a badge. So stop trying too hard :/

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

          I'm not good in English but you can understand me... There are girls from our counry or other cultural countries in this site, so such messages aren't eligible to be written here. I think you are schoolboy who doesn't know how to behave!

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

            Dick/Sperm (although not directly written by me) are facts that women from your country have to know about sooner or later :) No, I am a schoolboy who does not understand the way you think.

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

The hack checker for the problem B has some problem as it gives an "Invalid Input" result for a valid input. Please check.

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

hack checker for problem B seems to be giving invalid input,have tried multiple times

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

It's a little bit strange... this round seems too easy. Look at the number of accepted solution.

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

waiting for D solutions to fail main tests... ;)

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

Как решать D?

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

    Сделаем решето Эратосфена,при этом когда во 2 цикле делает isPrime[j]=false подсчитываем степень i в факторизации j (за logn) и прибавим это к счетчику простых делителей числа haveDivisors[j]. Предподсчитаем массив частичных сумм на массиве haveDivisors. Тогда ответ — это ps[b]-ps[a]

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

    Ответ на задачу — сумма количества делителей всех чисел от b+1 до a. Собственно, алгоритм: сначала вычисляем заранее количество делителей для всех чисел, считаем частичные суммы и отвечаем на запросы за O(1)

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

How to solve E ?

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

    Its a maxflow problem. Make a 2*N + 2 vertices , 2 copies of each node and 1 source and 1 sink. Now you can find out the respective edges required to make the graph (think about it a little bit, if u know max flow , else u can read about it), that part is only left. Then find the max flow from source to sink and print it.

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

What were all the hacks on B and D?

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

    I got hacked in D cause I used cin cout for input. Though I am pissed, I must say, that was a clever hack!

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

      Me too, Failed system test case because of cin cout

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

      I'm sorry but why would cin,cout fail?

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

        cin cout streams are slower than scanf and printf.

        We have to read in about 2 million integers from the input file and write another million as output. The overhead in cin cout is just too much (will take more than 3 seconds) and thus your solution will timeout. Morever, the "endl" command to add a newline character has another overhead, it adds a newline character AND empties all buffers.

        It is advisable to use scanf printf for faster input/output operation.

        Try it out yourself on some local files and see which is faster

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

    you should've used scanf and printf instead of cin and cout I guess..

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

    For B:

    5

    1 1 1 1 1

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

    B:

    5
    1 1 1 1 1
    

    D: very long input and output

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

    Well, I hacked D's that should obviously TLE, so the maximum tests weren't included in pretests. For B, there were a lot of incorrect solutions that had Passed Pretests.

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

    also i hacked 1 ppl using this test:

    3

    3 3 3

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

    Many did a brute force on D and didn't pre-calculate the values .

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

    I've made 6 hacks with following test:

    10

    3 3 3 3 3 3 3 3 3 3

    Most solutions used if(a[i] > 1) instead of while(a[i] > 1)

    Also, there was a case of 3000 times of 3000, which may cause overflow on some solutions, but I haven't tried that

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

So weak pretest on B. And I locked it ...

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

Не подскажет кто-нибудь почему в B некорректный такой к примеру тест:

3000

20 20 20 20 20...

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

    Валидатор ругался, что нет переноса в конце второй строки.

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

    В конце нужно добавить Enter.

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

    перевод строки в конце есть? или может лишний пробел в конце.

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

      спасибо, в конце пробел убирал, но перевода строки не делал, очень жаль, можно было пол комнаты хакать :(

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

    перевод строки в конце надо ставить в этом тесте

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

Thank you for the contest. Though I did some really really stupid mistakes.

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

Тот самый момент, когда написал Диница в Е, но забыл проверить равенство сумм Ai и Bi [MegoGo-Fail]

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

Why my hacking test case for 2nd question is showing invalid input. I simply put n 3000 and write 3000 number of value 3000.

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

I've tried to answer queries (in problem D) by using a prefix sum table of number of prime factors of numbers. But it's not fast enough. What's an efficient way to find number of prime factors of a number (not necessarily distinct)?

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

    I don't know, is my solution correct, but I did it in such way:

    1) Let's calc the Eratosphen Sieve and take all prime divisors for every number in [1..5*10^6]

    2) For each number let's divide it while we can, by all prime numbers, that we calculated.

    So, it works about 2,9 sec

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

      I believe you only need to calculate primes up to sqrt(5000000) and if a number can't be divided by any of the primes you have, it must be a prime.

      P.S. My solution is the same so my submission code can be used to understand the idea. http://codeforces.com/contest/546/submission/11220118 (not sure if it's already visible but it will be soon enough).

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

    you just need to count sum of prime factors for each number,and then answer is d[a]-d[b](it't easy to show),for this precalculation you just need sieve of eratosthenes and for each prime p and number k; while (k | d) increase d[k],k=k/d

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

      Can you explain why my code isn't fast enough then? I think I did the same thing. My Implementation

      • »
        »
        »
        »
        9 лет назад, # ^ |
          Проголосовать: нравится 0 Проголосовать: не нравится
        1. You only need primes up to the sqrt(5000000)
        2. A couple iterations could be saved by moving prime=2 out of the loop when generating primes.

        Apart that, it is quite similar to what I wrote. I think it's the 1st problem that is making your code too slow.

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

    You don't need to find the number of prime factors per se in this problem or even calculate prime numbers per se.

    What I did in D was to calculate for each number the lowest number that divides it (it will be a prime). You can do it with a Sieve of Eratostenes by assigning to each number the first number that divides it and ignore other divisors.

    Knowing the smallest divisor for each number you can use a O(n) dynamic programming solution where:

    numDivisors[i] == 1 + numDivisors[i / smallestDivisor[i] ].

    You are basically dividing the number by it's smallest divisor and then adding the already calculated result for the remaining number.

    Then you calculate the accumulated number of divisors from 1 to 5 000 000 and then for each query you can calculate the result by subtracting accum[a] — accum[b] since a!/b! is the same as (b+1)*(b+2)*...*a

    The highest complexity of the algorithm will be the either the sieve calculation or the number of queries.

    Edit: Code

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

What about E ?

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

    Max-Flow

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

      but how? we can move soldiers from this city only to the neighbours:) ?

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

        You can make a flow graph with 2 * N + 2 nodes. The last 2 are dummy source and sink. You also have N original soldier nodes and N final soldier nodes.

        The edges are from the source to each original node, the original soldiers on each of such nodes. Then from the original nodes you connect to the final nodes where the soldiers can move, i.e, the neighbor nodes or the same node.

        Finally the final nodes are connected to the sink with capacities equal to the number of soldiers that are expected for each of the nodes in the end.

        If the flow is exactly equal to the sum of the soldiers and the if the final configuration has the same number of soldiers then it's a YES and you print the flows for each of the edges between original and final.

        My code

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

I think, to hack is not honest. These contests are a test, but not a game "how to hack other people". I really hate hacks. Sorry for bad English)

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

    Hack at least improve your understanding of other contestant code, and also finding a bug in their program. It really helps me creating some corner test case.

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

How to solve D? I thought segment tree might be useful but even if I use it, it still takes a lot of time to calculate each score of numbers...

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

I use ios::sync and cin.tie on problem D. Am I get TLE??

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

How to solve problem E ? I was having almost 1 hour for this problem but not able to come up with any idea.

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

All problems are very interesting. Thanks to author.

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

How to solve problem D?

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

I know some people are claiming it was too easy; but I personally like being able to actually try out a couple problems in a competition for once. Feels nice to succeed for a change!

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

Will cin cout give TLE on D ?? Even if the query is answered in O(1) ??

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

I hate those expert programmers, who got problem D right, and just to earn a few more points started to hack other people's solutions by giving large number of test cases and large values of a and b. One guy in my room was just sitting with that intention, that whenever this person locks it, I have to hack it :(

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

    I don't see anything bad in it. For example, I knew that my solution is incorrect before end of contests and had chance to resubmit...

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

Why did I get a message saying I should not use %lld in problem A? Is using it bad? I ignored it since I don't know another way to do it and I passed the pretest. Could someone please explain how to read long long in c++ without using it and why I should not use it?

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

    It depends on the OS of the checking server. If it is linux than %lld is okay, but codeforces is using windows — so the right way is %I64d

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

      oh no, I compiled it in my linux computer typing in %l64d and it didn't work. So for future occasions I just have to declare the variables as long long (as normal) and then when using printf and scanf substitute %lld with %l64d ?

      Am I going to get it wrong because of that though?

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

        If the online-judge system is CF — then yes, you should do it like that. I don't know about other online-judges like timus, topcoder etc.

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

Are there 2 pretests in problem D??? REALLY??????

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

For D, I used a sieve to find the prime numbers which worked very fast. Then, for each number in range [1;5 000 000] I calculate the number of prime divisors using only prime numbers(that I put in vector) which don't exceed sqrt(cur number). Then, partial sums. Is it the correct solution? The slow part was the one with finding the divisors/

any trick I missed?

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

    Fast IO ?

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

      No, this not the problem because after calculate the divisors for each number I wrote cout<<"Ready!\n";return 0; and wait for 10-20 seconds and nothing happen. I saw people that used the same idea but they only calculate the least divisor for a number and then divide it by its least divisor until reaching 1. I think we have the same complexity but in practice their solutions beat my solution...

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

    I don't understand your solution exactly. I solved it using Legendre's formula. (Although I don't know if it worked yet)

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

For problem C, I got a wrong answer on Pretest 3. I don't understand what was I missing. From the problem statement, I assumed that if N is odd, then print -1. Else do the usual queue and dequeue. Did I miss anything?

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

Start upsolving, please!

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

Can you please explain how these test cases are invalid for B

5 1 1 1 1 1

6 1 1 1 1 3 4

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

No. of solutions passed : A B C D E

Pretests : 3591-2894-2383-1158-180

Final : 3516-1986-1578-557-137

4 out of 5 problems made for hacks! Great div2 contest!!

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

У меня во время контеста сайт регулярно перестает отвечать, иногда это длится несколько секунд, иногда пол минуты и больше. Это общая проблема?

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

Why cout why!!

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

For problem D, I just replaced "cout<<ans<<"\n" to "printf("%d\n", ans)". And it passed in 2090 ms. I had even used ios_base::sync_with_stdio(false);. Submissions : 11219308 and 11224412

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

it is really bad feeling when problem time limits because of cin cout :(((((((

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

    Why? You should realize that the amount of input is huge, and it's going to take a while to read it using cin. Imo, it's only your fault. Using scanf and printf saves you a very big amount of time. I've learned it when I was upsolving. The solution, which used cin, got TL. But then I used scanf and the result was 140ms out of 1000. From that moment I'm using scanf and printf.

    UPD: The submissions are: 10834692 and 10834765

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

      i already know it. but i hate cin cout from this day :D i just didn't think about it today

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

      But cin, cout with sync_with_stdio and cin.tie(null) should get accepted too. Mine didn't. It is the setter's fault man.

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

cout...

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

Time limit on Div2 D were too strict.

I got TLE when I submitted using cin,cout(using sync_with_stdio) in C++. And I got AC when I changed it to scanf,printf.

This is not good Mr. Radewoosh. Same algorithm should get accepted inspite of input output specifications.

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

And the test case of D question was pathetic! scanf is getting accepted whereas cin doesn't!! Who is going to guess that in the contest! Shame!

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

    cin is getting accepted . You had to write ios_base::sync_with_stdio(0) ; cin.tie(0) ; to get AC .

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

      I used that and even then I got TLE on test 3. I had to change to scanf and printf to get AC. This is not fair.

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

How much I wish , div-2 E test case

1 0
2 1

were in the pretest. This test doesn't make sense anyway either. -_-

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

for problem C: #define stack queue

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

In standing it is showing 3 solved problem but in contest I solved 4 problems and all 4 are accepted in the problem tab. P.S I have not resubmitted problem after contest.

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

how fair is it to award 0 to both , one who spent huge amount of time coding D correctly but forgets to put one line along with cin/cout & the one who had no idea about how to solve D & gave 0 time :P ? Disheartened :P

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

People who use Python like me, don't care about cin or scanf. LOL!

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

When do we get the editorial?

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

problem D where is case? 1000000 5000000 1 5000000 1 . . .

some AC code must be TLE

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

got TLE on problem D just because I used endl not \n fuck this kind of problems -_-

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

Guys, knowledge that cins/couts are very slow on big inputs/outputs is important on contests, and in this task this was one of the problems.

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

    I guess people do know that! Just that they do not benchmark which input is too large for cin and cout to not work! Most of the times cin inputs upto 1000000 run fine on codeforces! Anyways apart from that the problems were good!!

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

    I wonder, was this intended from the beginning. (Specifically, did Zlobober know about this?) This does not conform to the problem authors' guidelines that large tests should be included in pretests.

    It's ok that you test for large inputs in easier problems but I doubt that is appropriate for a 1500 mark problem.

    Don't get me wrong, I got AC. I am just curious.

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

I got TLE in problem D, and I still don't understand Could anyone tell me what wrong in my code? http://codeforces.com/contest/546/submission/11221079

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

Немного об условиях.

"Для каждой пары солдат один из них должен получить значок, коэффициент которого строго выше второго." (546B - Солдат и значки). Долго вкуривал смысл этого предложения.

"Для каждой пары солдат один из них должен получить значок, коэффициент которого строго выше второго. Для солдат не важно, какие у них значения коэффициента, требуется лишь, чтобы их коэффициенты отличались друг от друга." Создается ощущение, что коэффициенты относятся к солдату, а не к значкам. Лично меня это изрядно сбило с толку.

"Исходно они делят между собой картны некоторым образом, возможно, не равным образом." (546C - Солдат и карты). Опечатка, плюс двойное повторение слова "образом".

"...обозначающее количество игр, в которые играют солдаты." (546D - Солдат и игра с числами). Солдаты все же играют в одну игру, а не в разные.

Также огорчает немного запутанное (до того, как были сделаны исправления) условие задачи Е, стоившее мне одной попытки.

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

Can someone please help and tell me what is wrong with my solution for 546D?

I am getting TLE but I implemented exactly what the editorial says:

http://codeforces.com/contest/546/submission/11232282

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

    many people has this problem.using ll inplace of int & cin or cout inplace of scanf & printf caused TLE. It's not good...

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

Where is the editorial ?

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

deleted

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

Very Good Contest! Thank you.