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

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

Привет, 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
  • Проголосовать: не нравится

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

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

»
11 лет назад, скрыть # |
 
Проголосовать: нравится +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.

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

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

Why this contest starts in the unusual time???

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

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

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

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

»
11 лет назад, скрыть # |
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.

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

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

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

return of the unrated's

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

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

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

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

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

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

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

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

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

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

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

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

Wish u happy coding;)

»
11 лет назад, скрыть # |
 
Проголосовать: нравится 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.

»
11 лет назад, скрыть # |
 
Проголосовать: нравится 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.

»
11 лет назад, скрыть # |
 
Проголосовать: нравится -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.

  • »
    »
    11 лет назад, скрыть # ^ |
     
    Проголосовать: нравится +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.

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

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

      • »
        »
        »
        »
        11 лет назад, скрыть # ^ |
        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.

        • »
          »
          »
          »
          »
          11 лет назад, скрыть # ^ |
           
          Проголосовать: нравится -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!

          • »
            »
            »
            »
            »
            »
            11 лет назад, скрыть # ^ |
            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.

            • »
              »
              »
              »
              »
              »
              »
              11 лет назад, скрыть # ^ |
               
              Проголосовать: нравится -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" ;)

    • »
      »
      »
      11 лет назад, скрыть # ^ |
       
      Проголосовать: нравится -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!

»
11 лет назад, скрыть # |
 
Проголосовать: нравится 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 ?

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

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

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

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

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

Standard scoring!! Awesome.

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

Have a nice contest,bless all!

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

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

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

good luck and have fun guys :D

»
11 лет назад, скрыть # |
 
Проголосовать: нравится +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)

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

Ooops, it started 1.5 hours early than usual :)

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

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

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

How to solve problem C?

  • »
    »
    11 лет назад, скрыть # ^ |
     
    Проголосовать: нравится +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).

  • »
    »
    11 лет назад, скрыть # ^ |
    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

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

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

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

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

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

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

  • »
    »
    11 лет назад, скрыть # ^ |
     
    Проголосовать: нравится +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.

  • »
    »
    11 лет назад, скрыть # ^ |
     
    Проголосовать: нравится +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.

  • »
    »
    11 лет назад, скрыть # ^ |
     
    Проголосовать: нравится 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.

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

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

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

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

»
11 лет назад, скрыть # |
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.

»
11 лет назад, скрыть # |
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) :)

»
11 лет назад, скрыть # |
 
Проголосовать: нравится +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!

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

Really challenging round, thanks ;)

»
11 лет назад, скрыть # |
 
Проголосовать: нравится 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 ?

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

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

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

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

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

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

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

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

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

Anyone else fail B because of precision error?

»
11 лет назад, скрыть # |
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?

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

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

»
11 лет назад, скрыть # |
 
Проголосовать: нравится 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

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

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

»
11 лет назад, скрыть # |
 
Проголосовать: нравится +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

»
11 лет назад, скрыть # |
 
Проголосовать: нравится 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.

»
11 лет назад, скрыть # |
 
Проголосовать: нравится 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; }

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

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

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

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

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

»
11 лет назад, скрыть # |
 
Проголосовать: нравится +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?!

»
11 лет назад, скрыть # |
 
Проголосовать: нравится 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

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

Ratings up

»
11 лет назад, скрыть # |
 
Проголосовать: нравится 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.

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

Finally Division 1!!!

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

My solutions were skipped! Why!!!

»
11 лет назад, скрыть # |
 
Проголосовать: нравится 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://mirror.codeforces.com/contest/557/submission/11869859

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

http://mirror.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.

»
11 лет назад, скрыть # |
 
Проголосовать: нравится 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://mirror.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!

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

Did anyone get AC in B using binary search??

»
11 лет назад, скрыть # |
 
Проголосовать: нравится 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).

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

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

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

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

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

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

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

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