Hello, Codeforces!

After a year of anticipation and several complete changes to the problem set, we are glad to invite you to take part in Codeforces Round 948 (Div. 2), which will start on Sunday, May/26/2024 17:35 (Moscow time). **This round will be rated for participants whose rating is below 2100**. Participants with higher ratings may participate out of the competition.

**You will be given 5 problems and 2 hours to solve them**. All the problems in the round are created and prepared by Stefan2417 and alexchist.

**The round may include one or more interactive problems**. Please read this blog to get familiar with this type of problems.

We would like to thank:

- Vladithur for excellent round coordination!

- A_G, JustNik77, AgafonovArtem, MADKIRUS, AndreyPavlov, PBBx0, Alexdat2000, RP-1, mwen, MrDelrus, tiom4eg, ezraft, TheEvilBird, Codula, Vamperox for testing the round and providing valuable feedback.

- MikeMirzayanov, geranazavr555, geranazavr555, vbandurin, ChurakovaAlexandra, medvezhonokok, Vladosiya and KAN for maintaining and developing the Codeforces and Polygon platforms!

**Score distribution**: $$$500 — 1250 — 1750 — 2000 — 2500$$$.

Your perception of the scoring may vary, so be sure to read the later problems if you get stuck on one.

**Upd: Congratulations to the Winners!**

**Div 2:**

**Div 1+2:**

**Upd: editorial**

Auto comment: topic has been updated by Stefan2417 (previous revision, new revision, compare).As a tester, there are some beautiful ideas in the tasks, and I encourage everyone to participate!

Please share that glorious kompot with me!

I can, but I wouldn't recommend drinking it. Also, I can't, see link.

Opaa, not at all like kompot :/

cf > ipl

As a tester, I can assure you that this is definitely one of the rounds ever created.

as a participant, I look forward to it being one of the rounds of all time.

as a participant, will I make it to expert?

Yaaay another round :D

May God bless you with a positive delta in tomorrow's round!

As a participant, I am 100% sure that the contest will happen. Hope it stays!!!

clashing with IPL final

No. IPL clashing with CF. Tell them to change the schedule xD

As a tester

ImageAs a participant hoping to get positive delta today :)

Only the brave coders can participate in a contest on the night before an exam.

Only the brave coders can participate in a contest during an exam.

Need only +1

Hopefully, the problem statement will be short and precise just like the announcement!

wishing to get one step closer to cyan!

Me too

you meant cyan or cm? if its cm then good luck! otherwise I can't say anything :D

Since the last 5 contest I'm stuck at 1100's hoping to cross 1200 this time. Best of luck everyone :)

Finally reached pupil

The score of problem B is 1250!hoping to get positive delta :)

As a participant, I hope I solve 2nd problem quickly :(

memeI sooo want to appear for this round, but same time IPL finals.

Cf>RCB>Finals

C looks buff

It's probably interactive

Yea I think so too.

I think it's time to repeat all Stefan tricks... https://mirror.codeforces.com/blog/entry/117352

I rarely get any positive delta in Div 2. Hope this time is my time. :)

Hoping for a positive delta

cf>>>ipl

Hoping to solve first two problems in short time and get some fun.

Hoping for Becoming cyan participant :)

1750 for C... interesting.

My confidence booster to achieve high positive delta

Alohomora500A to direct 1250B that is some score gaps i am seeing.

Scoring is wild on this one

Kontest > IPL hehe...

now, nikita is a boy!!!! its a girlllll

https://en.wikipedia.org/wiki/Nikita_(given_name)

Low quality problems especially C

Ai can solve problem B like chatGPT 4. there are lots of people who use GPT4 to solve problem B. you can find many newbies who solved problem B but could not solve problem A. Xd I think the round should be unrated. and setters ensure that any problem can't be solved by any AI.

Exactly. Also a few youtube channels show the answers to the problems before the contest ends. It is unfair for those trying genuinely. I am not sure if there is any way to catch those who copied and those who tried on their own. Otherwise ratings of this contest will be false representation of ones capability.

I want the round to be unrated to dodge this -40 delta I'm about to get :(((

It's already hard to check for AI solutions and also it's very hard to come up with div2A which will be unsolvable by LLMs.

I think it's not feasible even now but in 6-12 months LLMs will be able to solve most existing div2A and div2B and some div2C so it will be almost completely impossible to prepare AI-resistant div2 contests.

So are we near to the end of CP(atleast for those solving Div2 A,B & C)? Because most of the participants on codeforces are able to solve only Div2 ABC. If these problems are taken by AI then we will see only purple and above competing.

This is not the end of CP but will create some issues. Cheating is already a problem but it will be way more widespread soon.

You can just ignore cheaters, e.g. compete with your friends or try to solve as much problems as possible. Or maybe at some day there will be alternative rating system which will be based on difficulty of tasks but not in comparison with other participants.

Also, look at chess, they have much worse problem with cheating, it is not only more direct PvP game (so experience suffers from cheating more), chess AI on smartphones is way stronger than humans so the problem persists even at elite level.

Nevertheless, chess is alive and well even though there is a sometimes heated discussion about cheaters and anti-cheating measures.

AI compiles all the data from its dataset and gives you an answer. You may solve Div2A or Div2B (rarely) as it does not contain new things or logic. You can find that AI can solve many standard problems of various DSA topics, which are pretty tough and challenging to understand.

So, for AI to solve problems, the person using AI must know how to solve the problem and what prompt is required to give to the AI model for it to create the solution. AI can help reduce your labour work but cannot think on your behalf. So, instead of crying about it, learn different topics and upskill yourself. Also, Idk if it's valid for you, but if you were unable to solve a problem, then it's your fault or lack of knowledge/skill. You also have the access to GPTs, you could have also solved the problem using the similar way.

Just because you couldn't solve doesn't means that the round should be unrated

Well may be ,if the language of problems is twisted

I wasn't able to perform as well as others == The round needs to be unrated

What a terrible problem distribution, I was performing at ~2000 rating despite having solved only 2 problems, and this was till last 30 mins of the contest.

Speedforces

cant believe beat jiangly to problem E lmfao

.

$$$32$$$ is the number of bits, how you want to solve it?

Because you need to be smart enough to not use brute force, which took me some time to realise

I solved D using hashing. For each column there are $$$\leq n + 1$$$ ways to get only one $$$1$$$. And these "ways" are almost identical. (We should either remove all $$$1$$$ and recolor one $$$0$$$, or remove all $$$1$$$ except one)

is problem C using dp?

I tried tokenize each element by counting prime factor then greedy n^2 but didn't worked.

Yes it's kind of dp, the main idea is that there are 2 options:

So the solution is: check for option 1, if it's not the case just keep

`dp = map<LCM, max_subset_size>`

and add elements one by one (iterate over all previously calculated LCMs) and update dpFor the 2nd point, every possible LCM that can be formed from the subsequences will be a divisor of the maximum. So there are at most ~1000 divisors.

Oh right, it's very simple, thanks!

I used the same approach but got tle. Any particular reason you can think of?

Edit: Got the correct answer was getting integer overflow. while checking intitial condition :(

I had overflow as well initially, thankfully pretests cached it in my case

Hey, I tried coding this out but got WA on test 8. Could you please tell me where I'm going wrong?

Edit: I found my mistake. I did not account for the fact that sometimes the LCM could be so big that it overflows. I simply added a check to see if the LCM ever got bigger than $$$10^9$$$, and it ACed. Thanks!

can you give me hint for B please

Balanced Ternary

x + 2x = 4x — x

$$$2^0+2^1+...+2^{n-1}=2^n - 1$$$

E is very similar to this problem: https://oj.uz/problem/view/IOI23_longesttrip

And yet knowing the solution of longest trip doesn't help you much

is C brute force try all subsets of factors of the largest element to see which subset will give the largest count

Basically, yes. You first calculate the LCM of all the numbers. If that number is greater than $$$10^9$$$ then the LCM cannot be inside of the array, so you just take all the numbers. Otherwise, you iterate over every divisor of the LCM (works in $$$\sqrt{LCM}$$$ time), check for each number in the array if it's divisible, and then return the maximum result. Here is my submission: Submission

good idea, thanks for sharing.

I think if the $$$LCM(array)$$$ $$$>=$$$ $$$max(array)$$$ is more appropriate than checking $$$>=$$$ $$$10^9$$$

can you tell me what you are doing in this line? Thanks

if (tl != x)continue;

Let $$$x$$$ be the considered divisor of the LCM, and $$$S$$$ be the set of all numbers in the input such that $$$x$$$ is divisible by that number. The variable

`tl`

represents the LCM of the set $$$S$$$.For a subsequence to be valid, the LCM of that subsequence is not allowed to be in the input. Now, if the LCM and $$$x$$$ are not equal, there might be a chance that the LCM already is inside the input, so we just skip it. If the set $$$S$$$ was a valid subsequence however, then it would pass this constraint when the considered divisor $$$x$$$ is different, namely the same as the LCM of $$$S$$$.

Yeah, this contest, its uh...., NOT GOOD.

Optimal approach for C?

Find LCM of list. If LCM > max element: answer is n.

Otherwise iterate through all factors of LCM.

If factor not in list. Keep track of cnt of items divisible by factor and LCM of said items.

Answer max(cnt of items for all factors not in list and where LCM(items) = factor).

Now, where LCM = largest value in array = L.

The LCM of the elements for our answer can be only factors of L. So, find all factors of L.

For each factor of L that does not appear in the original array, count how many maximum elements divide it. Ensure that LCM of these elements = this factor. If this is satisfied, find maximum across all count values.

complexity: O(N sqrt(max(A_i)))

Shouldnt there be a log(a_i) factor too ? in time complexity

If you assume computing lcm over a list to take O(n log(a_i)), then yes. However, practically you can assume O(n). See https://mirror.codeforces.com/blog/entry/63771.

oh wow thats nice thanks

How to solve D, I was trying to solve it in O(n*m*min(n, m)), was getting TLE on pretest 19 :(

upd : i got AC

Even I'm wondering how to D. I had some partial ideas , first of all take a particular column j , and make all it's elements zero , by choosing appropriate rows and inverting them. Then we can choose an i such that we will again apply inversion at the row i making this column good with 1 at row i. Now all the other columns , which had a 1 at i_th row and one more 1 at some other row will become good , but the main challenge seems to me is how to find them efficiently?

let mask = j'th column which wan to make specail

if you want i'th position to be 1 and all other positions 0, operation required is

ops = mask ^ (1 << i)

now you can use hashing to store all these ops and pick the most frequent ops

I saw your code and you have the right idea for small $$$m$$$.

For small $$$n$$$ you can just iterate over all the $$$n$$$-sized bitsets that make each column have exactly one 1, group them in a map, and return the bitset that maxes the result.

Code: 262803308

Wow great!! Got it, that’s an amazing solution. I think if we use hashing along with your method, that would pass for any n and m. Thanks!

Upd: I tried Hashing 262808152, getting wrong answer on test 4. Cannot really figure out why, I tried to debug it and there is a collision, 2 different bitsets are giving the same hash. I’ll try to figure out why. Also I tried submitting with multiple different values of mod and p but still the same result :(

I was having the same issue, and I fixed it by having two keys with two different primes (I am using polynomial hashing).

It is definitely not an elegant solution, and I see the other guys doing something with

`rand`

that probably provides a better solution (but I honestly do not understand it).Damn, I never expected it was actually due to collision, because I tried so many values different values of mod. I thought there was some flaw with the algorithm to hash 2 vectors the same. I'll try double hashing then. Thanks!

You can overcome this by again calculating the max value using the hash you found (changing the columns accordingly) . This gives correct answer (I implemented this) but cannot say why this works.

how to approach B?

First convert

`x`

into binary form`10110100111`

.After that fix all positions where you have

`11`

.I'm not sure if it works, but I had two cases:

What about the number which has 29 1's like 2^30-1

-1 followed by 28 0s then 1

if x is odd we can turn x divisible by 4 by either adding 1 or subtracting 1, and if x is divisible by 4 the next element can be 0 meaning there can always be 0 between 2 non zero elements

i need 5 more minutes for D i am too noob at implementation. i had a small bug in code :(

upd : it's a correct AC soln

sadEven though I was only was able to solve 2 questions, I must say the questions were really interesting

Please someone explain Question : D Thanks in advance.

CHATGPT

ChatGPT give me correct solution to B

LOL

I think most of participants use ChatGPT to get the solution

no, I didnt

many participants do cheat but the whole point of solving cp problems is to improve problem solving skills or to get dopamine boost after solving a problem which you don't get just by copy pasting code

Conest should be unrated

I love this round!

B is not easy :(((

TBH this B = normal C, this C = normal D, this D = normal E. Tough round, but you need only 3 instead of 4 questions to get massive + delta.

I just submitted it after the contest my bad :)

My idea was something like this (I'm trying to prove it formally, but couldn't yet succeed) —

If the binary representation has $$$x$$$ digits, then my claim is that — in the given constraints, we can build the array in almost $$$x+1$$$ digits. I wrote a recursive function to implement this.

AC Submission: https://mirror.codeforces.com/contest/1977/submission/262782660

Unbalanced contest, downvoted

how to avoid tle in c?

I thought the problems this contest were nice (and normal). For some reason the standings seem very unbalanced though, so probably my judgement is incorrect.

B was tough ,but as many participants said code of Chat GPT passes ,means many submitted it maybe you should check the question before, i lost my cool when i saw 9000+ submission, man i am bad at this but not that bad. Anyway if someone is interested in Non Chat GPTed solution then here it is 262781288

damn chat GPT is smarter than me

feeling++

during this round i suddenly realised that i have dyslexia

Partial Editorial:

A — If n>=m and n and m share parity( both even or both odd) then yes, else no.

B: Repeatedly do the following until n = 0. If n is even. Output 0 and divide n by 2. If n is one more than a multiple of 4, Output 1 and divide n by 2. If n is one less than a multiple of 4, Output -1 and add one before dividing by 2.

C: If LCM(array)> max(array) answer is n.

Else, iterate through max(arr)'s factors,

For each factor track amt of items in list divisible by factor and LCM(those items).

Answer = max(amt of items if factor not in array and LCM(amt) = factor).

Is it enough to go through max(A) 's divisors only? I went through all divisors of all elements

yes, it is enough to go through the divisors of max(A), because this is LCM(A). All of item's divsors are simply a part of divisors of max(A).

How do you get the idea that if $$$n\mod2==1$$$, decide the next digit based on $$$n\mod4$$$ ??

Looking at sample cases.

Damn! I was just trying and figuring out how to build the array for the whole time in the contest and did not care about samples! Anyway, my approach is seemingly different from the above one (more complex). My claim is that for a number $$$n$$$ with binary representation consisting of $$$k$$$ digits, the answer can be constructed in at most $$$k+1$$$ digits. I'm trying to prove it formally but couldn't do it so far. Submission: https://mirror.codeforces.com/contest/1977/submission/262782660

It must be at most n+1 digits. Proof by contradiction.

If n+2th digit is 0. Then it serves no use.

If n+2th digit is 1. Then number is at least 2^(n+1) + 1 which is impossible as number only uses n bits.

If n+2 digit is -1. Then number is negative unless a higher digit is 1, which leads to same problem as described when n+2th digit is 1.

A non ChatGPT-ed simple solution for problem B:-

If n%4==0, representation looks like "0 0 <that of n/4>"

If n%4==1, representation looks like "1 0 <that of (n-1)/4>"

If n%4==3, representation looks like "-1 0 1 <that of (n+1)/4>"

If n%4==2, representation looks like "0 <that of n/2>"

It meets all the conditions required.

Here's my submission :- https://mirror.codeforces.com/contest/1977/submission/262746874

Looks like there are many ways to solve C. Mine is exactly the same as your editorial lol.

262772972

solved B literally 3 minutes after the contest ended :(

i should have typed a bit faster or something

Hi Stefan2417, in the problem C I have made a small error in factorisation (instead of checking till $$$\sqrt{n}$$$, I only checked till $$$\lfloor\sqrt{n}\rfloor$$$), this caused my solution to be wrong for some cases, one of them is:

`n=4, a=[1,2,3,36]`

If possible kindly rejudge my solution 262765545, I hope I will be cautious next time to not make these mistakes, at the same time I feel it would be unfair if I got a good rank due to this small error.

Why do you care about rating? =)

WA is WA.

Ahh... bad luck. I used to have this feeling 10 years ago (feeling that such a small error should be allowed to rejudge, or why do I have to suffer for such a negligible mistake where my logic/thought process is correct), so I totally understand your frustration. Thanks for making me nostalgic.

Lesson: Error is error. 100% your fault. Own it, embrace it, learn from it, overcome it, grow from it.

Yes agreed, I owned up to my mistake in the comment, can anyone explain why am I getting downvotes? Have I offended someone?

people misunderstood you, thats all. Also dont worry about it, weak tests happen often. I would say you definitely deserved it as you got the problem idea right which imo is much more important.

Ok, so what I think is that people probably misunderstood you: You were saying that your solution was incorrect because of a small typo, but it got marked as correct during the contest, because of which you got a good rank which you feel like you didn't deserve, correct (instead, they assumed that you were saying that your solution got WA because of a small bug, and so you should get AC just because it's so small)? Well, I'm saying that you do deserve it: Just look above / below you, there are so many people with solutions that aren't actually correct for D, but they work on all the testcases. In the end, in competitive programming, what matters is passing all the tests, not whether your solution is actually correct (although for most problems with strong tests, those two are equivalent...). So, if you deserve your rating, you will keep it in the next contest, and if you don't, well you're gonna drop down next contest anyway, so it's fine :)

Thanks a lot!!

Damn, I couldn't even solve B when ChatGPT could :(

MY submission 262742856 was accepted during the round but during testin g phase it got runt ime error on TC 1?I changed my language to c++ 20 and it got accepted.My question is why was it showing accpeted during the contest then? please look into this Stefan2417

scoring worse than last div2

how is that even possible...

I have seen many solutions that seems to me ai generated, Is there a way to report such solutions?

solving two gray problem fast was sufficient to become an expert in this round

interesting

and getting three problem quickly is equivalent to master.

In problem D, is it true that atleast one of the first 39 columns should be special for the max case?

If not, hack : 262784406

UPD : Hacked :)

short solution for D till editorial is not out

for each column consider all possible ops that can be performed to make i'th column special there will be n such ops possible for each column pick the operation which occurs most of the times ops can be store in the form of hashes

Weak tests on Problem C, my solution is wrong shouldn't pass but it did.

Instead of checking if the whole LCM of the array is greater than the max. I just keep using modulo to avoid overflow, I used map to generate all possible LCMs hoping it wont TLE and I didn't.

It's easy to hack my solution just generate an array which it's LCM Mod 1e9+7 already exists in the array.

$$$a_i \le 10^9$$$

so how can the LCM be greater than the MOD and in the array at the same time?

1

3

1 8 125000001

Why didn't you just put a condition to check if lcm gets larger than 1e9 and output n in that case?

Because I made my submissions in the last 5sc. I tried to fix it after a WA I knew the LCM was overflowing and didn't have time to think about the condition.

no, your solution can't be hacked since it is correct) you are searching for all possible LCMs only if LCM of elements is already in array, so it is less then $$$10^9$$$, and obviously all possible LCMs of any subsequence are divisors of global LCM so there are less than $$$\sqrt{10^9}$$$ possible LCMs hence your time complexity is $$$O(n \sqrt{maxA})$$$ (oh I see you find global LCM wrong way and solution already got hacked :(( )

Yes I was talking about the way I found the global LCM, now I got hacked. anyway thanks for the analysis you made.

The tests are weak indeed. My solution clearly fails this test case

Answer should be 5

Please donate me +4 i want to be 1700 (crying emojis)

My prayers were not unheard , they increased 96, it was +75 before Happy happy to reach 1700

In one sentence: the correct solution B is hidden in the tests.

Depends how are you approaching it to be honest, there are more ways than one to solve it.

For problem B, my solution didn't pass the pretest. However, I think my output was correct if I'm not mistaken. I might be hella dumb but here is my answer for pretest 1 case 7:

input:

19

output:

6

-1 0 -1 -1 0 1

32 — 8 — 4 — 1 = 19

I don't know please help I'm a noobie.

You can't have two nonzero numbers beside each other.

Okay thanks stupid brain i guess.

There are 2 consecutive

`-1`

in`-1 0 -1 -1 0 1`

so this is invalid.Can anyone explain to me why my submission 262785189 is accepted. I have read others and tried it out. It was correct. I do not understand why this is.

The Test Cases are weak in D!I designed a code to solve the problem which should solve the problem with

`O(m * m * n)`

time complexity! But the code passed with`O(45 * m * n)`

time complexity, though it shouldn't pass!Here is my solution: 262786847 Time: 249ms, Memory: 6976 KB

Code Is this hackable?

Can anyone tell me how I can improve? Seeing my recent performance in the past 2 contests, I seem to have hit a roadblock.

My C++ concepts are limited, and don't know much about DSA either. Should I stop participating in the contests for now and focus on learning or just continue practising from the problem set?

Continue practicing on the problemset. Solve problems around your level and you will be good.

Guys please help. I AC'ed on B during the contest, but I got a TLE during system check. But when i submitted the exact same code but without fast io, it AC'ed.

Can anyone explain why it happened?

With fast io 262763870 Without fast io 262791262

`cout << nums.size() << "\n";`

You can replace

`"\n"`

with`'\n'`

and submit again.How is that supposed to fix it? P.S. still TLE

According to this

`endl`

or`"\n"`

will make the program flush, but even after replacing it still gives TLE then maybe because of another reason.I think the actual problem in your code is RTE

`for (int j = 1; j <= len; j++){ nums[i+j] = 0; }`

In this line of code, i + j can be equal to nums.size(), which will eventually cause out of bound. Still I don't understand why removing fast I/O fixed, maybe due to the vector capacity allocation.

editorial please. How to solve D?

Use hashing. For each column, only $$$n$$$ possible sets of rows can make it special, and all of them can be calculated quickly since they are very similar (any two sets only differ in 2 rows). Then just find the max frequency hash.

My solution to C by factorization and brute-force: 262772972

First, factorize each input numbers to product of some a_i ^ p_i, and maximize each p_i to get the LCM.

If LCM is greater than the largest input, the answer is trivial (n), otherwise:

Let's brute-force each p_i, i.e. brutu-force each (including non-prime) factor of LCM:

Integers below 10^9 with the most count of factors is 735134400, which has 1344 factors. Time cost: 1344 * n * (count of prime factors) + cost of factorization

nice solution, some of my friends had a solution which got accepted in the contest, but later when I tried, failed on test case 18

Your solution is absolutely correct

I just noticed that we only need to enumerate the factors of the largest number, all the remaining things can be easily solved by plain gcd() and lcm(). Factorization can be totally skipped.

Anyway, the core logic is the same: enumerating factors and brute-force.

I reached Pupil but suddenly I'm seeing that the rating decreased by 9 and I'm stuck in 1199 ....Why did it happen

Seems like they got to know that u r a master at using chatGPT :)

Thanks for contest! C and D were not that great but B was nice and E is amazing!

how do hacks work in div 2 contests?

a few people got hacked, but those hacks were added only after the contest ended and not while sy

agree, some code AC but fail in test 18, meanwhile the system test only have 16 test?

It's called uphacking: https://mirror.codeforces.com/blog/entry/68204

Round was very interesting, thanks!

This submission is giving wrong answer for this test case:

1

10

2 3 4 4 4 4 6 12 100003 1200036

But it still got Accepted.

i checked it, yeah it gives wrong answer, the correct answer should be 6

[2, 4, 4, 4, 4, 100003] -> 400012

editorial when

when do we get the editorial for this contest ?

https://mirror.codeforces.com/contest/1977/submission/262831476

Why is this code giving WA in test4

Try using two hashes. One mod will give a high probability of failing if it's small, so hash as a pair of two integers each with a different mod. You can also use a larger mod if you want

Oh there is a test case specially for 10**9+7

in my compiler, my code is 100 % right but when I submit it in the CF with the same compiler then it will show an error on a particular problem what do I have to do any idea???

thanks

Why no editorial yet ?

يا زنديق انت واياه راوند 949 وقت الصلاة بلا شغل زندقة

In 1977C - Nikita and LCM few solutions have been accepted but on the testcase

n=8

arr=2,2,2,3,35,35,35,210

they are giving wrong answer maximum length subsequence is 6, they are giving 4, please add this testcase in main tests.262768289, 262777464

Upsolved E. Beautiful problem indeed, had fun solving it.

Enjoyed all problems from B-E.

For question 5, Can someone please tell what will be the output of this graph:

Test Cases : 1.

Number of nodes : 5.

Edges: 4 which are 3 -> 1, 3 -> 2, 4 -> 3, 5 -> 3.

I tried dividing them in black and white groups but just can't, thank you for your help.

Your graph does not match the requirements. I found that for $$$i,j,k = 1,2,4$$$ there is no edge at all for example.

Edit : I was wrong about the statement. See me second answer.

Thanks for the reply but isn't 1 reachable from 4 ? Similarly, 2 is also reachable from 4. So I think this graph can be valid or maybe I am just dumb.

It seems I misunderstood the statement, thanks a lot ! For your question, an answer is then :

1 3 4 of color 0

5 2 of color 1

Yes, this coloring actually satisfies. I overlooked the fact that the black and white chains formed can intersect too.

I have been thinking about the answer for hours now, thank you very much !!

Attention!

Your solution 262608924 for the problem 1975A significantly coincides with solutions arka2005dey/262531402, _Sharma_Harsh/262608924. 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://mirror.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.

My solution for problem 1975A coincides with someone. I have got a false positive. Kindly look into it. @MikeMirzayanov

So where is the tutorial?

delete me from this contest Stefan2417 alexchist i copied code from others , i accept it , i copied code from 262772037, delete me from this contest and dont delete the other person from contest

please look into this , i accept that i copied and the otherone didnt copy , MikeMirzayanov

I was having with my personal compiler so during contest I used the online compiler ideone.com , after the contest I understood that my code got leaked

When will the editorial be out ?

I got a message saying it matched with some other people. My code is solely written by me and not shared with anyone else during the contest or before the contest. I wrote the code on my own and i am aware of each and every logic implemented. I truly dont know how it got plagged like this. I request you to look into it. If i were to explain the code, I can perfectly do that. Please help me regarding this. i will try not using any online compilers which might have caused to have the same syntax, but I didnt copy any code that is made available online. Please help

Very cool problem D!

I initially thought the solution will be something complex, but then I found the trick :)

Spoilerwow I think the authors made a testcase for D that fails submissions that double hash with 998244353 and 10^9 + 7. How do you even find such a testcase that would do that?

There are ways to find a mod hack or any constant base or mod, but I’m not sure about the details. Use random base and mod in Codeforces Contest.

C is harder than usual, anyways nice contest.

is this contest unrated ?

I can't find my rating. I got it yesterday, but today it's zero. Is this correct?

No it's not ! You'll get back your ratings .

Problem B could be solved by GPT, and many of the user took the same approach as of me, but why is only my solution skipped. The solution to the problem is obvious and there is no other way of solving the problem that i could think of. Please do reconsider my solution , i think it should be rechecked kindly look @MikeMyrzayanov

same happened to me although my solution is by far not even close to other solutions

Can anybody help me with my solution for problem C?Cannot identify where I went wrong.262825603

My solution to problem B was skipped. I took some advice from GPT and it gave me an idea for the solution and I implemented it. I do not think that this is considered cheating because the solutions to the problem are similar and everyone may write them by coincidence. Is using GPT considered cheating?@MikeMyrzayanov

my solution is not even close(mine's original) to the one that you are accusing me of and my ratings are gone now. Not only for this contest, but also for the last one. This is the second time this happened.

@MikeMirzayanov

The test cases of problem C are weak and many solutions are hackable.

Many solutions give answer for above test case as 4 while it should actually be 6.

Oh god, you are right. I uphacked nearly 20% of the Python 3/PyPy 3 AC submissions made during contest with it. The problem is, rather than the fact that the test is weak itself, that most of those 'hackable' solutions were submitted in a long sequence in a short amount of time and their code looked almost the same; i.e. possibly a massive amount of cheats.

(not saying all of them are cheats, but probably worth investigating in them)

Unfortunately, nothing can be done now

Can anyone give a detailed analysis of the hashing error rate of D ? I tried three types of hashing: (1) 64-bit xor hashing (2) 32-bit xor hashing (3) 64-bit sum hashing with automatic unsigned long long overflow. Only the (1) got accepted. Why?

Why is my account rating not given. I have briefly explained you that i didnt copy any of the code. I worked hard solving those three questions. Why did they plag it and removed the rating. This is unfair. Please help me. I have solved those and submitted them on my own. I dont want this. Please help me.

@MikeMirzayanov

My submissions was skipped. I have submitted with help of a book which was published before the contest. What can I do now??

I solved 1977B - Binary Colouring problem of

Div 2category. I think my solution fulfils all the requirements of the problem, although it's been labelled asWrong answer on test 1. The question says that in case of multiple solutions I can print any one of them. So can someone please help me on how to request for review of my submission. Submission Id: 263005014 Stefan2417.For x = 11 your code outputs -1 0 1 1 in custom invocation, which is incorrect

(-1)*2^0 + 0*2^1 + 1*2^2 + 1*2^3 = 11

Then why it's wrong ? The question says that if multiple solutions are possible, I can print any one of them.

You can't have two consecutive non-zeros in your output. Read the last condition and the announcement.

Number b problem of this round , my submission get Skipped, while i do it in own. In other round, i see many times b, c problem the approach matched one to other but it's ok, but what happened this round ? So many skipped because of same approach? i think codeforces should check the account history before going to give skipped. I know scammer are rising day by day but it's really frustrating for programmer like us who struggle to get success. At last, really sad thing

I became Pupil; But after the roll back, I am back to Specialist!!! Thank you.