MikeMirzayanov's blog

By MikeMirzayanov, 8 years ago, In English,
Hello again. I hope nobody has forgotten to register?

In this contest we will try alpha of our chat - if something goes wrong, we turn it off: please do not panic:)

Links:
Problemsetters: Дмитрий Матов и Игорь Кудряшов. Thank them for their contributions.

I wish you to advance to the first division.
Mike Mirzayanov.
 
 
 
 
  • Vote: I like it  
  • +9
  • Vote: I do not like it  

8 years ago, # |
  Vote: I like it 0 Vote: I do not like it
Is problem solution available
  • 8 years ago, # ^ |
      Vote: I like it 0 Vote: I do not like it
    Yep
    • 8 years ago, # ^ |
        Vote: I like it 0 Vote: I do not like it
      Это не по теме . . . У меня гугловский браузер когда захожу на страничку рейтинг,то таблица вылазит за свои приделы,закрывая область моего профиля... это так и должно быть или я туплю? 
      • 8 years ago, # ^ |
          Vote: I like it 0 Vote: I do not like it
        Это у многих так... будет переделываться потом. Но странно что у тебя глючит.. на моём хроме всё норм
        • 8 years ago, # ^ |
            Vote: I like it 0 Vote: I do not like it
          Видимо зависит от разрешения. На 1280 нормально, но на разрешениях меньше могут быть проблемы.
          • 8 years ago, # ^ |
              Vote: I like it 0 Vote: I do not like it
            Конечно зависит. А ещё и от браузера. У меня уже после восьмого раунда проблемы начались. 1024.
          • 8 years ago, # ^ |
              Vote: I like it 0 Vote: I do not like it
            Кстати, такой вопрос:
            а смысл делать так
            Указывает на одну тему, но почему разница на 10?
            • 8 years ago, # ^ |
                Vote: I like it 0 Vote: I do not like it

              Ага, есть такая бага.

              Проблема в том, что во второй ссылке темы не видно, первого собщения.


              Вторые сообщения приходят на почту.

              • 8 years ago, # ^ |
                  Vote: I like it 0 Vote: I do not like it
                Переписывался с Майком, оказывается всё просто. Комменты это отдельный объект который привязан к другому объекту. Это может быть топик блога, может быть обсуждением задачи и т.д. Т.е. эти ссылки никакой связи не имеют.
            • 8 years ago, # ^ |
                Vote: I like it 0 Vote: I do not like it

              Тогда хорошо было бы видеть то, у чему привязан комментарий.

              Спасибо за ответ.

              • 8 years ago, # ^ |
                  Vote: I like it 0 Vote: I do not like it
                Ну это уже довольно старая тема, что из мыла нет редиректа сразу к топику. Опять же спрашивал на эту тему, насколько я понял там какая то принципиальная проблема.
            • 8 years ago, # ^ |
                Vote: I like it 0 Vote: I do not like it

              Я не про редирект к топику из мыла.

              Я про то, чтобы к странице комментариев сверху прикручивался оригинальный пост.

              Кстати мы с тобой обсуждаем это не в той теме и в английской ветке к тому же...

              • 8 years ago, # ^ |
                  Vote: I like it 0 Vote: I do not like it
                :-D Есть такое. 
                Не в том дело. Прикрутить ссылку просто так незя. Там как то надо хитро подумать на сколько я понял. В общем это видимо в туду. :)
  • 8 years ago, # ^ |
      Vote: I like it 0 Vote: I do not like it
    I anderstend but it's very interesing for me) 
8 years ago, # |
  Vote: I like it 0 Vote: I do not like it

can anyone tell me in problem b  why we cant take m as integer and although m is given as integer

but if i am taking m as integer i am getting wrong answer. although  in problem statement  it is goven that  m may have leading zeros  but m is integer  so  no meaning of leading zeros.. so can any one tell me correct thing

  • 8 years ago, # ^ |
      Vote: I like it 0 Vote: I do not like it

    00
    0
    wrong
    4
    004
    wrong
    you can accept

    • 8 years ago, # ^ |
        Vote: I like it 0 Vote: I do not like it

      but  y u r taking m as string m is given as integer in Question itself

      i know wth string it is a accpeted submission .

      but i m asking y we have to take m as string wen it is given as integer

      • 8 years ago, # ^ |
          Vote: I like it 0 Vote: I do not like it

        for example
        4
        004
        if the second line you put in by integer you will get 4,not 004
        so your answer maybe "YES",bu it is wrong.so you have to put in by string

        • 2 years ago, # ^ |
          Rev. 2   Vote: I like it 0 Vote: I do not like it

          It doesn't make any sense logically... if his brother has give four as a random number.. he can say 004 as result his leading zeros doesn't make count... value is as minimal as possible...

          sorry got it... using digits in number...he can't any new ones

      • 8 years ago, # ^ |
          Vote: I like it 0 Vote: I do not like it
        when you put in by integer,the lead zero will lost.
    • 8 years ago, # ^ |
        Vote: I like it 0 Vote: I do not like it
      wrong  case № 1! because in first line can not be  "00"  )
8 years ago, # |
  Vote: I like it 0 Vote: I do not like it

can anyone tell me in problem b  why we cant take m as integer and although m is given as integer

but if i am taking m as integer i am getting wrong answer. although  in problem statement  it is goven that  m may have leading zeros  but m is integer  so  no meaning of leading zeros.. so can any one tell me correct thing

  • 8 years ago, # ^ |
      Vote: I like it 0 Vote: I do not like it

    Leading zeros in M are very important, because they "take part" at constructing minimal number

    for example: M = 0123. minimal number is 1023. If you escape leading zeros in reading M you lost Zeros in result.

    • 8 years ago, # ^ |
        Vote: I like it 0 Vote: I do not like it

      first thing we dont have to find  answer for m we have to fing=d minimal number for n .

      so  ur example is nt correct

      i m asking here that what is importance of leading zeroes in an  integer 

      • 8 years ago, # ^ |
          Vote: I like it 0 Vote: I do not like it
        If you take m as an integer, there should not be any problems. Make sure you don't take n as an integer.
        • 8 years ago, # ^ |
            Vote: I like it 0 Vote: I do not like it
          Sorry, in the previous post I thought about I/O problem. But here is an algorithmic mistake, as explained in posts below.
  • 8 years ago, # ^ |
      Vote: I like it 0 Vote: I do not like it
    n - 100% integer but m  may have leading zeros and why i think we can use string. You are right , in problem statement  it is goven that  m may have leading zeros  but in problem statement  it is goven that right answer must be integer;
    • 8 years ago, # ^ |
        Vote: I like it 0 Vote: I do not like it
      Yes, but Zeros at M MUST be at result
8 years ago, # |
  Vote: I like it 0 Vote: I do not like it
Sometimes providing corner cases helps much.
    I missed one such case in Problem B. Finally got ac just after the contest.
  • 8 years ago, # ^ |
      Vote: I like it 0 Vote: I do not like it
    You can omit all corner cases if you read first integer as a string and sort it. Then you can just exchange first 0 with first digit != 0.
  • 8 years ago, # ^ |
      Vote: I like it 0 Vote: I do not like it
    *first leading 0
8 years ago, # |
  Vote: I like it +5 Vote: I do not like it
Hello,

I could not find enough explanation about the standing page, in particular:
- what does the penalty represent ?
- for each problem, I finally understood that I have to click on the "+" or negative number but is there a specific penalty for each failed submission ?
(is there a forum for questions related to problems ? I am quite curious about case 9 for problem B - Correct Solution)

It was my fist participation and I really enjoy the web site and how it works, thanks a lot !!
8 years ago, # |
  Vote: I like it +1 Vote: I do not like it
E:

for
(i=0;i<n-1;i++)for(j=0;j<n-1;j++)a[i][j]=1+(i+j)%(n-1);

how to obtain this formulation? i use patterns but i need to determine a[i][n-1] by my self.
8 years ago, # |
  Vote: I like it 0 Vote: I do not like it

@ADMIN    pls  make an statement about question b

in question  m is an integer

but  i got 3 wrong submission if i m taking m as integer

ans i got accepted wen i made  m a string.

why wrong on taking m as integer...?/? 

  • 8 years ago, # ^ |
      Vote: I like it +1 Vote: I do not like it
    Test:
    4
    04

    Answer:
    WRONG_ANSWER
    • 8 years ago, # ^ |
        Vote: I like it 0 Vote: I do not like it

      @ADMIN  i dunno but wen taking m as 04  if one using int  m then it will be  4 and answer will be "OK"

      so  there is no mistake in int m 

      correct me if i am wrong

      • 8 years ago, # ^ |
          Vote: I like it +3 Vote: I do not like it

        For M = 4 answer is 4. But Valera's answer was 04.

        Look at the M and Valera's answer as string(not as numbers)

8 years ago, # |
  Vote: I like it +1 Vote: I do not like it
can anyone tell me in problem C ,what tricks
  • 8 years ago, # ^ |
      Vote: I like it 0 Vote: I do not like it
    Case 11 for C ,my program down ,what trick
  • 8 years ago, # ^ |
      Vote: I like it 0 Vote: I do not like it

    there is no trick in c  u jst have to do following things

    for minimum;

    just make fruits in order of number of occurences.

    then make the most  repeted fruit to least valuble.

    like 3 orange and 2 banana and 1 apple 

    and prices are 4 5 6 7 8 9

    then answer is 4*3 + 2*5 + 6*1

    for maximum just opposite

    9*3 + 8*2 +7*1

    • 8 years ago, # ^ |
        Vote: I like it 0 Vote: I do not like it
      i use the same way as you said, however , my program get down in test case 11
8 years ago, # |
  Vote: I like it +1 Vote: I do not like it
Any hints / explanation for Problem - D (Ball) ? Its a nice problem.
  • 8 years ago, # ^ |
      Vote: I like it 0 Vote: I do not like it
    D is very nice. Any explanation is appreciated.
8 years ago, # |
  Vote: I like it 0 Vote: I do not like it
How to do with Problem D? Can anyone tell me?
  • 8 years ago, # ^ |
      Vote: I like it +4 Vote: I do not like it
    I have sorted by first parametr and then make rmq where indexes were second parametr and value is third. Becouse of stecific rmq request you can use Fenvik tree insted of interval tree and I have done it.

    But i saw tthat some submited solutions are more easy.
    • 8 years ago, # ^ |
        Vote: I like it 0 Vote: I do not like it
      is problem D smilar to this one .
      http://www.spoj.pl/problems/MDOLLS/
      Quick Sort and Binary Search ?
      Sorry for my bad english .
      • 8 years ago, # ^ |
          Vote: I like it 0 Vote: I do not like it
        No, they are not similar. Here we have 3 parameters to look for and range is [0,109] for each value, and at most 5x105 such triples and we need to just find for each value, if there is a value greater than this.
        ---
        @kuniavski: could you please explain it a little more. Each value can be as large as 109, so how are you using a BIT ?
        • 8 years ago, # ^ |
            Vote: I like it 0 Vote: I do not like it
          Of course firstly i mae them smaller. the absolute value are not necessary. So you can say that malist value is 1, next is 2 and etc. So values should be not more 5x105.
          • 8 years ago, # ^ |
              Vote: I like it 0 Vote: I do not like it
            Thanks. Done it :) . . superb problem it is ! Any other ways of solving it, other than 'sorting with x and using rmq ( or bit ) on (y,z) ' ??
            • 8 years ago, # ^ |
                Vote: I like it 0 Vote: I do not like it
              Could you please describe this approach more specific?
              • 8 years ago, # ^ |
                  Vote: I like it 0 Vote: I do not like it
                Approach is, we sort it with X and process the bunch of entries with same X at a time.., thus reducing the problem to take care of Y and Z. As relative difference only matters, we can enumerate all Y's, thus getting them in range [1 - 5x105] in worst case. Now, with Y as key and its corresponding Z as value, (Y,Z).. we can use BIT, to store the cumulative maximum. From this, we can query "what is maximum Z for Y in range [1,y]?" in O(log n) and also can update this table in O(log n). I hope you got rough idea of what we are doing.
                ...
                I think I have written a well readable code.. you can check that by clicking the number of solved, beside this problem in the problems list. Submission id is 40387.
                • 8 years ago, # ^ |
                    Vote: I like it 0 Vote: I do not like it
                  i can't find this code with id 40387.
                  can you mail this for me?
                  with best regards.

                  mail:
                  masoud1459@yahoo.com
                  • 8 years ago, # ^ |
                      Vote: I like it 0 Vote: I do not like it
                    sorry dude, typo.. its 40837 actually. You can find it here ( http://www.codeforces.com/contest/12/status/D?order=BY_PROGRAM_LENGTH_ASC )
                    • 8 years ago, # ^ |
                        Vote: I like it 0 Vote: I do not like it
                      thank you very much, i find it.
                      masoud.
                    • 2 months ago, # ^ |
                        Vote: I like it 0 Vote: I do not like it

                      how to solve 12 D. by segment tree or by interval trees or by fenwik tree ? how you solved it and what u did ?

                • 2 months ago, # ^ |
                    Vote: I like it 0 Vote: I do not like it

                  why do we need to update BIT ?

      • 8 years ago, # ^ |
          Vote: I like it 0 Vote: I do not like it
        this is a special case of Dilworth theorem, there is no relation with problem D.


    • 8 years ago, # ^ |
        Vote: I like it +1 Vote: I do not like it
      I don't know what is "Fenvik tree",  nor can i find it by Google it . Can anyone tell me ?
8 years ago, # |
  Vote: I like it +1 Vote: I do not like it

@ADMIN  can you please give us input.output of problems ...

so that we can find bugg in our programs

8 years ago, # |
  Vote: I like it 0 Vote: I do not like it
How do you think, why 40676 doesn't pass, while 40679 is accepted?
  • 8 years ago, # ^ |
      Vote: I like it +1 Vote: I do not like it
    Let't start the challenge :) I see the case, who else?
    • 8 years ago, # ^ |
        Vote: I like it +12 Vote: I do not like it

      Wrong answer on test 31.

      It was my fault, that's why i know the case too. =)

    • 8 years ago, # ^ |
        Vote: I like it 0 Vote: I do not like it
      n=0 ?

      btw, it would be nice to be able to link to the actual solution (I guess vihrov's links work only for him)
      • 8 years ago, # ^ |
          Vote: I like it 0 Vote: I do not like it
        No, they don't :(.
      • 8 years ago, # ^ |
          Vote: I like it 0 Vote: I do not like it
        When they say "there is no misleading 0 in the first number", I think N <> 0 :D.
        • 8 years ago, # ^ |
            Vote: I like it 0 Vote: I do not like it
          I don't know, in the problem it's said that "0 ≤ n"
  • 8 years ago, # ^ |
      Vote: I like it 0 Vote: I do not like it
    40676    may be  40667  This is the challenge.
8 years ago, # |
  Vote: I like it 0 Vote: I do not like it
Well after my registration I found that I'm on train to Beijing to attend APIO2010 when the contest started.

I calculated the time wrongly due to the timezone difference.

I wonder whether it will affect my rating. I really hope I can cancel my registration but it seems impossible to do so.

And I really hope that zero submissions will not affect the rating. (I don't know whether topcoder is like this due to the fact it doesn't support PASCAL).`
  • 8 years ago, # ^ |
      Vote: I like it 0 Vote: I do not like it
    For solving timezone problem now you can use this calendar (for Codeforces by darnley) or this (by me).
    I think possibility to check contest time at timeanddate.com will be implemented, but later.
    • 8 years ago, # ^ |
        Vote: I like it 0 Vote: I do not like it
      Thanks, but it seems impossible to cancel the registration now.

      Time on that calendar is still Moscow Standard Time (UTC +4), so i had to add 4 hours on it.
      • 8 years ago, # ^ |
          Vote: I like it 0 Vote: I do not like it
        There is no need to cancel registration. The rating changes here only if you have submitted a solution.
        Yep, you have to add this calendar to your account at google.com (there is a link in bottom right corner), after that you'll see all events in your time zone. :)
        • 8 years ago, # ^ |
            Vote: I like it 0 Vote: I do not like it
          Works now, thanks.

          BTW, are you one of the administrators of this website?
          • 8 years ago, # ^ |
              Vote: I like it +3 Vote: I do not like it
            No, I'm just an annoying flooder sometimes helping others to solve their problems.
            • 8 years ago, # ^ |
                Vote: I like it +3 Vote: I do not like it
              Well the website becomes better due to the help from people like you.
      • 8 years ago, # ^ |
          Vote: I like it 0 Vote: I do not like it
        "And note that with Google Calendar you can set SMS and e-mail notifications, in order to never miss a Codeforces round. Not only can you do this for a single event, but I also recommend you to go to the Settings menu and set automatic notifications for all events of this calendar."
        (Codeforces Calendar)
8 years ago, # |
  Vote: I like it +1 Vote: I do not like it

@ ADMIN  whenever i got mail for new comments i got this url to .ru extension like

"http://codeforces.ru/comments/349#comment-4505"

so u can make it   ".com"   for english users......

  • 8 years ago, # ^ |
      Vote: I like it 0 Vote: I do not like it
    BTW (I'm from Russia), I receive urls from:
    codeforces.ru
    codeforces.com
    (and even!) www.codeforces.com

    Besides they have different cookies and I need login every time to make some action (answer, give plus, etc).
»
2 months ago, # |
  Vote: I like it 0 Vote: I do not like it

how to solve problem E