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

Автор Igor_Kudryashov, 10 лет назад, По-русски

Всем привет!)

Завтра 19 марта в 19:30 MSK состоится очередной раунд Codeforces #237 для участников из 2 дивизиона. Традиционно, участники 1 дивизиона могут написать соревнование вне конкурса.

Подготовкой задач занимались Игорь Кудряшов (Igor_Kudryashov) и Геральд Агапов (Gerald). Кроме того, выражаем благодарность Михаилу Мирзаянову (MikeMirzayanov) за прекрасный ресурс Codeforces и Марии Беловой (Delinur) за перевод условий задач на английский язык.

Желаем всем участникам удачи, высокого рейтинга и удовольствия от решения задач)

UPD: Распределение баллов будет стандартное 500 — 1000 — 1500 — 2000 — 2500.

UPD2: Соревнование завершено, благодарим всех за участие.

Поздравляем победителей:

  1. Pkqs09
  2. juggler
  3. zstu_bobo
  4. kevinswat
  5. Salvare004

UPD3: Разбор задач можно найти здесь

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

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

Gerald's rounds are always nice. Thank you for preparing this contest!

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

    Yes, I agree with you.
    Why always there is some unrated users in top 5??

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

A day before Nowruz!
Wish this good round completes the happiness of starting of our new year!
Happy 1393 (Solar Hijri calendar) to all Persians arround the world ;-)
Wish everyone happiness and good luck!

P.S: You can follow the exact time of year delivering (March equinox) in Iran here
Edit: Year delivering is the national word (تحویل سال) but the scientific name is March equinox

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

Is it standard distribution?

EDIT: Why people are so opposed to asking a simple question? Obviously when I asked this information was not in the main post...

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

Good luck everyone~ This must be a good contest! :)

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

I hope this will be my last Div.2 Round (1699 now) :)

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

404 contest not found! ++id; :D

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

Oops. I guess I didn't register. I feel like it let me register with out being logged in so I thought I had registered but I actually hadn't. Next time. Good luck. Zoz

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

Опять в среду =( Пичалька.

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

Next time you'd better get a DECENT translator to translate the problems! OR release the problems in RUSSIAN ONLY!

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

    This time I firmly disagree with you, translation quality was decent enough, Can you specifically point out which problem had poor translation or possible issues so that translation might be improved in future.

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

      I don't get it neither... Even if some problems were tricky, I haven't found statements being hard to read.

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

        The statements were extremely vague and poorly written! I would read each line over and over again to understand what the writer is trying to get at!! Also many points were unclear, some samples clarifications should've been added!

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

          They were not much clearer in Russian.

          However it is a free contest and you pay nothing to practice here, so probably it is not just to complain. "Take it or leave it", you know. :)

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

            Well this depends on how you define "free". I don't like to sound rude but this whole thing is not made up for charity you know! Codeforces is getting well known a day after the other and it can attract many sponsors and companies that would host their competitions on it, so it's not free, what you are saying might apply to something like UVA but not Codeforces! When you make a platform, users are your capital. You wanna make something, make it the best possible or don't.

            And by the way, I don't mind paying if this would result in a better platform! Actually I'd be very glad to do so. That's not the point I'm trying to make, I appreciate their work and efforts and everything but they need to consider this feedback if they really want to achieve something!

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

              first to note, other people reads the same description

              second, what it's like good a problem has good description ?

              every people has different kind of understanding, you should not blame the problem if many other peoples understand it, try reread it, if you still dont understand, ask here or send clarification (while contest)

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

              What exactly you suggest? Magically improve the skills of existing translator or hiring a new one?

              But you know the amount of work is not sufficient to hire full-time employee. At the same time it is not possible to hire the same free-lancer for short job each time. So it will be necessary to rely upon several at least.

              And it is not easy since CF team is deeply concerned of keeping the problem statements in secret.

              You wanna make something, make it the best possible or don't.

              I think it is too bold and too careless statement. If understood literally that means you and me should not participate in this round, since we did not get in top-5 :D

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

                I think I missed (or at least die trying) in my statement :D. This problem (poorly translated or vague statements) has been around for a big while now (along with other problems, like the increase in number of cheaters, servers' outages, etc) and I believe that the time is overdue to consider a solution for this! I really believe that this should be taken into consideration. I know it's a bit unfair, but I always compare Codeforces to TopCoder. TopCoder is a very big company with big resources comparing to Codeforces, but I do really believe in Codeforces and their potential to become as good as them someday, all it takes is just paying attention to their users' feedback to improve the platform.

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

Nice problems and nice contest...!!! Thanks to authors...

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

Что не так с таким решением в С? У нас есть множества с одинаковым значением в массиве d. Если ноль стоит у более, чем одной вершины, то -1. Если "пропущено" какое-то значение в d, то -1. Далее пытаемся построить граф: проводим рёбра в множество со значением d на единицу больше, пытаясь минимизировать число исходящих ребер. Так проделаем последовательно для всех d. Проверим количества рёбер, обойдём граф и сравним массивы d.

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

Hi Igor_Kudryashov, I can not understand the reason behind giving constraints of length of string being upto 1e6 in problem D. I think you could have checked peoples logic even with the length being 1e5 and it would have let dp solution with slightly more space pass in the contest (eg mine) !!

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

One round with problems descriptions containing so many unspecified points.

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

was it just me, or is the statement of problem B a bit too complicated to understand?
IMO, either the statement should have been worded a bit easier to understand, or the second example case should have been explained (preferably with diagram).

unless, ofcourse, this problem was intentionally designed so that everybody spends more time understanding the statement than coming up with the solution! :P

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

Как-то грустно, что уточнение условия по C пришло спустя >30 мин после начала. До этого, получается, решал другую задачу. Думаю, не я один такой.

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

    Мне кажется, это вполне естественно, что если граф невзвешенный, то расстояние — это количество ребер в кратчайшем пути. Какое другое понимание возможно?

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

      Просто про "невзвешенность" не сказано нигде. Правда, по-моему, что граф невзвешенный итак из условия понятно было...)

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

        Действительно, про "невзвешенность" сказано не было. Перечитывая условия и ограничения теперь уже очевидно, что граф невзвешенный. Однако, на контесте первая мысль была почему-то другой. Сразу думалось в сторону inverse-SSSP. Надо было лучше читать условие. С другой стороны, если все так очевидно, то зачем была рассылка?

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

          Рассылка была "на всякий случай". Видите, оказалось, что помогло кому-то. =)

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

Really nice problemset!
But some statements in English were a bit hard to understand for me.
Unfortunately I spent 35 minutes debugging my code for problem B and replacing cout with printf made my code pass the pretests!
I can't believe why printf is faster than cout this way! Although I used ios_base::sync_with_stdio(false); and I thought it makes cout work as fast as printf. Also printf and cout both used the same time to print in my system.
Can anyone explain this diffrence to me?

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

Why didn't they update the problem statement of 404C - Восстановите граф when there was an announcement?

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

so sad failed at final system test, at problem c, just because didnt check the number of edges at vertex 1 :(

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

    And I failed because I didnt use long to check for (k-1)freq[i] <= freq[i — 1]. :(

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

      warm_hug sigh, currently i rarely got 1 shot ac :(

      hope do well next contest :D

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

A lot of people failed test 29 on C. Is there any way to see the entire case? There seem to be ellipses at the end of the description.

Or does anyone have an explanation?

Any help would be appreciated :)

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

Незнаю, что не так сделал — B (тест 8) — 6080228

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

    le:=i*d;

    Похоже, переполнение longint-а.

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

      А как правельно? Как непереполнить?

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

        нуу можно использовать двоичное умножение по модулю, но намного проще вместо LongInt'a написать Int64

        Int64 < 9*(10^18)

        LongInt < 2*(10^9)

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

It's time to change my nickname to FakeRalor

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

    I know that feeling bro :D :D, I couldn't solve A, B and my solution for C failed because of a stupid bug!

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

I don't really understand the complaints; I thought problems were pretty clear and well-written, though I do agree problem statement of C should have been changed following the announcement. Seems to me that people are quick to blame the language when problems are hard(er than usual).

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

я знаю, что не так сделал.. в качестве IDE выбрал VS вместо GNU один и тот де код дал AC и WA17

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

Igor_Kudryashov,Gerald

Congratulations, very nice problems. :)

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

Объясните почему ВА? Ведь с каждой вершины выходит не более k вершин. Вот решение — 6080015

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

    раз четверка встречается 4 раза в ответе, значит и степень у нее 4 (k=3). Хотя чекер почему то сказал что это у третьей.

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

      Но выходит-то 3 вершины, а не 4. "из каждой его вершины исходило не более k ребер"

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

      Может чекер не переводил в 1-индексацию

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

Did anyone else get WA for test 29 in Problem C? The test case is too long (and hence truncated) which is why I can't test it locally.

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

    UPD: Try this test case: "000??1?1"

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

      Isn't that a test case for Problem D? Could you provide one for Problem C too?

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

    The WA was because of integer overflow when multiplying (k-1) and the number of vertices in the previous layer (i.e. when checking the condition (n(l)<=n(l-1)*(k-1)), where n(l) represents the number of vertices in the layer l). Casting into long long before performing the multiplication resolved the error.

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

Hi,Igor_Kudryashov!First,thank you for preparing this contest! But I have a question with the judgement of 404B - Марафон I don't think that there is any trueness error in my solution ,and I think the answer has.(I used __int64 to avoid it.because the date of a and d are given with precision till 4 decimal digits after the decimal point ,we can use a * 100000000 to transform double to __int64 to avoid the precision problem).But I just cannot make it. Could you please take a look at my code? Thank you very much!!!

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

i have noticed this for the last 5-6 contests. system testing finishes very fast, but rating takes a lot of time to be updated. why is this so?

EDIT: ratings updated! :)

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

Thank You Igor_Kudryashov and Gerald for this round..

Off-topic: Sometimes after ending the contest i feel like i am an big donkey. The masters solves all problem in 1.5 hours.. And I can not solve more than one in two hours. It feels likes i am low brain animal.. This one is one of them..

Will have to learn many things still. Hope to learn somethings from the tutorial.

:)

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

    There is no good trainer or participant with rating 1600-1700+ in your university, there is an answer. Sometimes it's a question of 5-10 seconds to learn something important from those who knows more.

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

      Yeap.. Brother. I know. But unfortunately not every one have the chance....

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

Could somebody please explain on why this answer is accepted but this one is not for problem B.

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

    Because int(975910353.9999999) is not equal to 975910354. Do not forget to round before converting to int: replace int(float(...)) by int(round(float(...))

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

      Thanks! But the problem says a and d (1 ≤ a, d ≤ 100000), given with precision till 4 decimal digits after the decimal point. So it should only contains 975910353.9999 but no 975910353.9999999?

      UPD You're right. I finally understand after reading this. Thanks a lot!

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

Congrats ! It was a nice set of problems and the tutorial came very fast. I particularly liked problem C due to the fact you had to think how to implement it in a simple way. I also liked E because it was quite original from my point of view.

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

i think that this is the first time in history of CF, where user who is placed in first position has failed A and B! :D
even so, congrats to Pkqs09! :)

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

For my submission 6082618, the checker comment (for test 5) seems wrong.

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

    your 4th vertex has more than 3 edges. It should be 3 or less

    UPD : okay maybe comment need some correction

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

    i think checker comment is 0-indexed. i agree that it seems confusing, because problem asks us to output vertices in 1-indexed fashion.

    but the verdict of WA is correct, because ur vertex 4 has degree > 3, which is not allowed.

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

Может кто подсказать? Почему у меня вторая задача на мониторе помечена, как еще не прошедшая тестирование, хотя по его итогам она прошла все тесты?

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

Никто не подскажет, по какой причине у меня зашедшая D отображается как "?" в мониторе?

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

Wow! Some cells in Standings still show '?' and even if they are actually AC, no points are given!

Edit: Standings was fixed, and ratings were re-updated. I am relieved.

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

where is my D ?

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

вопрос снят.

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

fixed

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

This is so strange, I found out why my B submission wasn't working My idea was to convert all doubles to ints by multiplying by 10^4 (because the statement said that was the most precise they would be given in) just to be safe in case of errors.

I have #define SC 10000 as my scale factor This is my testing code to find the bug:

cout<<"*"<<dd<<endl;
cout<<"**"<<dd*SC<<endl;
cout<<"***"<<(int)(dd*SC)<<endl;
cout<<"****"<<d<<endl;

Where dd is the distance read in as a double And d is the distance converted into an int after being scaled up

On my computer, I get this:

*2.8819
**28819
***28819
****28819

On codeforces, I get this:

*2.8819
**28819
***28818
****28818

For some reason only on the codeforces server, it's converting 28819.0 to 28818?

My erroring submission is here: http://codeforces.com/contest/404/submission/6079213

Does anyone know why this is or how it can be fixed?

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

    This is because of round off error

    the float output of 2.8819*10000.0 is like that 28818.99999

    try adding small value like 0.00001 to dd*SC

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

      Ah ok. So it was the rounding.

      How come when I run this on the server printf("%.6lf\n",2.8819*10000); my output is 28819.000000 ?

      Thanks for your help.

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

There is -1 change in the ratings of the contestants since last night rating update. Last night when i logged out mine was 1588 after the update but its 1587 now. Some of my friends also have -1 rating down. Was the rating re-evaluated due to some error in rating update ? or something else ?

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

    apparently there was some issue with system testing due to which some solutions were not tested (relevant comment).
    so i guess some of these solutions got AC and resulted in a big increase in a few users' position (and, consequently, small decrease in some others'). due to this the ratings had to be re-updated.

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

someone explain me why this code (problem C) gets runtime eror ... 6088745

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

Perfect round! I love codeforces. It gives me a lot of new skills. And you?

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

Hey i have one question,

In Question Restore Graph Tutorials say that there would be a tree then why they have mentioned edge 3 2 in first test case? I think we do not need that edge,

Thanks :)

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

    the only simplest answer is a tree. any code which doesnt print that edge 3 2 (like mine 6077747) will get AC.
    about why it was given in the first place, i guess it was to make the contestants think a bit more, rather than just look at sample input/output and get the approach straightaway!