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

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

Всем привет!

Я рад пригласить вас на Codeforces Round 534 (Div. 1) и Codeforces Round 534 (Div. 2), которые начнутся во 22.01.2019 17:35 (Московское время). Раунд будет рейтинговым для обоих дивизионов.

Задачи были подготовлены мной, Иваном isaf27 Сафоновым, Денисом altruist Анищенко и Ильдаром 300iq Гайнуллиным. Спасибо Um_nik за тестирование раунда и MikeMirzayanov за системы Codeforces и Polygon.

Вам будет дано пять задач в каждом дивизионе и два часа на их решение.

UPD: Разбалловка будет следующей: Div1:500-1000-2000-3000-3500, Div2:500-1000-1500-2000-3000

UPD: Поздравляем победителей!

Div. 1:

  1. mnbvmar

  2. whzzt

  3. aid

  4. dotorya

  5. TLE

Div. 2:

  1. aequa

  2. RatingBooster_2

  3. ujerpacul

  4. Igor_Zakharov

  5. halohalo

UPD: Разбор

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

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

First time seeing 0 comments in a codeforces round blog :p

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

    Maybe that's because you checked it right after it was created? Your comment is just an elaborate way of saying well known "First!"

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

Whoa!! What a short precise round announcement.Hope problem statements are like that too :p.

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

i'm really happy i became expert after the last contest.
now i really hope this one won't have the useless math involved. god, please don't mix these two things together. it doesn't make any sense.
let's hope for a decent problemset, everyone

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

"I'm glad to invite you to Codeforces Round #534 (Div. 1), which will be held on Tuesday ..... The round will be rated for both divisions."

Great, this time I can participate in Div1 without being in Div1 :).

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

Looks like the last three contests (including this) were written by first-time problemsetters.

A lot of people complained about the problems (as they always do, tbh) but I personally enjoy seeing some fresh faces among the problems setters; looking forward to the contest!

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

first!

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

codecmeme

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

Hope the problem statements will be as short as the blog.

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

MikeMirzayanov Could you please consider banning account ....................? Not only does he constantly write annoying, non-constructive comments, he also likes to intentionally offend other users. Examples are abundant. I don't have much knowledge on networking, but is it possible to find his internet gateway's IP and ban him from there? So he can't create other fake accounts.

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

...

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

Sounds good..Hope the contest will be good as like as this announcement..

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

My mind says study for exams .. my heart says participate in cf rounds.

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

I have just eaten a whopper

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

Why am I unable to register on Div 2 right now? Will there be any late registration, if yes, how long after the contest starts ?

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

All the best to all

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

Unable to register for div 2.

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

    Registration closes 5 min before contest. Wait for late registration (10 min after start of contest)

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

    This is speedforces. If you still havent registered dont even bother giving this contest.

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

Problem C should be a little harder and problem D and E should be a little easier than today's for DIV 2 . Recently most of the DIV 2 contests have been unbalanced.

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

comment.skip();

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

    No, it's actually good to have interactive problems, we will get used to it, but the difficulty should be not this hard for DIV 2. I personally have never solved an interactive problem here. But i think it is fun.

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

    if(problem.interactive()) binarySearch.learn();

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

      yeah, i agree with you, i tried to solve using binary search / using power of 2's but couldn't get the logic used.

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

Score distribution for Div2 should be 500-750-1000-5000-20000-100000.

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

Missed today's contest, due to internship :(

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

How to solve Div2-D/Div1-B?

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

    I guess we have to consider first 45 fibonacci numbers but then when we find between which two fib's is A I don't know how to find it

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

    First, find p such that 2p < a <  = 2(p + 1).
    "? 2^p 2^(p+1)" // At max 30 queries.
    Let x=2^(p+1).
    Binary search on (x/2,x]. // At max 30 queries.
    "? m x" // At max 30 queries.

    Take care of a = 1.

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

      Haha, the "take care of a = 1" part definitely was tricky. I managed to fix it about 30 seconds before the end of the contest, and the servers were a bit slow, and I only found out my solution was correct when the problems opened for practice..

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

    If you consider every (x, 2x) pair from x = 1 to x<=1e9, the answer would lie in the first pair where it will answer 'x'. This is because if a > 2x, it will always answer 'y'. This would take 29 queries.

    Let's call the first found segment (X, 2X). a would lie between X+1 and 2X. So, we can binary search with low = X+1 and high = 2X asking query (X, mid) in each iteration (If a is greater than mid, we will get 'y' otherwise 'x'). This would take 30 queries at max.

    Does anyone have a better solution by the way?

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

последние 4 минуты все дико лагало, не успел взломать одно решение, так как кнопка "взломать" тупо не нажималась :(

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

Can someone explain what the hell is going on with pretest 1 to div1B, div2D?

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

    Well for B, implement stack, and if you erase character, it will be the value s[i] is same as top of stack.

    As for D implement log(n) answer, imagine you have some x and y (x<y). If answer is x then answer is in segment [x+1,y]. Then you can notice that incrementing by power of 2 (like (1,2);(2,4);(4,8);(8,16)..) you can find if answer lies between some of these segments. And special case is when a=1. At least that's how I wrote it out.

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

What's wrong with this answer for D? I got like 20 idleness limit excedeed.. I flushed after every answer, what could be else?

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

Very weak test case in B. Even if you delete a single repetition in a traversal, you will pass the pretest. For eg — for string — abccba delete cc start again from i=0.

And to my suprise, I got an unsuccessful hacking attempt in that. (code: 48750680) He had used erase function (unknown complexity) and was using above described method.

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

    Got 4 unsuccessful hacks because of that. People who used std::erase() got it in ~750ms on the worst case(Palindrome of length = 10^5 using 'a' and 'b').

    Codeforces systems are fast, really fast :(

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

      I ran the .erase thing on custom invocation with my hack case. It ran in 600ms. The .substr submissions ran in 1.2s

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

        erase may be close to O(1) but still you will have more than 10^9 operations.

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

      However I got one Successful hacking. He too had used similar method. But he added characters to a string one by one. Seems erase function played its magic for many.

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

    A lot of N^2 solutions passed B. Compiler magic works wonders.

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

div2 D was a nice problem. how to solve it. I think something related to bits.

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

    Used binary search. Twice.

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

      can u explain a bit more , how bs will lead us to answer ?

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

        First,check if a==1(by asking"? 0 1").

        Now think about "? x y" when x < y ≤ 2x and you know x < a,if the reply is x,you can make sure that x < a <  = y,otherwise y < a.(since x < a,,if x < a ≤ y, and the reply is x)

        So you can ask "? 1 2","? 2 4","? 4 8"until the reply is x,now you can make sure that (i is the first number in "? x y").Now you can use binary search to find the exact a(i + 1 ≤ mid ≤ 2i,so you can check if a <  = mid by asking "? i mid").

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

Problem A was absolutely one of the worst problems i have ever read , not that it's not clear, it just wasn't even a problem.

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

Me after solving div2 A-B-C:

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

Problem D pretest 4? Whats wrong with bitmask dp solution?

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

Can Div2D be done with binary jumping?

I was exceeding the 60 question limit for some reason.

I was printing

(0, 1)

(1, 3)

(3, 7)

(7, 15)

Untill it returns x (it will once return x)

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

Using brute force (string::erase(i,i+2)) can easily accept DiV2B.

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

    Wont it time out because string erase is linear? I guess.

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

      It didn't ! Even it didnt timeout for the people who deleted single repetition in a single iteration. maybe codeforces upgraded its server(which do the testing) ;D and downgraded the servers running the site.

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

How to solve D? My solution works in something like 611·11, but it passed pretests in 1 second. Is there a faster solution? Or is there no test where the number of operations is close to my bound?

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

codeforces was a bit slow at times for me.

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

How to solve C?

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

    Let's run dfs. If number of leaves is at least k than we can find k cycles, otherwise we can find a path with length at least n / k.

    I didn't get AC, but I think it should work

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

    Build dfs tree from some vertex. If its depth is at least n / k then we found a path. Otherwise by pigeonhole principle tree has at least k leaves. Let's choose k leaves. Our tree is a dfs tree, so all edges not in the tree go from some vertex to its ancestor. Each degree is at least 3, so each leaf has 2 edges going up. Each of these edges forms a cycle. If both of these cycles have length divisible by 3, then we can build a cycle with both of these edges and its length will not be divisible by 3.

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

      What about the 10^6 total numbers printed requirement? Can't the cycles become very long like this?

      EDIT: obviously depth is at most n/k, so nevermind

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

        The depth is less than n / k, so we output k cycles of length less than n / k.

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

      I couldn't understand some things, how does pigeonhole principle tells us that tree with atmost n/k depth will have k leaves?

      Also, in case of no solution (-1), couldn't there be a path if we have taken the dfs tree from some other vertex? How do we prove there couldn't be another path even with any other vertex?

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

        Suppose T is a rooted tree with leaves. If the depth of any leaf is at most d. Then T has at most nodes.

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

      We don't even need k leaves. It should be enough to go through all vertices in decreasing order of depth, if a vertex was already in some cycle then ignore it, otherwise take a backlink from it. This way, the vertices for which we choose cycles are already representatives and we either cover the whole tree with less than k cycles (so one of them has to have length  ≥ n / k) or find at least k cycles.

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

      If both of these cycles have length divisible by 3, then we can build a cycle with both of these edges and its length will not be divisible by 3.

      Hm, can you explain why? Upd: Ah, nevermind, those back edges are guaranteed to go the ancestor, they can't be cross edges. So if depth of leave is x, and depths of those 2 vertices are y and z (let's assume y < z), length of cycles are 1 + x — y, 1 + x — z, 2 + z — y. If first two are divisible by 3, y — z also is => last cycle is not divisible by 3.

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

great contest except D which had some math and that's why me and a lot of other people couldn't do it. see? don't mix math and programming together.
don't math in here, it doesn't belong here

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

    don't cook soups with water, water doesn't belong in cooking, it's not that tasty

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

Div.2

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

Should have warned the participants that there would be interactive problem : (

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

I try to hack some submissions of Div2.B (O(n2)). After I got a sucessful hack, I found that some code using string::erase won't be hacked, even though the worst complexity is O(n2).

Such as this submission

So I push a question.

I got this.

UPD: maybe the reason is wrong, I just want to say some O(n^2) algorithm can pass it.

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

    mine actually got hacked with that time limit?

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

      Yes. Your code's worst complexity is O(n^2)

      But I don't know why I can't hack that which is similar to yours.

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

    string::erase uses a __builtin_memmove function call (as defined in basic_string.h, char_traits.h), which is just a well optimized function. For example, check vincentgable.com/code/memcpy_memove_lab.c code which memmoves an array of size 4 million 100 times in 0.03s, so can do 1.4e10 operations in one second, which contradicts the standard rule of "1e9 operations in a second" but does not mean the answerer is wrong...

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

      But it traversals all the string n times.

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

        Yeah, and the whole string is of length n, which is about n2 operations, or 1010 in this case, which he just pointed out can be done in under a second with how well optimized std::memmove is.

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

Why I can't hack this solution on maxtest? Asymptotics of his solution is O(n^2). My test: ababab...(50k)aaaaaa...(50k). Every time it is still possible to remove something, it runs through the prefix of 50k elements. Total 50k * 25k * (erase)> = 1.25 kkk. Now I can not show that I sent such a test, because the link is not available to him.

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

    I think this gives worst case.

    char s[100000];
    for(int i=0;i<50000;i++) {
        	int ii = i%26;
        	s[i]=(char)('a'+ii);
        	s[100000-1-i]=(char)('a'+ii);
    }
    
  • »
    »
    5 лет назад, # ^ |
      Проголосовать: нравится 0 Проголосовать: не нравится

    erase doesn't probably shift all elements ahead of a deletion. And it gives much better than O(n)

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

How to do Div2D,Div1B,I'm so self closing orz orz orz

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

Can anyone tell me, what solution for Div2D is? I am sure that it is a kind of binary search, but I have no idea, how to use it here

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

    I couldn't pass pretest. I used the graph of x mod a. start with x = 1. x = 1, y =2. check if and y lie on the same bar i.e. x and y are less than a. keep doing this with x = 2, y = 4 then x = 4, y = 8... . The moment y reaches next bar, there are only two possible conditions: x%a = y%a or x%a > y%a ( I'm not sure about this one. I used graph to get this). In second case, if you go from x to y, then X%a first increases, becomes 0, again starts increasing. So apply binary search in this region to get the value at which X % a is 0 and this value of X is ans as you are at end of first bar. In first case, ans will be y — x. I don't know what's the mistake in it.

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

    Ask for {(0,1), (1,2), (2,4)... (x,2x)} until x % ans > 2x % ans, now you know x < ans < 2x. Binary search between x and 2x can do the rest.

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

I submit same code twice for second Question but on first submission it give wrong answer on Pretest case 10 but again on submitting same code all pretest passed.Unable to understand Why??

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

interactive ~ binary search

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

What is the point of limiting hacking tests to one test case per input (like in Div1B)? What if I find some slow solution and wanna create multiple test cases to make it TLE?

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

    Usually it's done to disallow the hacking attempts by throwing loads of random test cases into solutions that "just don't look right but I'm too lazy to create a hack".

    But yeah, there are also some disadvantages of this rule (your argument being probably the most important).

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

    Maybe the setter just wants to let slow solutions pass, with the time limit there just so you don't hog CPU time. Consider that problems with a limit on queries correspond to situations where you have plenty of computing power for yourself, but communicating with the oracle is costly.

    UPD: I forgot about non-divisibility by 3, which of course breaks this solution. Dealing with it isn't hard, but we need the leaves — or more specifically, we need to encounter at least K vertices with at least 2 backlinks.

    Also, I got AC despite a small bug.

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

    Also, this restricts you from hacking solutions which fail on subsequent test cases usually because global variables are not reset.

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

Div2D/Div1B was a really nice problem. Here's how I solved it:

Key insight, notice that if you guess (k, 2k), then you will receive response "x" if and only if . Then, we can guess (1, 2), (2, 4), and so on, and for the first n such that (2n, 2n + 1) returns "x" rather than "y", we know that lies in the range [2n - 1 + 1, 2n]. We can use a binary search to find , and then test the two possible values of a. Note that to test a value of a, simply query "? 0 z", which will return "x" if and only if z = a.

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

How to solve Div2 B in linear time?

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

    We have to match same characters similar to as in balanced paranthesis. Stack can be used for that purpose. Along with that keep count of number of matches. If number of matches are odd then first player is the last one to make a move otherwise second player is the last one to make a move.

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

The worst contest in my life

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

Could anybody help me why I am getting wrong answer in div2c:Submission

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

How to solve div 1 c / div 2 e?

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

Probably the most rubbish round I have ever participated in.

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

А я не успел отправить решение, так как сначала секунд 30 кнопка отправить не работала, а затем, пока решение отправлялось, время вышло, поэтому посылка не дошла. P.S. даже комментарий смог отправить только со 2ого раза.

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

Why I try to hack this solution while system told me

but actually he didn't resubmit or had been hacked. Could someone explain this (Is it a bug?)

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

    This happened with many times and really made me scared. This happens with me when I have ranklist or status page and contest ends.

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

      Just as you said,I submit my testcase and click the hack button 15 sec before contest ended and what I said above happned.

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

    Yes, this has also happened to me when I have a solution opened and the contest ends. It's just that the message needs to have "or the contest has ended" appended to it.

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

How to solve Div1D?

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

~

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

Mr_Emrul is a hacker))00))101001101))

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

Did anyone notice MikeMirzayanov profile shows Headquaters? CF is upgrading in every aspect. But atleast decrease the Time Limit if servers are running faster.

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

Not at all suspicious hacking of A:

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

    This is hackers profile Mr_Emrul

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

      two hackers vatsals1

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

        I am not the hacker but Mr_Emrul is. It can be proven because the first hack attempt was made by him at about just 2 minutes after the code was submitted by xzccry. I was trying to solve D but later I thought about hacking and I found that xzccry was being hacked so I also attempted him to hack just like everyone else but later realised that it's too dumb and I am just wasting time on this stupid thing and left it. Mr_Emrul was still hacking him and thus he should be at fault if someone should be.

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

          I hacked his first submission after 2 minutes of his submission because, after my B got hacked, I was searching in my room for hacking. And I finally got his submission.

          Moreover, I already requested to the judges for skipping these hacks. Because, I did these only for fun purpose, not for getting fake ratings.

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

            Only I and you were hacking his submission which means either you or I am the main account because the person who made this fake account would not be submitting these many submissions if he was not in the same room because he can't benefit from it. So it's probably you.

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

    notorious_coincidence

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

Ban this profile Mr_Emrul, He cheated using fake account xzccry hacks.

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

What's wrong with this solution(https://codeforces.com/contest/1104/submission/48757133). I know it should get WA for a=8(I fixed it later). However, I have no idea why I got TLE.

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

is it really necessary to set the number of questions limit to 60?

many solutions got idleness limit exceeded just because of asking about 61 or 62 questions!

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

    The limit is very deliberate. I think you even have at least one extra question as a buffer, the highest I ever saw when testing my solution was 59.

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

Why solutions of B with O(n2) are accepted? I got unsuccessful hack because of that https://codeforces.com/contest/1104/submission/48742016

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

Mr_Emrul hacked his own submissions with another handle. (That's what it looks like)

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

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

      How much fun did you have doing it? Do you recommend to others?

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

        No. I realized now that doing these hacks basically useless. And I am feelling guilty for that, may be I could find idea of D if I tried instead these hacks.

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

When the total number of test cases are 76 and you get wrong answer on test 75. :( 48734381 P.S. And then you just remove a condition and get AC. :P

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

can anybody tell me what's wrong with my submission for problem C 48763210

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

    Try for the case '10000'
    You output
    1 2 1 1
    1 4
    3 4
    1 4

    After you put a tile on {1, 4} the first time The board looks like

    ....
    *..*
    ....
    ....

    When you put on 1 4 again, it overlaps with the piece left on 2 4.

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

Some number of wrong solutions passed the tests for problem B, having complexity O(n2). Is anything going to be done about this? I hacked two of those solutions, so I think it could've been avoided with stronger tests.

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

I was able to solve problem D in O(XP4P) were P is the number of prime factors of the gcd of the array and X is the number of distinct numbers in the array considering only the prime factors in the gcd.

however, I am not able to recognize what is X in terms of P I know that it is inversely proportional to P can someone help ?.

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

Hi, why this 48747775 gets WA instead of expected RE?

if (buffer[0] == 'e')throw(1);
»
5 лет назад, # |
Rev. 2   Проголосовать: нравится +3 Проголосовать: не нравится

Div 2 second Question: I knew I have seen this problem in GFG but I didn't want to peek in GFG.I tried a lot, thought of many ways but I was not able to solve it, then I peeked in GFG and tried to understand the code but later I figure out that I have written in my note that this GFG code is out of my ability!! I lost hope somehow I tried to understand that GFG code but when I submitted the code it just gave me a wrong answer. Losing all hope I thought to gave up the contest but just for sake gave that problem one more try and suddenly thought about stack and hurray! I solved it. And later in 10 min I also solved the 3rd one too!! Best moment for me so far !! <3

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

my solution for Div2 C problem,it might be helpful for anyone. I solved it with greedy, just foucs on this 3 cases: 00, 11, 1010....

in first one: you will put the 2 tiles in the last column (first one in last column in row 3 and the other in last column row 1) so you will have 1 4 and 3 4 in second: you will put the 2 tiles in the first row (first one in first column in row 1 and the other in third column row 1) so you will have 1 1 and 1 3 in third: you will start put a title in (last column in row 3) then title in ( row 1 in column 1) then ( last column row 1 ) so you will remove last column and put last title in (row 1 column 3) and delete the first row and so on...

solution: https://codeforces.com/contest/1104/submission/48743875

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

Can anyone tell what is wrong in this:

https://codeforces.com/contest/1104/submission/48755607

Failing on 10th test case!

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

Any ideas for solving d ? how should i do query ?

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

    (2X % K) < (X % K) if and only if X < k <=2X, we do 0 1, 1 2, 2 4, 4 8, ...until first x, then we binary search between X and 2X to find the last point P it didn't switch, then output p+1

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

      HanaYukii is k =a with respect to problem .

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

        Number we need to find

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

          suppose a = 9

          HanaYukii so if we query :

          (0,1) = 1 = y

          (1,2) = 2 =y

          (2,4) = 4 = y

          (4,8) = 8 = y

          (8,16) = 8 = x

          we have to stop at (8,16) ??

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

            HanaYukii ok , i understand ..

            we will stop at 8,16.

            then we do bs using the same property like

            (8,12) (13,16)

            in first return will be x , in second y so x%a > 2x%a so the number will lie in range 8,12

            we again do bs

            8 10 = return 8 = x 11 12 = return 4 = y so again a will lie in 8,10

            similarily we do the same thing untill we find a .

            Am i right ? ?

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

      How do we prove (2*x)%k < (x%k) iff x<k<=2*k ?

      I mean if x<k<=2k then x%k will be x, but (2*x)%k can take values from 0 to k-1 and k-1 can be bigger than x.

      Also, if x%k < (2*x)%k then how can we say that k will be greater than 2*x (the skipping to next step i.e. 2x to 4x). I mean I can see the obvious solution that if k>2*x then x%k==x and (2*x)%k==2*x and 2*x>x (for x>1) but cannot see how it is always true the other way around.

      Sorry if it is trivial but I can't seem to prove/see this.

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

      I am not sure about this claim. Let X=8, K=5, 2X=16. Then 2X%5=1, X%5=3. 2X%5<X%5, but X>k.

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

        i think my iff miss writting an important condition if x>k then iff sorry for inconvenience

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

Был не прав, виноват.

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

A great contest which makes me fall back to blue again TAT. Hope to publish the editorial as soon as possible.

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

mnbvmar is a madman for solving E

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

When will you release the tutorials?

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

Did the contest setter forget to post tutorials? It seems to late!

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

    YA I ALSO THINK SO PLEASE I REQUEST THE SETTERS TO UPLOAD IT SOON BECAUSE I EAGERLY WANT TO KNOW ABOUT THE DIV2D PROBLEM SOLUTION

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

Can anyone explain the input and output of the Div2 D(for i can't understand the evaluation result)

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

    First line of input is number of games, then the number to guess is given each line. Each line of output is expected/actual number of queries used to guess the number. It is OK if number does not exceed 60.

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

Please help me on understanding what is happening on interactive system of 1104D - Game with modulo.

My previous submission, 48831942, outputs "! 161" after starting game with 160. On local environment, it then terminates normally after receiving "mistake" but seemingly does not terminate and gets TLE.

On the other hand, I altered my accepted solution to reproduce the problem on 48846517. It normally gets WA.

Can someone explain exactly what happened on my TLE submission?