Пожалуйста, подпишитесь на официальный канал Codeforces в Telegram по ссылке https://t.me/codeforces_official. ×

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

Автор Petr, 14 лет назад, перевод, По-русски

В эту субботу, 27 октября, состоится Petr Mitrichev Contest 10, с 15:30 до 20:30 по Москве (другие часовые пояса: http://timeanddate.com/worldclock/fixedtime.html?msg=Petr+Mitrichev+Contest+10&iso=20121027T1530&p1=166&ah=5 ).

Контест будет проходить на http://codeforces.me/gyms . Приглашаются и команды, и индивидуальные участники. Сам контест будет по адресу http://codeforces.me/gym/100110 , но эта ссылка заработает только после начала контеста.

Будет 10 задач на 5 часов, некоторые попроще, большинство посложнее :) Засчитываются только решения, прошедшие все тесты (правила ACM ICPC), выигрывает тот, кто решил больше задач, а при равенстве — у кого меньше штрафное время, так что опаздывать не стоит. Во всех задачах нужно читать входные данные из файла и писать результат в файл, не читайте из stdin и не пишите в stdout! Условия будут по-английски.

Если что непонятно, спрашивайте. Пишите тоже, если что-то не так с системой — я пользуюсь codeforces.ru/gyms в первый раз.

Регистрация: http://codeforces.me/gymRegistration/100110

Начинаем через 5 минут, всем удачи!

Разбор: http://petr-mitrichev.blogspot.com/2012/10/petr-mitrichev-contest-10-solution-ideas.html

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

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

will you write problem analysis after the contest?

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

Ready, Steady , Goooooo.............. :)

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

I think it deserves five stars, the problems are really hard.

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

    I'm not familiar with the established standards for those stars, but the description says "recommended only for ACM ICPC finalists and winners of international competitions", while I'm pretty sure there are many teams who are not finalists and haven't won international competitions and can still get a decent result in my contest.

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

Tasks will be on English and Russian?

P.S. sorry, don't read description in gym

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

22 hours and 30 minutes before the start of the contest.

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

Will this contest be rated ?

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

Когда давно спалили ссылку на материалы Петрозаводска 2012, я успел выкачать все видео материалы, в том числе разбор автором своего контеста. Если Petr разрешит, то можно будет это видео выложить куда-нибудь...

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

Excuse me, How can I find the problems of the previous Petr Mitrichev Contests?

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

Is Input and Output formats are same as ordinary problems in codeforces??

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

1 hour 40 minutes before start. Note that you can register for the contest now, but you will also be able to register during the contest itself if you forget to register now.

Also note that the website has support for forming teams from several individual accounts.

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

is the contest rated ??

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

I would actually be glad to read about solution ideas from the author of the contest (Petr, in this case). I would not like 'formal analysis' too, but at least some kind of a 'scratch' of proposed solutions.

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

Why don't you make it a normal Codeforces round? I think that would attract more people :)...And it seems my teammates are all dating with girls this night so I can only participate individually:( (yes,I'm the poor guy without girlfriend)

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

    These problems were already used in a contest before, so it's not appropriate to use them for a rated competition.

    Plus, normal Codeforces rounds assume several testers, Russian problem statements, and so on :)

    Good luck!

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

Will the solutions be public after the contest ??

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

Thanks Petr, really nice problem set.

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

For problem B , I thought of something like this : nCk % 10^10 = nCk % (2^10 * 5^10) , We can find it's value by using chinese remaindering . Then for computing nCk % mod , we can write it as fact[n] * inverse (fact[k]) * inverse(fact[n — k). Finally I was stuck in finding no of digits in nCk , Can anybody help in it??

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

Will testcases be published? (What is case 22 of F?)

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

    I'm not sure, you might be able to see the testcases now when you open your submission.

    Case 22 in F is:

    2 97108290405407

    b=2 is tricky because all strings of short length actually have different hashes in that case — does it cause problems for your solution?

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

What is the intended time limit for D: 2 or 5 seconds?

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

A 4-star contest that the winner solves 4 of 10 problems.

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

Hi Petr, From your blog for problem B, Computing the answer modulo 5**10 is done by first calculating the power of 5 in (n,k) separately, and then calculating (n,k) with all powers of 5 removed from all numbers using the fact that we can now use division and thus just need to calculate factorials (skipping numbers divisible by 5) modulo 5**10, and numbers modulo 5**10 is a periodic sequence.

I could not understand how the modulo can be the same , after dividing the numbers by 5 (as you are saying powers of 5 removed). Please Help.

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

    So we need to compute fact[n] with all powers of 5 removed. Let's denote fact_without5[n]=1*2*3*4*6*7*8*9*11*12*...*n — so we just skip all numbers divisible by 5. Then we can notice that

    fact[n]=fact_without5[n]*fact_without5[n/5]*fact_without5[n/25]*...

    And calculating fact_without5 can be done using the fact that the numbers begin to repeat after 5**10. Is it more clear now?

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

      For the first part of the problem : for finding (n,k) % 2^10 : We can write it as : (n,k) % 2^10 = fact[] * inverse (fact[k] , 2^10) * inverse (fact[n — k] , 2^10)

      So As the numbers in inverse might have 2 as a common factor , So inverse will not exist. So for this remove the powers of 2 from it.

      Am I right ???

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

        Yes, we handle 2 in the same way we handle 5.

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

          Hello, how do I find the factorial for larger n? I cant understand the repeating thing, for example lets suppose the mod is 8, then as you said numbers should repeat after 8, but they dont, for instance if n = 12: 1 * 1 * 3 * 1 * 5 * 3 * 7 * 1 * 1 * 5 * 11 * 3 (I took out the 2 from the numbers). Thank you!

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

            You should take out all multiples of 2, not all 2 factors. So for example fact_without2[12] = 1 * 3 * 5 * 7 * 1 * 3.

            And fact[12] = fact_without2[12] * fact_without2[6] * fact_without2[3] (12, 12/2 and 12/4 respectively).

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

              Humm, what about the numbers that are multiple of 2, how do I include them on the answer? (2, 4, 6, 8, 12...).

              Edit: That gives the same result as 1 * 1 * 3 * 1 * 5 * 3 * 7 * 1 * 1 * 5 * 11 * 3 = 51975, and that way it produces: 1 * 3 * 5 * 7 * 11 * 1 * 3 * 5 * 3 = 51975. But that way its periodic :), got it now thank you!

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

By the way, there are standings for this contest held in Petrozavodsk. On that contest there was no problem G though.

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

Why can't I see others' code?

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

A funny thing . Team's name can be a space. :)

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

Can I see the test cases? When I open my submissions, I can't see them.

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

Excuse me, in problem B, how can I calculate the answer modulo 2^10?

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

your blog is blocked in CHINA... So the sol is not available :( would you please copy one into CF blog so that programmers in china can view it ?

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

    You can use Tor or VPN. Don't be lazy.

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

      What you advise is basically to break the law. Not fair or good, but law nontheless

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

        I don't know much about Chinese laws, however, I don't see how it is possible that accessing Petr's blog via VPN is less legal than accessing it via asking someone to repost it to codeforces. Their laws either force ISP's to block some resources (then both ways are legal), or they forbid users to access some resources (then both ways are illegal).

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

          If information from Petr blog will appear on some other resource there are two possible cases:

          • information in question is not forbidden and was blocked only because whole resource (i. e. blogpost) was blocked

          • information in question was actually forbidden by itself and new place would also be blocked.

          In both cases I do not believe there was illegal action by ysymyth and former also is much more probable

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

Может в прямом эфире указывать дату создания поста, чтобы сразу было понятно, что актуально, а что — некропост? А то я прямо обрадовался, увидев анонс Petr Mitrichev Contest в эту субботу, зашел и раздосадовался, увидев, что опоздал на семь месяцев.