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

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

Привет, Codeforces!

30 июня 2015 года в 18:00 MSK состоится очередной раунд Codeforces #311 для участников из второго дивизиона. Традиционно, участники из первого дивизиона приглашаются поучаствовать в соревновании вне конкурса. Обратите внимание на необычное время начала раунда!

Это мой четвертый Codeforces раунд, желаю всем быстрых и главное полных решений!

Хотелось бы сказать большое спасибо Максиму Ахмедову (Zlobober) за помощь в подготовке задач, Марии Беловой (Delinur) за перевод условий на английский, Михаилу Мирзаянову (MikeMirzayanov) за замечательные системы Codeforces и Polygon и за помощь в придумывании задач, а также моим друзьям Илье Лось (IlyaLos) и Данилу Сагунову (danilka.pro) за прорешивание задач и вычитывание условий.

Участникам будет предложено пять задач и два часа на их решение. Разбалловка будет объявлена позднее.

UPD Разбалловка задач стандартная 500-1000-1500-2000-2500. Всем удачи!

UPD2 Соревнование завершено! Всем спасибо!

UPD3 здесь вы можете найти разбор задач.

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

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

We like your problems a lot, hoping for some more nice problems

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

Hoping that the problems' difficulty will be contantly increasing(like they were in your last round #297) not something like first two problems are extremely easy and the third a lot harder.

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

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

Why this contest starts in the unusual time???

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

Внезапно задумался... Помнится, недавно был топик, где раскрывали истории никнеймов таргетов и не только. А вот о Delinur никто и не вспомнил. А ведь интересно же.

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

    У нее просто рейтинг низкий, никто не обращает внимания на новичков((( ей нужно старатся и больше решать всяких задач по програмированию...

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

Will it be another dynamic scoring contest? I guess so.

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

Just one request , please make the problem statements clear and don't name the characters something like "**matryoshka**" . Its very annoying when you are not sure of the problem statement and on top of that the characters have such unpronounceable names.

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

    you can ignore the character's name

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

      Surely , but you will agree that it is annoying .

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

        yes but sometimes they use some weird words or names to confuse you and actually they're not part of the problem and u should focus on the main idea .

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

          Its your point of view , personally i believe that a good problem should give the participant a hard time in figuring out the solution not in figuring out what the problem actually wants from us.

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

            i have taken part in 5 regional contests and 6 or more other onsite contests in the past 3 years and I've seen a lot of problems which had weird names or even they explain something that just a story for fun and they're not part of main problem so after u see them you just ignore them . you know , they're just part of the contest not important.

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

      The story is not irrelevant as it gives us a real life problem. But one should keep it in mind to not let the story make the problem confusing. People has to read all of the statement and a big story with complicated characters and stuffs can mess up a contestant's head.

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

    I don't agree. As a programmer you must be able to convert "real" problem (with legend, weird names and everything) to math/coding one. That's just IMHO, but as for me — legend is a good part of problem.

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

    Matryoshka is a real thing... I think all the "weird" names are real, maybe they are just not common in your country.

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

Yout last round was awesome. Especially the problem Round 297 B with a weak pretests.

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

return of the unrated's

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

Hope to see harder and of course more balanced problems than your last contests :D

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

    who the hell are you? :|
    what did i do to you?
    what made you do such a retarded thing?
    guys in our language this guys handle name is a swear and his name is "arash mahmoodian"
    strange thing though what a small universe it is when you can find someone with the same name and same organization

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

    OK, guy. I'll try to do it!

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

    nice at least you changed your name
    don't make shitty account like this anymore
    of course this was just a suggestion i don't give a damn or two about you

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

    Surely div1 user

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

Привет учасники! Удачи сегодня на саревнованиях! Хочу рейтинг выше.

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

ПАЦАНЫ и ДЕВЧАТА))), зайдите в тему пожалуста на минуту всего!!!! http://codeforces.com/blog/entry/18977

ВЫРУЧАЙТЕ, ахахаха!!)))) спасибо!!))))))))))

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

i am newly in this website,can anyone tell me how to practice before contest??

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

Please try to minimize the description of problems statements. Although your problems are interesting, they are too long for non native English speakers

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

Wish u happy coding;)

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

I have a problem, I can't submit my solution today.

it's getting "Network error" when after I submit my solution.

any advice?

thanks.

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

hello to all. i think for muslims that they're rozeh* , they cannot take contest well!! please delay the contest for 2 hours.

rozeh: it means that you don't eat and drink from morning(sunrise) to night(sunset). it's a necessary for muslims!

thanks to all.

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

hello to all. i think for muslims that they're rozeh* , they cannot take contest well!! please delay the contest for 2 hours.

rozeh: it means that you don't eat and drink from morning(sunrise) to night(sunset). it's a necessary for muslims!

thanks to all.

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

    Not all muslims live in your timezone. This kind of generalization is stupid. I'm a muslim, and this time is better for me.

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

      if the time delays it doesn't make any problem for you but that solve a problem for me!

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

        You're wrong. It makes problem for me. My iftar gets in the middle of the contest. But I never whined like you because I know that this issue is relevant for small minority. Current time change benefits every muslim user from Turkey. Of course, you can say that number of users from Iran is greater than Turkey, but if we think that way, number of muslim users is less than others. They can't arrange a round according to minority. It's impossible to make everyone happy. If time is not suitable for you, you can always virtually participate.

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

          No. if it delays for just 1:15 hour it doesn't make any problem for not muslims users!! but it solve a problem for most of the muslims!

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

            You said it doesn't make any problem for you, and I simply explained why it makes a problem for me. And now you're saying "No. if it delays for just 1:15 hour it doesn't make any problem for not muslims users!!" I kindly want to remind you that I'm a muslim, and I already stated that in my first post. I already answered why it's a bad idea to want them to change time, that's why I'm gonna stop answering. I think you reply even before reading my answer.

            Btw, how do you know that it doesn't make any difference for all other users? Do you know all of them? Do you know their schedules or their plans? Everybody has their problems, but it's just you who complains.

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

              what are you saying?

              i reply that comment for this part of you comment!

              " Of course, you can say that number of users from Iran is greater than Turkey, but if we think that way, number of muslim users is less than others. They can't arrange a round according to minority" ;)

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

      there are more that 200 million muslims in my time zone or near to me. but because you are near to europe musllims are not a lot!. note that all of Turkiye people are not muslim! i think understanding this that i spoke about all of muslims is more stupid!! i spoke about most of muslims!

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

        You didn't say most of muslims. You said muslims. And that statement implies what I said.

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

          i'm sorry because the argue but it's important never comment doesn't make any sense!

          if my comment get 1000 likes there would n't be any time changing!

          thank for thinking about my comments!

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

The last codeforces round was the first time I tried to hack people , but the problem was that I couldn't

highlight the code ( to copy-paste it in my computer) is this made by purpose ?

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

Congrats unrated ones! One of you will probably win this thing (

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

usual time or unusual time This is a Question!!!

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

Standard scoring!! Awesome.

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

Have a nice contest,bless all!

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

May the God fold comments over 5 indent levels...

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

good luck and have fun guys :D

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

Well, I read some comments... and I was like WTF? Whats goin on here... ?? M never ever gonna read comments on CF #Round Invitation. (Period)

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

Ooops, it started 1.5 hours early than usual :)

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

I feel as if the author mistook the round as Div 1. Just saying

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

How to solve problem C?

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

    I'm not sure if my approach is totally correct. My algorithm is somehow greedy, I try to make each possible leg length the maximum one. In order to do this, you need to remove all the legs with a greater length than the current one. Then, for this new configuration valid, you could only have 2 times the amount of the legs of the current length — 1, to satisfy the problem requirements. So greedily, you have to keep in this new configuration the legs that cost the most to be removed and are shorter than the current one and take out the remaining ones (pay for them to be removed).

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

    First you choose your max value , after that you can see the next observations :

    • it is better to take the most quantity of elements with this max value.
    • the values greater than max value are not considered
    • the values lesser than max value are considered

    Let F = frecuency of the fixed max value then you can choose at most F — 1 of this lesser values , you choose the better F — 1.

    If you sort like pairs , you can build a simple algorithm with an heap

    Implementation: Link

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

Did anyone else write binary search for B? I used 500 iterations and I wonder if it will pass...

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

I was stuck counting quadrilaterals in D. Can anyone give me a hint?

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

What was the solution for Div 2 C? I couldn't figure it out

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

    I think it was greedy: search for all lengths L what is the cost to produce a stable table with L as the max length. Fixed L, you should remove all the legs with length>L; if now is stable compute the cost, otherwise start removing legs with length<L with less cost until you have a stable table. I think that can be implemented with a priority_queue.

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

    My solution is as follows: Let's say we want to 'select' legs. You have to maximize the sum of energy of selected legs. For every length l, consider it is the maximum. We would have selected a certain amount of legs with length l, let's say x. Then we can select (x-1) legs (at most) that are shorter than l. Those (x-1) legs should be maximum in energy.

    Because the d limit is quite small, you can look from 200 to 1, select no more than x legs that are shorter than l. So you just have to sort the legs by length and count.

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

    There is only one div in this occation. So the specification is not needed. The primary reason I post here is so that I can read when someone explains how to solve the problem though.

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

Submitted a previous round's A problem by accident.. sigh. On the bright side, solutions are already up, wow!

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

    Same thing happened to me... I was very surprised when the judge told me my solution had exceeded the memory limit.

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

Good contest with good scoring distribution , nice and understandable problems .

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

It is my first time to receive a message "thanks for hack" in a round. It feels very good!

@Cyber Thank you, too.

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

Thanks for an interesting problemset. But it would be even more interesting in case there were more possibilities for challenges :)

Upd. Oh, I was wrong, in fact there were quite a lot of solutions to hack (especially B's with wrong output format) :)

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

I've been training a lot and level C problems are starting to look as hard as Level B problems did for me about 2 months ago. Progress feels great! Thanks for the problems!

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

Really challenging round, thanks ;)

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

    а на чем можно было взломать А?

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

      По-моему, как и все задачи, только на криворукости или невнимательности конкретного участника.

      UPD: А нет, я не прав, B и C попадали на тестах у большого числа участников.

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

        Я взломал именно неправильное решение по В на тесте
        3 18
        1 1 1 1 1 5
        ребята работали с max и min...

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

      Да там у парня опечатка была — он жадно пытался увеличить количество дипломов первой степени до максимального количества дипломов второй степени.

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

for B isn't answer min(w , 3.0*n*min(arr[0],arr[n]/2.0)) on sorted array ? Or Is binary search the only way to go ?

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

To all cout lovers: Wrong answer is in coming! :(

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

I forgot to use "setprecision" on B using cout. Nice!!!!

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

I am feeling very very sad. Just used cout instead of scanf and got wa on test 32 :(

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

very nice contest (specially problem D ) but I hate working with doubles :\

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

Anyone else fail B because of precision error?

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

    Of course... me, you and a couple hundreds more.. used 1e-9 for binary search and printed exactly 6 digits.. got acc after round only after using 1e-11 and printed 8digits

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

      but 1e-6 error should be accepted, isn't it?

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

        If you used cout, your error on test 32 is 4.7*(1e-6), which is greater than 1e-6. Hence, the solution failed.

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

First i used this :

cout<<ans; (ans is of type long double) I got wrong answer.

Then i changed it to :

printf("%lf",(double)ans); Got AC.

Double and long double have precision upto 6 digits.So, printf gave AC. But , what is the problem with cout?

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

wrong answer on test 32 used setprecision got it accepted :(

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

can anyone please explain why using %0.9lf with printf gives TLE on pretext 8 while %0.7lf passes in 1/10th time.(second last line) passed solution with %0.7lf — 11862093. TLED solution with %0.9lf — 11861535

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

use printf instead of cout for better precision or use setprecision with cout

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

I am not able to figure out what could be wrong with my code for problem B. Could someone help me track the error in this submission?11859368

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

    Add cout.precision(10);

    Here is your AC code: 11868422

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

      Hi, thanks for your prompt reply! Could you provide a bit insight as to why this was required, and why not using this gave me a wrong answer?

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

      I got the reason. Cout apparently has lower precision by default. Didn't realize this during the contest. Thanks!

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

    rather going for binary search apply little math and answer is just 2 line code

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

      Have a look again man. I used it at first, but then removed it. The function is still there, but it is not being called anywhere.

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

          I think you did not want to look at the submission and go through the logic before commenting this.

          Just to let you know, I have figured out the error, thanks to minimario. The error was not in the logic, but in the precision. I did not know that the precision of cout by default was less than 10, and so, didn't realize that it should be explicitly changed.

          Giving a link to your own submission is the least helpful way when someone asks why his code doesn't work.

  • »
    »
    9 лет назад, # ^ |
      Проголосовать: нравится 0 Проголосовать: не нравится
    cout<<fixed<<setprecision(10);
    
»
9 лет назад, # |
  Проголосовать: нравится 0 Проголосовать: не нравится

DIV2 ProbB — My solution came wrong just bcz I did not use set precision :( .If possible can anyone explain how set precision is helping in getting the problem accepted.

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

can anyone tell me why my submission getting TLE ..ON Nlog(N) time complexity in problem B my solution is #include<bits/stdc++.h> using namespace std; long double Ar[200005]; int main(){ long double n1,m,w,k,mn,mx,x; long long int n,i; cin>>n>>w; n1=n; for(i=0;i<(2*n);i++)cin>>Ar[i]; sort(Ar,Ar+(2*n)); mn=min(Ar[0],(Ar[n]/2)); x=w/(3*n1); x=min(x,mn); m=(3*n1*x); cout<<m; return 0; }

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

Hi guys, can someone suggest where i might haved made a mistake in this submission http://codeforces.com/contest/557/submission/11868290 Thanks

  • »
    »
    9 лет назад, # ^ |
      Проголосовать: нравится 0 Проголосовать: не нравится
    1. Use scanner and System.out.println, as they are much faster to type(You can use a macro for System.out.println) and less prone to errors
    2. Once you read in the data, you have to sort the array because binary search only works on monotonous intervals
    • »
      »
      »
      9 лет назад, # ^ |
        Проголосовать: нравится 0 Проголосовать: не нравится

      Scanner is slow. It's better to parse the input, but you don't need to write it every time.

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

wrong answer 1st numbers differ — expected: '106798500.0000000', found: '106798000.0000000', error = '0.0000047'

Что? Это потому, что 47 — счастливое число из цифр 4 и 7?

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

Has anyone else notice that ios_base::sync_with_stdio(0);cin.tie(0); is not working(almost) anymore in CF?
I've seen cin,cout is slower in CF comparing to other judges. But this much? My B was a narrow escape.
using scanf 155 ms
using cin 904 ms
Is this because of some recent changes in system or it was always like this and i never noticed?!

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

Any one can help to find out what is wrong with my program? I got a wrong answer a large input but I run the same input in my computer it is ok.

The problem seems to be overflow on something but I cannot find it out.

11854334

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

Ratings up

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

So I originally misread problem B, and missed the fact that all of the boys had to have the same amount, and all of the girls had to have the same amount in their cups. If we removed this restriction, what would be the solution to the problem then? Is it NP complete or is there some algo? Any insight would be appreciated.

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

Finally Division 1!!!

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

My solutions were skipped! Why!!!

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

    This was because the exact solutions you submitted were already submitted by someone else. So either your luck is really bad(2 skipped problems), or you copied someone else's codes.

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

      Not so bad luck! One of those solutions gave wrong answer....so whichever poor guy's solution matched is the unlucky one(probably, assuming he didn't change his code because the pretests were passed)

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

        If someone's solution gets skipped, then this means their solutions matched before system testing as well. Why can't the system detect this and give skipped verdict instead of pretests passed? Even the biggest cheaters would tweak their copied codes a little so it doesn't get skipped. The only people who get affected are innocent (imo) because they had no idea their coding style is so obvious (

        Do something about this Mike. On some other day, I'd be really sad if this happened.

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

      I did not copy anyone's code. Next time I'll remember to set my ideone submissions to private.

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

getting tle on 2nd question for 8th test case .. can anyone please tell what should i change in my code to get accepted ..here is the solution link http://codeforces.com/contest/557/submission/11869859

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

    improve i/o 11870141

    add ios_base::sync_with_stdio(false);cin.tie(0);cout.tie(0);

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

    2nd problem is input intensive, so using cin stream slows down the code, and also std::vector is much slower than plain arrays, as vectors have to spend more time resizing...in such tasks you'll be better off using printf, scanf as well as bare boned data structures. u can also use ios_base::sync_with_stdio(false); in the beginning of your main function.

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

http://codeforces.com/contest/557/submission/11870535

Getting correct answer(2) on the first case on my computer but 0 on it on codeforces servers? This is the first time I'm submitting a solution in c++, so maybe I'm missing something.

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

Can someone, please, tell me what's wrong with my code for C? It gives the correct answer with all the small cases so I cannot debug it. At least some test case that won't pass with it.

I wrote a lot of comments to make it easy to understand: http://codeforces.com/contest/557/submission/11870567

The idea is basically the same as the author:

  1. Precalculate cost of removing all legs of larger size
  2. Iterate over each leg size, removing larger ones in O(1)
  3. Keep a Priority Queue with the legs of lower size to obtain the largest ones in lg(n)
  4. Obtain from the priority queue a number of legs strictly lower than the number of legs of the current size (which won't be deleted)
  5. Minimum Energy Used = min(currentMin, energy of larger + energy of lower — energy of non-removed legs

Thank you very much in advance!

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

Did anyone get AC in B using binary search??

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

Problems are really interesting but statements are quite hard to understand. I've fun solving them but I think it will be better if you make the statement simple (IMO).

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

Извените, но я все еще никак не могу понять почему в задачке "Артур и стол" в третьем тесте ответ 8 ? Заранее спасибо =))

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

    Берём две ножки длины 2. Откручиваем две ножки длины 3 и одну длиной 1.

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

      о, спасибо что ответили =) То, что нужно открутить две ножки длины 3 я поняла. А вот для чего откручиваем еще одну ножку длины 1. Если мы просто уберем две ножки длины 3. как раз из оставшихся 4-ех ножек остаются 2 ножки максимальной длины 2 . Вот чего я никак не могу опять =)))

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

        Там есть требование "Стол с k ножками считается устойчивым, если ножек максимальной длины строго больше половины".