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

Автор Gheal, история, 19 месяцев назад, По-английски

Hello, Codeforces! (or as we say in romanian, "Nu renunţ la tine niciodată")

I am glad to invite everyone to participate in Codeforces Round 833 (Div. 2), which will be held on Nov/12/2022 17:35 (Moscow time).

This round will be rated for all participants with rating lower than 2100.

You will be given 6 problems and 2 hours to solve them. All of the problems are authored by me.

I would like to thank the following people, without whom this round would not have been possible:

Here is the scoring distribution: $$$500−1000−1500−2000−2250-2750$$$

Good luck & have fun!

Edit 1: The round is over, the editorial can be found here.

Edit 2: Congratulations to the winners:

Div 1 + Div 2:

Div 2:

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

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

As a tester, holy fuck 2 romanian rounds in a row and 3 cars of polis wtf romania

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

Wish for a positive delta & Good luck everyone...

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

Woahh an early scoring distribution OwO

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

omg no green round

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

Hope everyone good luck! :)

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

Everyone best of luck,,,,

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

I am looking forward to the problems of this contest, hoping to surprise me.

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

down vote me :)

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

Best wishes for everyone

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

As a Romanian, I am delighted to see lots of Romanian rounds lately!

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

Good luck!!!

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

I want to be a specialist in this round.

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

All the best everyone.

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

Hoping to be green in the orange round. Bad luck doesn't allow. Hope so this time maybe i will :)

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

best of luck everyone. Will meet tommorow.

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

I hope next round after this one will be green again

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

unacceptable contest! why can romanians make contests now on codeforces? does no one know how things run among romanians when it comes to programming, especially competitive programming? this is deeply disturbing and I will reconsider whether I want to continue with this website or not. cheers but look into it

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

    No one wanted you to join the contest

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

    unacceptable contest! why can humans make contests now on codeforces? does no one know how things run among humans when it comes to programming, especially competitive programming? this is deeply disturbing and I will reconsider whether I want to continue with this website or not. cheers but look into it

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

      unacceptable contest! why can capybaras make contests now on codeforces? does no one know how things run among capybaras when it comes to programming, especially competitive programming? this is deeply disturbing and I will reconsider whether I want to continue with this website or not. cheers but look into it

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

        unacceptable! why can? does no one know how things run? this is deeply disturbing. cheers

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

Good luck everyone, hope for Candidate Master

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

Good luck to everyone!

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

I intent to become green today!

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

    I can see that you have been consistent for the past few days. Hope you reach green, good luck bro!!

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

Google Kickstart Round H and Div.2 Codeforces contest at same time... :(

(*P.S. I'll go with Codeforces):))

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

among us

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

Hey, my neighbour is Romainian, too. Good luck.

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

What color is your codeforces account? ♫ Tourner Dans Le Vide ♫

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

why div2 ?

i want div3 or 4 for become pupil

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

gl

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

Good luck!(or as we say in romanian, baftaaa baaai)

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

liis Gang!

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

Time to be a specialist.

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

Best of luck Everyone.

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

Wish for a positive delta & Good luck everyone...

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

Mathforces with Awesome round :(

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

Time to be a pupil.

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

B is soo tough...

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

I have never felt more retarded in my life while solving B.

getting WA 3 times because of being a dumbass only

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

Again leaked solutions on YouTube... (https://www.youtube.com/channel/UChJvx-TFKQ5t-T6YyPf1tsw, https://www.youtube.com/watch?v=0x9kKxfqLr8)

This solution for problem B has 1.1K views and the contest is not even over yet!

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

Can't solve B lol :((

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

Unbalanced round.

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

In problem C, my code with std::map got AC but with std::unordered_map got TLE at pretest 7... WTF??

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

How to solve C ?

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

    Construct a prefix array $$$p$$$. Then you can break the original array into segments based on the positions of $$$0$$$s in it. Each segment starts at a $$$0$$$ and ends at the index before the next $$$0$$$. Suppose the positions of $$$0$$$s in $$$a$$$ are $$$z_i$$$, then the maximum score you could get from subarray

    Unable to parse markup [type=CF_MATHJAX]

    is the maximum frequency of any element in the subarray of $$$p$$$ from $$$[z_i,z_{i+1}-1]$$$. I implemented this by using a resetting the frequency count every time I hit a zero, and then finding the maximum among the frequencies when I reached the next zero. Also, any $$$0$$$s in $$$p$$$ that occur before the first $$$0$$$ in $$$a$$$ have to be counted as well. Hope this helps!
»
18 месяцев назад, # |
  Проголосовать: нравится +5 Проголосовать: не нравится

How is D done? I was thinking some SAT solver possibly but couldn't think of a way to calculate divisibility rules of $$$d$$$ efficiently.

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

    My Solution for D:

    Check no solution:Note $$$cal(x)=max(i),2^i|x$$$,if $$$cal(d)>min(cal(a),cal(b))$$$,no solution.

    Otherwise,Let's construct the solution.

    First,let $$$d»=cal(d),a»=cal(d),b»=cal(d)$$$,calculate the $$$x$$$ for the new $$$a,b,d$$$.When outputting the answer, we only need to output $$$2^{cal(d)}x$$$.

    How to construct such $$$x$$$?The key point is make $$$x=(2^{key}-1)+2^{key}X$$$,($$$key=30-cal(d)$$$).

    This is actually a problem of solving congruence equations:

    Unable to parse markup [type=CF_MATHJAX]

    ,use ecgcd to get such $$$X$$$.
»
18 месяцев назад, # |
  Проголосовать: нравится 0 Проголосовать: не нравится

B really shocked many!!!

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

Was pretest 8 of C a hash hack?

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

    Lol, I rewrote my solution to c++ to pass 8
    Didn't even think we could have hash-hack pretests

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

    You're right

    Well, It is nice that they included it in pretests I guess.

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

    I suspect it was, I only passed pretest 8 after adding code specifically to stop hash hacks (mainly xoring each value in the dictionary by a predetermined random value)

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

What was the intended solution for D? I had a solution of $$$O(T * \sqrt d)$$$ but it TLed.

Edit: Ahh, intended was $$$\log d$$$ per test.

Link: 180645422

  • »
    »
    18 месяцев назад, # ^ |
    Rev. 2   Проголосовать: нравится +3 Проголосовать: не нравится
    1. You consider base 2 factors independently — if 2^x divides d, then both a and b must have x clear least significant bits
    2. Now let d be not divisible by 2. We want to use 30 most significant bits, because they are enough. Let's say that a | b has remainder y over d. then we are looking for number x, such that x * 2^30 = d — y mod d. So x = (d — y) * (2^30)^(-1). Then we return x * 2^30 + (a|b)
»
18 месяцев назад, # |
  Проголосовать: нравится +6 Проголосовать: не нравится

how to solve D? i got stuck at the part where you have to find some modulo using some certain bits ;-;

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

Really good E! I like this problem of dp on cartesian tree.

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

How to solve C? I had ideas with dynamic programming but I'm tangled up in my thoughts

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

    The main idea is to split the original array into segments based on the positions of $$$0$$$s. Each segment starts at a $$$0$$$ and ends at the index before the next $$$0$$$. Then I can perform the operations in such a way that each $$$0$$$ only affects its own segment. Construct a prefix array $$$p$$$ and in each segment, find the maximum frequency of occurrence of any element in $$$p$$$ — That will be the score of that particular segment. Also count all $$$0$$$s in $$$p$$$ that occur before the first $$$0$$$ in $$$a$$$. Hope this helps!

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

Problem B can use the enumeration algorithm, this surprised me.

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

I wish I had time to look at F but B took so long because I didn't realize brute force passes it :(

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

    And here I was thinking that it had to be done using 2 pointer+ sliding window

    Then I realized it could be done with brute but was unable to find the maximum times inner loop should work :(

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

In my honest opinion it was the hardest Div 2 that I participated, I could only solve 1, and I lost expert :'v, but I will learn new concepts and that it is great

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

How a simple brute force is getting accepted for B?? what is the time complexity of the solution.

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

    $$$O(100n)$$$

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

    It seems the intended solution is to bruteforce with one simple observation: By the pigeonhole principle, a substring of length $$$101$$$ would have at least one character with at least $$$11$$$ occurrences. So we only have to check for substrings of length upto $$$100$$$, because lengths above that are guaranteed to be non-diverse.

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

      wow giving contests regularly and upsolving is the best way to learn topics thanks i would never have understood pigeonhole principle better than this time .

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

Quick system test!

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

How to solve C . Anyone ?

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

    The main idea is to split the original array into segments based on the positions of 0s. Each segment starts at a 0 and ends at the index before the next 0. Then you can perform the operations in such a way that each 0 only affects its own segment. Construct a prefix array $$$p$$$ and in each segment, find the maximum frequency of occurrence of any element in $$$p$$$ — That will be the score of that particular segment. Also count all 0s in $$$p$$$ that occur before the first 0 in $$$a$$$. That will give you the answer.

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

I did A. Then looked at B couldn't solve it initially. So I skipped went to C. Tried it for about an hour. Then came back to B, after staring at it for a while saw that there was a pigeonhole principle angle which brought the solution under time limit, so did it that way PH principle: ceil(n/h) is the minimum put in h groups if n values has to be distributed among it. so 100/10 -> 10 and ceil(101/10) = 11 which means there is no substring out there of length 101 that can satisfy the conditions. So you can test the substring lengths accordingly. Worst case it goes to 10^5*10^3 = 10^8 which comes under the 1 second condition, 10^3 because 100 values to be checked and say we check all value counts from 0-10 in that case.

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

Hi, everyone. I have given this contest( Codeforces Round #833 (Div. 2)) and got a score of 464. But still, I am unrated. Can anyone plz say why I am still unrated?? N.B. I am new in codeforces.:):) Thanks in advance..

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

My Solution for D:

Check no solution:Note $$$cal(x)=max(i),2^i|x$$$,if $$$cal(d)>min(cal(a),cal(b))$$$,no solution.

Otherwise,Let's construct the solution.

First,let $$$d»=cal(d),a»=cal(d),b»=cal(d)$$$,calculate the $$$x$$$ for the new $$$a,b,d$$$.When outputting the answer, we only need to output $$$2^{cal(d)}x$$$.

How to construct such $$$x$$$?The key point is make $$$x=(2^{key}-1)+2^{key}X$$$,($$$key=30-cal(d)$$$).

This is actually a problem of solving congruence equations:

Unable to parse markup [type=CF_MATHJAX]

,use ecgcd to get such $$$X$$$.
»
18 месяцев назад, # |
Rev. 2   Проголосовать: нравится +32 Проголосовать: не нравится

D is sooooooo cute!!! (Though there is a gap between C and D)

hint 0

hint 1

Unable to parse markup [type=CF_MATHJAX]

($$$?$$$ and $$$1$$$ : $$$30$$$ times).

hint 2

hint 3

Unable to parse markup [type=CF_MATHJAX]

.
You can choose a set $$$T$$$ which is a subset of $$$S$$$ s.t. $$$\sum T_i \times d$$$ is an answer. How to determine the set $$$T$$$ ?
  • »
    »
    18 месяцев назад, # ^ |
      Проголосовать: нравится 0 Проголосовать: не нравится

    This should have been included in the official editorial. I think most of the solutions came from this intuition. Hats off man!

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

B is run in time O(100*n), beacause all numbers [0:9] as a maximum frequency in one sub-string is 10 if it's frequency is greater than 10, then second loop will stop, because no sub-string will be made as no numbers of distinct numbers from [0:9] will exceed frequency of 10. i like this problem.

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

    Can i ask why in your solution you have used i+228 if 100 is the maximum length of valid substring?

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

Why did so many people solve C? I solved D and E but didn't solve C. Are there any good ways to come up with the solution?

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

    I learned main idea when study IOI 2002 Batch Scheduling. This problem's main topic is CHT but provides one observation related to the prefix sum. Other implementations were learned while upsolving code forces.

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

    It was quite simple to come up with by looking at the prefix sum array and the zeros ;-)

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

    bro maybe u were just overcomplicating it. C is quite simple as you can probably tell from the editorial (i havent read it yet tho)

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

180648134 My overcomplicated solution for B which I was restraining myself to implement till the final minutes of the contest.

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

B was leaked by a youtuber. Here is the link. https://youtu.be/0x9kKxfqLr8

You can clearly see its comments was 1+ hour ago from now. I am giving some screen shots.

https://drive.google.com/drive/folders/15e5mFpLw8ESoqK-0A6WXDSxGgzDqIjTV?usp=share_link

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

    and when i look at the solutions many people are suspiciously using that i+228 logic, is there actually any reason for it to be i+228 or is everyone just copying this video?

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

      NOTE: the solution just needs to be i+100 in the worst case thats why this specific number is quite suspicious

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

      LOL if it is 228 then these subs are from the same sources.

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

I failed C for mistakenly specifying the wrong type for the map iterator like a complete dumbo. Why live? Please host another competition soon I need to avenge my stupidity.

Btw is there a way to somehow apply for retroactively rejudging solutions in cases like this? I will respect and understand if not, but could be very appreciated!

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

what a nice round! thank you

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

Congratulations being a fifth place.Jarif_Rahman

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

When speaking of B, if I quote Joma Tech : "Because of pigeonhole principle, child's play"

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

How to solve C ? I read the editorial and I still can't make sense of it, Also does any one know how to start solving C problems this is my 10th round in which I only solve A, B and fail C :(

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

    If there are more than 10 * 10 + 1, we can realise that there is at least one digit that appears more than 10 times. It is because there are at most 10 digits, and if those digits doesn't appear more than 10 times, it means that there are at most 10 * 10 numbers, which contradicts what we are saying. (I think the rest is the most delicious part of the problem, so i won't say it...)

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

    Start with the simplest case:

    $$$a[x]=0,a[1],a[2],...,a[x-1]≠0,a[x+1],a[x+2],...,a[n]≠0$$$.

    How to determine the value of $$$a[x]$$$?

    Case1:make $$$a[1]+a[2]+...+a[i]=0$$$,the contribution is $$$1+cnt$$$,$$$cnt$$$ is the number of $$$y>x$$$,which make $$$a[y]+...+a[n]=0$$$.

    Case2:make $$$a[1]+a[2]+...+a[i]=k$$$,the contribution is $$$cnt$$$,$$$cnt$$$ is the max number of $$$y>x$$$,which make

    Unable to parse markup [type=CF_MATHJAX]

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

Hey, I get too nervous while giving contests. Any tip? I feel like I have enough knowledge to keep on solving A, B, C but I get too nervous while the contest that I mess up.

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

Awesome problems(at least A-D). But it's sad, that completely stupid 2e9 solution passes pretests and falls on systests. 1e9 is AC

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

Was C leaked like B and A somewhere? I feel like this C is harder than the usual C div2

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

B took much longer time than C.I solved B just one second before this contest over.But I still lose a good oppurtunity to become expert.

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

I believe question B should have been a C and question D should have been an E

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

In D, is there any reason there are two numbers given (a and b)? I think the problem works with a single number just as well, or am I missing something and it becomes very easy with one number?

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

    I think you're right. If there were an easier way to find $$$x$$$ for only one number $$$n$$$, then the problem can be solved by finding $$$x$$$ for $$$n:=a\vert b$$$?

    Adding more numbers doesn't increase the difficulty.

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

Would you please review my C? My code is bad because I am messed up during the contest. Only solve() is meankngful. Others are trash.

Fail at no.4227 at test2. And another failed contest.

https://codeforces.com/contest/1748/submission/180647355

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

I registered 20 minutes after the contest started will it be rated?

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

Really unacceptable! Isn't the codeforces rule that only pupil or below can set a round? Why can an orange coder set a round? The experience of this round will definitely be bad! I can't accept it at all!

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

My solution on C is uphacked for TLE. The cause seems to be the usage of unordered_map. See 180668799 and 180668851. The only difference is that the first one uses map and accepted, while the second one uses unordered_map and TLE.

Is unordered_map really that bad on performance? Am I using it in a costy way?

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

    Weired. I find some benchmark showing that std::unordered_map outperformed std::map on every use case. I have totally no idea what is going on here.

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

      Hmm changing compiler from g++ to MSVC resolves this issue, interesting... See [submission:https://codeforces.com/contest/1748/submission/180670005] which is exactly the same code as the one getting TLE I mentioned before. but accepted with MSVC.

      Looks like it's not my fault. Maybe there's something wrong with the compiling flags?

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

      Ouch, the hash function, of course... Thanks a lot for your reply, and the guy below too.

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

When we will get rating changes?

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

where rating where

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

Why codeforces don't make any hack phase in the regular rounds about 1 hour or even permit any rate account to uphack any solution ?
below there are huge number of hacks after the end of the rounds.
codeforces round 833
codeforces round 830

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

Dang I cheated but my rating wasn't taken away...

Well yay my rating got removed

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

For problem B why do we do (fr[s[j] — '0'] == 1) what does — '0' do here and how will it be equal to 1.

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

    $$$s[j]$$$ is a character and we need to transform it into a number so we can use it as an index for the array, we can transform by subtracting $$$'0'$$$ from $$$s[j]$$$ that will result in the number itself.Take a look at the $$$ASCII$$$ table you will find that the result of subtracting the corresponding $$$ASCII$$$ code for each digit and the $$$ASCII$$$ code for $$$'0'$$$ will result in the digit itself, now we can use that number as an index for the array.

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

      Could you show me an example with the string, "1011101"?

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

        How would subtracting a character with '0' result in the number?

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

          Take for example the character $$$'1'$$$,How can we get the number $$$1$$$ from the character $$$'1'$$$ ?

          The $$$ASCII$$$ code for the character $$$'1'$$$ is $$$49$$$,

          The $$$ASCII$$$ code for the character $$$'0'$$$ is $$$48$$$,

          $$$ '1' - '0' = 49 - 48 = 1 $$$.

          This is how we can get the number $$$1$$$ from the character $$$'1'$$$, This can work with any other characters

          Unable to parse markup [type=CF_MATHJAX]

          .

          Note that this only works with characters and not strings (you can't get the number $$$"1011101"$$$ using this method), instead you can get each character at a time and calculate the number based on its base.

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

Personally, I think the problems F are not very difficult. They are very good. They do not involve advanced algorithms, but simple thinking problems

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

good morning :)

»
18 месяцев назад, # |
Rev. 4   Проголосовать: нравится -12 Проголосовать: не нравится

..

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

I got this message from codeforces:

Attention!

Your solution 180610916 for the problem 1748A significantly coincides with solutions nilan12/180610916, vishu.ut/180611741. Such a coincidence is a clear rules violation. Note that unintentional leakage is also a violation. For example, do not use ideone.com with the default settings (public access to your code). If you have conclusive evidence that a coincidence has occurred due to the use of a common source published before the competition, write a comment to post about the round with all the details. More information can be found at http://codeforces.com/blog/entry/8790. Such violation of the rules may be the reason for blocking your account or other penalties. In case of repeated violations, your account may be blocked.

This is probably due to both of us using the PyRival template and the problem being quite simple; how should i resolve this?

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

    By doing precisely what you did! Simply comment on it with all the details, like you did. Your rating should come back soon.

    Although it is very sus that the two submissions are less than a minute apart and the code is ridiculously similar... it is too simple to know if you cheated or not.

    In the future, be safe and make your own templates.

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

i got none message and i loss my rating,how can i sovle it ?

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

    my rating someting loss sometime back. what happened?

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

      I think it may just be a temporary roll back caused by either cheaters or wrong cheating detections. I believe that this would be solved in a few hours (or days).

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

Ok so I submitted 180618741 in 9 minutes, and you have disqualified me for a generic Russian number 228 in my solution? I don't use any cloud IDE, neither do I have a clue why a widespread leaked solution has 228 in it, I lost about 80 pts in that contest, but please be so kind to cancel the disqual

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

    There were only 3 successful attempts on B in my room, and the only locked one was made by a random Indian guy at 00:42:02. I haven't checked completely but looks like every other submission was made strictly after this particular moment. Thus, I strongly believe that my solution had been leaked through locking + hacking, akm07 do you have something to tell us about?

    MikeMirzayanov could you also take a look, please?

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

Why is the rating cancelled?

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

Hey, I recieved this but obviously it's not me. What happened?

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

I have received a message that my solution 180643841 to the problem 1748C significantly coincides with solution pqr0xffffff/180627756. But I wrote the code myself, without violating the competition's rules, and I didn't post it anywhere. I have compared both solutions after I got the message, and it is clearly visible that the codes were written independently. The part of code that looks most similar is calculating prefix sums, which is a basic and very commonly used technique, and is written the same way by many people. One more thing that occurs in both implementations is using maps to solve the task, but the most important part differs — my solution uses one map, while the other solution uses two; my solution does some iterations over the map inside the "for" loop, and the other doesn't, etc. I hope that this situation will be reconsidered and I will get correct verdicts to my submissions from the contest, instead of 'skipped'.