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

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

Hello Codeforces, and happy Nowruz.

It's an honor to announce you that Codeforces Round #406 is going to take place on March 23rd.

I'm the writer of this round and it is gonna be my 6th CF contest (there are still plenty coming...). There are 5 problems and you'll have 120 minutes to solve them.

I'd like to thank keyvankhademi and waterfalls for testing this round, netman and KAN for helping me prepare this round and MikeMirzayanov for awesome platforms of Codeforces and Polygon.

The main characters of this round are going to be Rick and Morty!!!

Scoring will be posted soon.

Problems are sorted by their expected difficulty, but I strictly recommend you to read all the problems.

GL & HF!

P.S: Top IOI 2017 participant in each division (only with handle present in the future IOI handle list) will be rewarded with special Persian souvenirs in Tehran.

UPD: Scoring distribution is: 500, 1000, 1750, 2000, 2500 for Div.2 and 750, 1000, 1500, 2000, 2500 for Div.1

UPD: Editorial is out!

UPD: System test is over, congratulations to the winners.

Div.1 winners are:

  1. jqdai0815
  2. Um_nik
  3. LHiC
  4. -XraY-
  5. ershov.stanislav

Div.2 winners are:

  1. xumingkuan
  2. HXLLL
  3. Rpd-Strike
  4. U6121071173
  5. Khismet

See you next time ;)

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

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

amd is back! <3

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

Amd's contests are so good. I've never been disappointed with any of his contests. Looking forward to this Thursday.

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

are you sure then IOI participants has in EACH division?

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

    You would be surprised, but as far as I remember the split was 50 / 50 for those with a Codeforces account.

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

"I strictly recommend you to read all the problems" does that related to the difficulty of the upcoming problems???

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

    read this

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

    From quite an experience , I believe , the statement wants to convey that C can might turn out to be easier than B :P

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

    For example, you are very good at math and E is math problem which you can solve, but you are solving A-B-C and can't solve D, so you can think if I can't solve D, I won't solve E too and don't reading problem. So, it is good to read all the problems.

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

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

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

Happy Nowruz! I wish everyone that the round was truly festive!

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

I missed PrinceOfPersia's rounds so much!

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

(only with handle present in the future IOI handle list). Where's that list?

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

Problems are sorted by their expected difficulty, but I strictly recommend you to read all the problems.

GL & HF!

// What's the output of this code ? :)

cout<<(GL=="Good Luck" && HF == "Have Fun" ? "Yes":"No");
»
7 лет назад, # |
  Проголосовать: нравится 0 Проголосовать: не нравится

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

"Do ya hear that M-M-Morty? *URP* We're gonna go to a universe where everyone is a character in a programming competition, Morty--"
"I-I, uh, I don't know Rick, that sounds like--"
"A programming competion, Morty! Codeforces, Morty!"

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

Hope morty doesn't go back to the old shop... :/

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

Good Luck and Have Fun !!

I hope this comment becomes the reference for all authors who are lazy to write it , and they write GL or HF . so they can copy paste it from here .

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

First of all I apologise to write it here as I am very much new to this.I want to hack a problem which is already accepted.But I can see that the solution is wrong,what to do,Please Help.

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

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

AMD setting the round + Main characters as Rick and Morty. This is going to be good.

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

A contest about me? thx :D

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

wowwww im very much excited about the contest ... for giving this contest i will eatless :) hoping for +ve rating change and i love all the contest prepared by PrinceOfPersia ... and i love him too :) his style of blog writing is awesome and he is also awesome... i love codeforces ,,,,, i love MikeMirzayanov and i love alll :) happy coding best of luck for the contest :D

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

What made you change your mind?

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

I just love codeforces contests

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

Best theme ever! This is one of the main reasons for why I love competitive programming...

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

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

..

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

Why the hell your characters are soooooooooooooo intresting?! 1-Barney Stinson 2-Mike 3-Rick and Morty all of them are wonderful

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

can someone tell me the full-form of amd please?

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

Do i only see that i have last 2nd contest's amount of points instead of amout that should i have now? I mean i have 1021 when i had after last round 1087 and i see everybody have the same issue

Also my submissions from last contest got back themselves

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

Glad to see my teacher is holding another round, good luck PrinceOfPersia (reply to this comment).

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

Happy Nowruz everyone) Hope that most will increase their rank

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

Everybody, who liked this commend will increase his rating))

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

Good thing CodeForces doesn't have verdict "Not Acceptable", else this round will be full of Error 406: Not Acceptable.

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

It's my birthday contest !! thanks PrinceOfPersia :D

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

Guys, better prepare robust version of Heavy-Light Decomposition. Afair on 3 out of 5 PrinceOfPersia's contests E required it xD.

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

    Thanks, I will Unregister!!!

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

      Yeah, possibility of Div1E being HLD is a perfectly valid reason for greens to unregister ;p.

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

        I understand Sarcasm.Thanks

        If E is HLD,then Accordingly all lower problems like D will be of PersistenSe segTree amd c will be of Sqrt decomposition and b will be of Dynamic programming with bitmasking and A will be of Maximal fLow and minimum cut in graph and Div2B will be from suffix trie and then DIV2a will be Unknown theorems on NUmber theory .So,I said I will Unregister

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

          If E is HLD,then Accordingly all lower problems like D will be of PersistenSe segTree amd c will be of Sqrt decomposition and b will be of Dynamic programming with bitmasking and A will be of Maximal fLow and minimum cut in graph and Div2B will be from suffix trie and then DIV2a will be Unknown theorems on NUmber theory .

          That's a pretty good and valid point.

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

    Funny fact: in Round #362 problem E was not a hardest problem, but it was indeed a HLD-problem. So, if a problem on HLD appears, it will apparently be the problem E, no matter how many problems in the contest there are.

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

      On last Petrozavodsk I used HLD once and it was also problem E (E2) :D. Apparently it was second easiest problem that day xD.

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

who likes inception?

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

fact : PrinceOfPersia is a gay prince and he's trans.

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

Hi, Prince)

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

mrims of persia always very nice mromlems, looking forward to the round 406, good luck

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

Me when the competition starts (better watch out!)

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

Scoring distribution?

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

Ужасный перевод в Div2B, пришлось переключиться на английский, чтобы понять эту кашу :/

Лето из вселенной #1 знает, что в каждой параллельной вселенной (включая это лето) ровно один из Рика и Морти из этой вселенной предатель и ровно один верен, но никто не знает кто именно. Лето знает, что мы обречены, если существует группа, в которой каждый участник предатель (они спланируют и уничтожат мир).

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

I didn't know the theme was Eminem too

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

Лучше бы вообще оставили без перевода, чем это. Тогда люди времени бы не тратили и сразу на английском читали условие.

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

Hacking page does not load.

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

EM fan eh ?

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

Did anybody notice the names of the problems...they are the names of eminem's songs too.

Nice taste PrinceOfPersia.

:)

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

Very long queues.

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

Is there a long hack queue? My hack has been in queue for almost 5 minutes now

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

This is exactly how I read the problem statements to understand the whole meanings.

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

If suppose somebody program is write but would terminate before considering all the inputs would it be a valid program or not?

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

It could be better if there were explanations for the examples in Div 2 problem C. It is possible to understand it ambiguously.

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

Systests of A will make many people sad (me too) :'(

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

Like almost everyone after the contest

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

Div 2 B and C are so ambiguous. There should be more explanation rather than what we had.

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

I do really like problem C xD good job PrinceOfPersia

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

PrinceOfPersia right now.

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

How to solve C? My idea is to do dynamic programming with 3 state [position][cycle_passed][turn], with O(k) transition. This gives the right answer, however since cycle_passed could exceed 70, my solution got TLE. Am I on the right track here?

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

    It needs only position and turn(0 or 1), nothing else.

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

    I used a dp approach too, conf[player][pos] = 1 if player can win if he moves first from pos, 2 if he loses, 0 if it-s a loop. I made a dfs(player,pos) to find the answer for the current configuration but I'm not sure it will pass the main tests because of the complexity . It became a little complicated when taking care of the loops so I had to use some extra time to verify those.

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

What are the hack cases for problem 2 divB

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

Applause Great problems! Thank you, man!

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

on div2b, why no runtime error for negative values on this solution?

Unsuccessful Hack case

10000 2
8 1 -1 -1000 -2000 -3000 -4000 -5000 -6000
8 1 -1 -1000 -2000 -3000 -4000 -5000 -7000

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

    Could you show the whole code?

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

      sure: submission

      it received WA on systest, but I was wondering why the hack didn't pass

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

        If you add cout << ok << " " << v << endl; to the beginning of code: You get 0x554ae0 0x4f3040. That means that ok was placed after v (exactly v + 100008 = ok), so in fact ok[-1000] makes sense because it means v[100008 - 1000] (Don't have any idea why 100008 and not 100005, that's some compiler stuff).

        But generally you could get a Succesful hack by this test:

        10000 2
        3 1 -1 -10
        1 10
        

        He wouldn't clear ok[10] after first group, so he will say "NO" after checking 2nd group and finding that there are two elements with absolute value of 10. But right answer is of course "YES".

        Also this code doesn't check multiple occurrences of the same element. So

        1 1
        2 1 1
        

        will also have "NO" answer, but the right answer is "YES".

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

          I see, so it doesn't give RE only because that memory region is luckily located within the program scope. Well, at least it didn't pass the systest. Thanks for the clarification, it was very helpful!

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

Whats the hack for div 2 A?

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

10000 1 2 -3 -3

So many fell to this single test in div 2 B :-P..

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

Was it possible to solve Div2.D on Python? I tried all my best, and solution is very simple, but Timeout on pretest 8...

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

I couldn't really understand the statements. I read problem A like 5 times.

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

    i read it like 20 times til i understand it

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

    I can't still figure out what I should do. Can somebody explain the statement to me? TT

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

      they are moving the same monster alternatively, I read it more than 10 time to figure that out :(

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

      in simplified version, you and i takes turn alternately and choose some number from our set

      my set = {4,3} your set = {2,5,3}

      let x be the initial position of the monster and i were about to move first

      your task is not to make the monster went to the blackhole, and my task is to do so. for example N = 5 and x = 2, and i choose to move 4 steps ahead which makes the x = 1 (circular) then i win, in other case i can move 3 steps which makes the x = 5 and you takes the turn to make sure i can't make the monster into the blackhole

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

      Well you have an infinite game, you have a position and turn. In your turn you take any of your numbers and change position into (position + chosen_number) % n. If you got into 0 -- you win.

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

I think problem E was just a persistent segment tree .Let A be the original array. Make a persistent segment tree B such that position j of the i'th version is 1 if there is no value equal to A[j] between A[i],A[i+1],....,A[j-1]. Once we have this we can do a greedy construction, because we can find the farthest possible endpoint for the next segment in time log(n).

Is this the intended solution?

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

B was easier than A

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

Условие задачи B какое-то наркоманское :) Что нужно делать я пытался понять из тестовых примеров

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

    Хоть я и серый но напишу. Да бывает и такое, что условие сложнее задачи, я вот тоже сам по примерам понял, но блин какой же это труд- донести до участника, что нужно делать, и вроде ругаться хочется за такое условие, но в то же время я благодарен, что дают мне возможность решать задачи, так бы переводил через гугл переводчик(брррр)...

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

      У меня было ощущение, что условия сегодня и переводили гуглом или яндексом. Не припомню ничего подобного ранее

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

Just 10 more seconds ... (and a faster Internet)

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

Pretty nice contest (although I failed).

B was really nice but I didn't like A.

On C can I coded a solution (which I thought was and I still think so) the idea was that you change the answer at most when you change the K. Also the answers are decreasing so we can do a divide and conquer with at most times computing/doing the O(N) solution for fixed K. Can someone provide a test case which fails that, because it TLEd?

Also how to solve D?

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

Is O(n * log23(n)) the intended complexity for C?

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

    Nope

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

      Then can you give me some hint how to improve this? I used binary search + Persistent IT.

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

        Greedily do for K = 1 — 1000 in O(n). Now notice that for K > 1000, answer will be <= 100.

        Binary search on the range to get answers that lie b/w x for x from 100 to 1.

        For a single x it will take at max O(logn*100*logn*logn) This passes for me in < 1 sec

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

          Yes I done on the similar way.

          First I found article where I read problem with amount of distinct numbers online in O(log n) per query and used existing code. Saw it is not enough to pass testcases, so I calculated first sqrt(N) values before binary search :)

          Other time at the round I spent in reading first problem :D

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

    my solution is n^2, although I don't know if it a solution quite yet.

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

    I got TL8 with O(n log^3 n)

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

i think it was very hard round for DIV2 , am i right or not ?

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

I tried div1 C O(n * sqrt(n)) but it has TLE. Hahaha....

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

див 2 задача B ваще не понятная! смысл понять трудно ! хотя думаю она легкая была (

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

I hope 2*10^4 dfs in problem D will fail? In other case I don't understand why it's D. I decided to look at the submitted solutions and it made me sad.

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

harder than usual but problems are so nice!

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

We need Nicolas Cage from National Treasure to figure out the problems' statements :( . I read the statements many times to understand the problems :(

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

The Russian statements look much like a result of some automatic translation: the order of words is as in English, and sometimes the meaning is messed up, too. Still possible to understand, but English version looks more readable to me. Looked way better when Codeforces had staff dedicated to translating the statements, like Delinur.

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

    There should be no Russian at all. Authors should just focus on English. Quite often there was a reverse situation when native Russian speakers didn't care enough for good english statements.

    The whole codeforces.ru should be translated into english and removed.

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

The problems are too hard to understand.Could you make the problems become shorter,it is unfair to poor English men...like me

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

can't figure out why my solution 25749847 for B is failing. could anyone please have a look.

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

Are all round prepared by PrinceOfPersia have a hard Div 1 A? Or am I too weak?

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

Test Case 24?

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

Fastest System Test ever :'D

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

WHat is the proof Of DIV2 A ? I cant guess the impossible (-1) case . When it will be impossible ? And whats the proof ?

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

    if both guys from same planet are in the same group then that group is not the required group as both from the same planet can't be traitor at the same time

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

    For example:

    a = 2, b = 1, c = 4, d = 4.

    We are adding even number to odd number, so it will be odd number, but c and d are even, their sum will be even to.

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

    b + n * a = d + m * c
    therfore :- a * n + (-c) * m = (d — b)
    this can be solved using extended gcd. if (d — b) % gcd(a, c) != 0 then answer is -1.

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

I tried Bezout's Identity for Div2A . But it failed....can anyone correct me.

Also, I can't think of when would it be -1.

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

That moment when you get div. 2 problem A wrong in system test

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

pretty balanced

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

It isn't a good idea to make Div1 A so difficult.
795 users registered for this Div1 round but only 343 made at least one submission.

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

This time lots of Hacks & System failures! :p

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

Please Can someone tell why i got WA in Prob B ?

http://codeforces.com/contest/787/submission/25753050

///

I got accepted.

same number can come...

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

So easy div2 B problem, but so difficult-to-understand problem statement.

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

Puzzle: Name of all problems are names of Eminem songs, except for Div.1 E. Eminem has no song named ALT, so what is the story behind ALT!?

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

Could you guys help me with why I got Div2B wrong?

http://codeforces.com/contest/787/submission/25748568

I think I misunderstood something.

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

b should be 1500 and c 1000

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

PrinceOfPersia EVEN A BLUE CODER OR CYAN CODER CAN MAKE CONTEST WITH UNIFORMITY IN PROBLEMS LEVELS THAN THIS CONTEST.FOR EXAMPLE,TAKE SOME PREVIOUS CONTESTS

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

Beautiful arts) I was enjoying this contest)

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

My code of div2B WA vs AC after contest
My Code failed on #59. Can someone explain me how this passed 58 test cases ! !!
My best experience in CF.... I will remember it :'(

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

Is it rated?

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

Задача С. Прохождение фором от 1 до n заходит, от n до 1 не заходит. http://codeforces.com/contest/787/submission/25754445 http://codeforces.com/contest/787/submission/25754351 Разницы в решениях никакой. Насколько я понимаю — это проблема в тестах.

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

please i want to know something: i made this submission during the contest: http://codeforces.com/contest/787/submission/25739022 and then i made another submission in the same problem because there was something i was not sure of, the other submission was hacked, and the first submission above was counted hacked also as you see in the submission link

after the contest i submitted the above submission again exactly and it is accepeted: http://codeforces.com/contest/787/submission/25754392

is this normal ?

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

    I'd guess a yes

    It is probably because only the last one that passed all the pretests count for the contest, so your correct submission during the contests technically did not count

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

A positive rating change means absolutely nothing when u know u have not done well at all in the contest. :(

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

Hello, I think I found a mistake in system tests in task B. Time limit is 2s and I've found the test in which solution has been executing for 2.8s but system test said that it is valid.

http://codeforces.com/contest/787/submission/25744252 the test is :

10000 1

10000 1 1 1 1 1 1 1 1... 1

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

I was able to lock my solution after being hacked. HOW?

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

Till I Collapse -> Пока я срываюсь

картинка

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

wasn't the character next to Rick in div1 D (Rap God) Pearl from Steven Universe?

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

I've got a mysterious submission issue;

Here's my code:

http://codeforces.com/contest/786/submission/29148189

It meets a RTE with a exit code which usually means array/vector visit out of range.

But my vs2017 report nothing and runs well, and I had never disable runtime warnings.

So I submited it in MS C++.

The first time it runs and I've got a minor mistake.

before correction

after I corrected it with only one line, it cannot even compile.

after correction

And the bs reason

Can't compile file:
program.cpp
program.cpp(58) : error C2143: syntax error : missing ',' before ':'
program.cpp(58) : error C2530: 'i' : references must be initialized
program.cpp(58) : error C3531: 'i': a symbol whose type contains 'auto' must have an initializer
program.cpp(59) : error C2143: syntax error : missing ';' before '{'
program.cpp(61) : error C2228: left of '.first' must have class/struct/union
        type is 'int'
program.cpp(61) : error C2228: left of '.second' must have class/struct/union
        type is 'int'
program.cpp(62) : error C2228: left of '.first' must have class/struct/union
        type is 'int'
program.cpp(62) : error C2228: left of '.second' must have class/struct/union
        type is 'int'
program.cpp(113) : error C2143: syntax error : missing ',' before ':'
program.cpp(113) : error C2530: 'i' : references must be initialized
program.cpp(113) : error C3531: 'i': a symbol whose type contains 'auto' must have an initializer
program.cpp(114) : error C2143: syntax error : missing ';' before '{'
program.cpp(115) : error C2228: left of '.first' must have class/struct/union
        type is 'int'
program.cpp(115) : error C2228: left of '.second' must have class/struct/union
        type is 'int'
program.cpp(194) : error C2143: syntax error : missing ',' before ':'
program.cpp(194) : error C3531: 'j': a symbol whose type contains 'auto' must have an initializer
program.cpp(195) : error C2143: syntax error : missing ';' before '{'
program.cpp(196) : error C2143: syntax error : missing ',' before ':'
program.cpp(196) : error C3531: 'k': a symbol whose type contains 'auto' must have an initializer
program.cpp(197) : error C2143: syntax error : missing ';' before '{'

I got really frustrated. Can someone help? What's going on?