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

Автор PrinceOfPersia, история, 8 лет назад, По-английски

— Hey, It's me again. Plain to see again...

— Oh crap, it's PrinceOfPersia again :|

I'm here to introduce you: Codeforces round 362. It's gonna take place on 196th day of 2016.

I'm the writer of this round. Not as always, there are 6 problems. I hope you enjoy.

I want to thank LiTi and Haghani for testing this round, danilka.pro and GlebsHP for helping me prepare the problems and MikeMirzayanov for legendary platforms of Codeforces and Polygon.

The main character of this round is Barney Stinson (high five ;)) and you're gonna help him with his problem.

I wish you all lots of Accepted solutions and hope to see no Skipped solutions ;)

Scoring will be posted soon.

GL & HF!

UPD: We decided that the contest has 6 problems (in each division, 4 shared). Duration will be announced as soon as we decide, but It's gonna be between 2 and 2:30 (inclusive).

UPD1: Duration is 2:15.

UPD2: Scoring is standard in both divisions: 500 — 1000 — 1500 — 2000 — 2500 — 3000

UPD3: Check out the editorial!

UPD4: System testing is over. Congratulations to the winners!

Div.1 Winners are:

  1. jqdai0815
  2. jcvb
  3. sankear
  4. matthew99
  5. Zlobober
  6. Claris
  7. Endagorion
  8. Reyna

Div.2 Winners are:

  1. variance
  2. holy_collie
  3. kimiyuki
  4. O__________O
  5. hs484
  6. czllgzmzl
  7. kimden
  8. jtnydv25
  • Проголосовать: нравится
  • +441
  • Проголосовать: не нравится

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

Why are you talking to yourself? :/

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

    You know I am Chinese, and I hate to read the foreign names such as Stinson.It is too hard for me to pronounce, so I decide change it in to “诗汀尚” in my mind.it is good for me to understand the meaning of problems!

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

Nice to meet you again.

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

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

Auto comment: topic has been updated by PrinceOfPersia (previous revision, new revision, compare).

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

announcement shud have been --

The main character of this round is .... wait for it..................Barney Stinson

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

Please do not put minuses :(

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

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

It is Rated ??!

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

    I think if this round won't be rated, they would write Codeforces Round #362(unrated).

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

hoping for an interesting problemset.. :)

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

I hope non of the problems statments will be "you have to help Barney Stinson to meet your mother"

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

Hope to See a Problem about the Brocode now that is going to be interesting to solve :D

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

I hope the problems are translated properly to English. Some of the problem statements in the previous few contests could have been better.

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

I extremely believe this round will contain less math problems than your past ones.

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

Is it rated?!

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

Will it be possible to connect to codeforces.com during contest?

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

I counted, Barney Stinson is truly have two hands and ten fingers, let's high five :P

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

Today is 2016/07/14, and it's 14^2 = 196 day of year =))

Wish all contestants luck =))

anw, this contest is my 40th contest, and I nearly get Expert =))

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

So long that rng_58 has participated on CF. Waiting to see Petr and tourist too.

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

Auto comment: topic has been updated by PrinceOfPersia (previous revision, new revision, compare).

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

I hope problems will be prepared better than Hackerearth June Clash 2016 (which is still haven't been rejudged)

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

    Not my fault. shef_2318 prepared the checker for approximate problem(NOT ME) and we told admins to rejudge it and they did nothing :|

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

      Your fault is that despite my warnings during the contest you haven't found bug in your checker. It was very easy to find, you just mixed up 1-indexation and 0-indexation.

      Actually I don't want to offend you, just want to say, that quality of those contest was not high, despite the fact that the problems were the cool. Hope that this one will be better.

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

      It's nice etiquette to say "sorry" instead of "that guy fucked up". It's not the first time I see your comment saying that sth is someone else's fault. Do you want to be necessarily mentioned by other organizers after you make a mistake?

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

i'm excited for this unusual round with 6 problems i'll try my best to solve atleast 3 of them.

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

Hope that, Barney Stinson face easier problems than the previous (#361) Div2 Round.

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

hope to get plus rating. I can't progress and getting frustrated :(

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

I think it's going to be an awesome round because the awesome man is its main character!

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

is it just me whose codeforces is working very slow and sometimes not even opening? its working slow since last night's contest, every other website opens instantly except codeforces.

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

Hope for 6 problems involving queries... :D

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

I hope to turn to cyan color ! :D

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

I have two wishes: 1. The English statements being clear. 2. Problem A loads up before 10 people get AC and we are like loading.. :/

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

I'm lol about the duration time)

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

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

You were the author of round #326 and now it's round #362. Pretty much awesome :D :D :D

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

нестандартненько

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

It's going to be legen- wait for it......

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

Except for maybe two rounds years ago, it's going to be my first round on Windows. I'm trying to install some IDE right now. Wish me good luck!

#mylaptopbroke

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

Auto comment: topic has been updated by PrinceOfPersia (previous revision, new revision, compare).

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

there is an extra zero in "25000" :P

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


I just captured a legendary pokemon

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

Congratulations to yao981113 for getting a perfect score on IMO! Celebrating by doing cf

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

    Congrats ! Who is he IRL ? My student got silver and I'm also really happy.

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

'Barney consider a girl x to be better than a girl y if and only if: girl x has weight strictly less than girl y...'

That's how K-pop fans harm their idols by putting them on a diet and making them skinny. I miss their healthy bodies.

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

You should be able to resubmit your hacked solution even after you've locked it. I feel like this is unfair for all those people who either lock problems for fun or by accident. Please bring justice. I know some people may copy other people's code, so maybe say able to resubmit up to 10-15 minutes after solution was hacked?

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

    Wut?What if you copy someone's code? and btw you can't "lock" it by accident.

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

      Well if your solution is hacked, shouldn't you at least be able to have a chance to redeem yourself? How about when your solution is hacked, you can no longer view other people's solution for that problem? I feel bad for losing 750 points because of unable to resubmit...

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

        You should lock your code if you are really sure. I just lost ~950 points because I missed one case.

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

          I guess you guys are right. Unfortunate, yes, but I am new to hacking/locking so sorry for complaint. Was fairly surprised and frustrated when I found out I couldn't resubmit. Ok, will reconsider to lock problems or not in the future.

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

            If your problem is not locked, then you can resubmit if you are hacked. Resubmitting with a locked problem is totally unfair, because you could just upload another contestant's source code. Also, that's the beauty of it: "you can hack only if you lock, do you really want to?"

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

        You can still redeem yourself by hacking other's solutions though.

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

    This would be a very bad idea. If your not confident in your in your solution don't lock it. You can't allow someone to copy someone else's code in the middle of a competition.

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

Те, кто переводили условия задач, расскажите пожалуйста, зачем переводить все условия и при этом не перевести комментарии к псевдокоду по задаче D? Ответ на мой вопрос по задаче "внимательно изучите псевдокод" меня тоже порадовал. Я считаю, что человек, не обладающий британскими навыками, как, например, я, был принижен относительно самих британцев таким условием задачи. Мне пришлось очень долго из-за этого разбираться, что имели ввиду авторы задачи.

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

    Ох... Вы можете и не верить, но я обнаружил это только благодаря вашему комментарию. В действительности, комментарии внутри псевдокода должны были быть переведены.

    К сожалению, я это пропустил, думая: "Это же все-таки псевдокод!", просто забыв о том, что там есть важные комментарии, а ваш вопрос не содержал намеков на то, что комментарии не переведены, как и вопросы других участников. Если что-то из перечисленного пошло бы иначе, во время раунда вы обязательно увидели бы русские комментарии.

    Можете считать, что это только моя оплошность (их я все же стараюсь не допускать, но, как видите, не всегда получается). Приношу свои извинения.

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

0.0e0 made my place Kappa

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

I believe DIV2 D is a really cool problem :D I got the idea what to do but I couldn't finish in time :'( Really nice problem btw :D Thanks PrinceOfPersia

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

What's the idea behind Div2D/Div 1B? Couldn't find the formula for a vertex :/ Edit: I messed the letter, meant Div 1B :D

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

    Div1A: You go up from each vertex up to their LCA. In query 1, you add cost to those paths, in query 2 you sum and print. I saw a nice trick to go up to LCA — at each step go to parent of the vertex with the largest index, until both vertices converge. But there are other ways, e.g. using set to find intersetction of two chains, or going up to root and then down to lca.

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

      I meant Div1B, I messed up, but thanks though :)

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

        In Div1B, you first compute all subtree sizes; then for each node the expected time will be time of the parent + 1 + (sum of all subtree sizes of siblings)/2. Because by linearity of expectation, any sibling will go before current child with probability 1/2 and dfsing that sibling will take time equal to size of the subtree.

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

Auto comment: topic has been updated by PrinceOfPersia (previous revision, new revision, compare).

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

Div 1 E: Heavy Light Decomposition?

Find the minimum on each path and then set that node to Infinity?

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

How can I avoid TLE in C? I made a program with matrix dynamic, So My program's time complexity is(KlogN) but It got TLE...

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

    The formula is 1 / 3 * (1 + ( - 1)k / 2k - 1). You just need to exponentiate 2^k modulo. Other computations are fast.

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

      I got it. Matrix Computation was slower than I thought... Thanks!

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

        Alternatively, you can note that it is sufficient to know the exponent for prime p, so you only need to do log(mod) exponentiation, instead of log(N).

        EDIT: 19131411

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

          Hi, does that property works also for matrices? I mean if A is a square matrix and I the identity matris, then A^(MOD-1) = I mod MOD?

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

            Hmm, it seems I assumed it works during contest, and I have no proof or idea for proof. Will try to google around to find whether property is actually true.

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

              I also assumed that, it worked. In yesterday's contest I tried to used in problem C but doesn't work. I already searched and that property doesn't apply for matrices. I would like to understand why in this particular problem it worked

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

      can you explain how to get such formula?

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

        Consider the matrix approach. The matrix is something like [[1 1 0][1 0 1][0 0 1]], and it equals to ([[1 1 1][1 1 1][1 1 1]]-I). Expand it.

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

Div2C test 3 and Div2B hack? ;(

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

Kind of silly that a linear solution to Div2 A passes when such a nice O(1) solution exists.

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

Problem C: 5.0e0 hah. After an hour and before locking i realized my solution will fail such thing so fixed + submitted again. But then another guy in the room already did 11 hacks :| so couldn't make use of this to full extent

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

I think pretest for problem B is very very not good :( :(

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

I think Time Limit for Div1\C was too strict, at least my solution is O(k * log(a) * matrix_multiplication), which I thought was fine, but I need extra optimization to pass pretest. 19127740. I guess it will be TLE on final Test :(

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

I don't know why, but codeforces said that my input for a hack is invalid, however, it is valid, please check.

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

Thank you for the quick editorial !

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

Sorry I am wondering what is wrong with these two solutions... Please tell me what is my mistake div2B 19118037 div2C 19132537

Edit: i saw what i missed on div 2 b

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

    Since you are using map, there needs to be a comparator function to compare its keys ie pair of bitset or bitset in this case. Apparently, there is no comparator function. Hence, the compilation error. You can either implement a comparator yourself and use it or change key of map to pair<long long,long long>.

    Here is how to make comparator function: here (Although there is error in your logic as that gives WA)

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

Dayum, first contest in div 1, problem A scared me, I thought I needed to do Lowest common ancestor, then I realized it was easy when 30 minutes remained. but I wrote v/x instead of v%x in my code, and realized 1 minute after contest ended :(

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

I've always sucked at texting girls, so I didn't even bother with Div1D

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

Div 2. B: someone tried to overcome 0.0e0 hack: "for(; i < posE; i++){ sum += string[i] }; if(sum % 48 != 0){ print '.', ... }"; 0.888888e0 xD

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

whats the idea in Div2 D ?? how in general to approach probability questions ??

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

    Learn math ;)

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

    There's no "general approach".

    But an important thing you should know is that expected value has linearity, i.e. you can add them directly. Then if you want to know the expected order of a node u, you can check how many nodes are visited before this node. There are 3 cases:

    1. u's ancestors: they are always visited before u

    2. u's decendants: they are always visited before u

    3. else: they are visited before u with probability 0.5

    Then the answer is simply 0.5(n-u's decendants+u's ancestors+1).

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

You should improve pretest quality. It really weak this time.

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

    Very strong pretests would make hacking much harder and an interesting feature of CF would be rendered useless. I assume, that in some cases problem setters might even avoid particular corner cases on purpose.

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

tricky case in div2 B all digits are 0 including answer :)

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

Couldn't hack Div.2 A C++ solutions with 0 2 1_000_000_000 :'(, only one Java.

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

Wasted an hour on precomputing for small values of n and trying to debug this whole thing in Div2 D only to find out that I have completely forgotten about the case when no additional subtrees are visited prior to entering the vertex.

Managed to correct the solution, didn't manage to submit it in time. Damn.

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

if (!prod) cout << 1/1;
if (!prod) cout << 1/1;
if (!prod) cout << 1/1;
if (!prod) cout << 1/1;
if (!prod) cout << 1/1;
if (!prod) cout << 1/1;
if (!prod) cout << 1/1;

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

I tried to hack two solution on problem A_Div2 which use while loop with this test case :

1 2 1000000000

but I failed , I think it must give TLE on such solutions :\

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

This round's problems is so interesting! I like this round although i don't get many points

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

too much hacking in one round

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

Why so strict limits for div 1 B? I used double variables for answer and O(n) complexity and my solution runs in 750 ms(C++).

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

Ques 2nd should be rejudged. Your test cases don't contain 0.3e2. The solution 030 is also passed.

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

    if the number before this decimal is zero, then the number after 'e' must be zero. Read the problem statement.

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

The problem statement on Div1 B says "The second line contains n - 1 integers". This implies that there is a second line (just with 0 integers). Yet we are not given a blank second line. This is the only thing that broke my submission, isn't this test data invalid?

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

Кодфорц, не лагай. Пока висела страница с отправкой решения, я случайно добавил лишний пробел в код и ткнул обновить. Так одинаковый код отправился дважды и -50 к посылке.

Но все равно, Hello div1, отличные задачи, авторам спасибо.)

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

The feeling when you have almost coded Div1F when the contest ends, and it would have passed the tests.

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

Auto comment: topic has been updated by PrinceOfPersia (previous revision, new revision, compare).

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

Can someone help me understand why my B gives TLE? it should be linear.

Your text to link here...

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

    I found it.

    what I did was manually add for each node v, the sum S[w]+1 of the number of sons of each vertex w which is a son of the father F[v] which is not v.

    I should have just done S[F[v]]-S[v]-1. fail, sigh.

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

WA on pretest 1 in Div2B. Any ideas?

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

    Maybe it contains invisible characters.

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

    In your solution, line number #52.

    It should be "a < len". Why would you like to run till "a <= len"?

    Update:

    After correcting above mentioned error in your code, I was able to get AC on it. 19134004

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

    You reminded me of this blog when I first started CP

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

    After running your code locally, it has character with code 0 after the output but before the newline.

    38 35 34 2E 39 00 0D 0A
    
  • »
    »
    8 лет назад, # ^ |
    Rev. 4   Проголосовать: нравится 0 Проголосовать: не нравится

    Ehh... Thank you :/ I thought I would destroy my laptop after 10th submission :P I think that these types of invisible characters should be ingnored by the checker like it is done with "endl" at the end. It would be nice.

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

hey something is seriously wrong with the final testings.I submitted the same code again after the contest and it gives correct ans on on your system and my PC too.Please recheck it.You could even compare both codes.Problem "DIV2B"

During Contest- http://codeforces.com/contest/697/submission/19126571

After Contest- http://codeforces.com/contest/697/submission/19133631

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

Unlucky for me... If you use fermat little theorem on div2E... if you have a multiple of mod-1 then you cant let it stay at 0 to use formula... must say if (n==0) n=mod-1;

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

Why did I think that all strings are unique in div1D? :-(

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

Another one easiest way to drop 200 places! 19126039 19134075

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

    Forget to write "if (y < 0) y += MOD — 1" and lost C.
    Thought that all strings are unique and wrote c[x] = a[i] instead of c[x] += a[i] and lost D.

    GGWP :D

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

Really nice round, and a great problem set!

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

Did anybody else find the problem statements, well, just "too much"?

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

    I found it was kind of bitter sweet. I enjoyed the puns ("slapsgiving" in A was also nice). I also did not like that it took the focus out of the problem.

    BTW, isn't it the three eyed raven who has time traveling capabilities. Is Jon Snow the next three eyed raven? Can't wait for next season!

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

How to fuck up your computer in three simple steps:

  1. Read Div2C/Div1A

  2. Assigns two huge vectors after seeing MAXU and MAXV

  3. Profit

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

I am new to python,and I wonder if there a way to read data like using freopen in cplusplus?

if it has, need I delete the input code before I submit the code? Or it there if a way that I don't need to delete the input code like using ifdef definition in cplusplus?

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

    You can use sys.stdin.readline().strip() to read your lines.

    import sys
    sys.stdin = open('thing.in', 'r')  # comment this out when submitting
    stuff = sys.stdin.readline()
    
»
8 лет назад, # |
  Проголосовать: нравится 0 Проголосовать: не нравится

Hi can someone help me out why this solution for DIV II/Problem C is failing on testcase 39. I tried with lot of smaller test cases but couldn't figure out mistake.

http://codeforces.com/contest/697/submission/19167786