Comments

I think a dp with states as follows,
n,0,p can go to either -> n-m,m,p or n,p,0 .. similarly the next states proceed
n-m,m,p --> n-m+p,m,0 thats it .. and so on,

Time complexity — O(n*m*p)

Since the problems won't be moved to practice (I assume), I have no way of validating my solution.
Would you help me with that?
I am trying for every prefix, let my binary search provide me an answer "x" (this is the required difference). I am validating "x", by saying if I can break the suffix into 2 parts (lets call them middle and suff) such that max of pref, middle and suff — min of pref, middle and suffix is less than or equal to "x".
The way I'm finding if I can divide the suffix in 2 such parts is again by binary search. Thanks. Please let me know your thoughts.

Will there be editorial for the rest of the problems?
Will the problems be moved to practice?
Is the intended solution for split sum with binary search?

-28

So no interactive huh!:)

Could you explain why multiply by 8 and 7?

And also for :
RGR
RBG
BRR
Now for dp[4] you wont count all states that are valid
Basically current state depends on more than one previous state.

I think my solution would work if we already precompute answers for n=1 and n=2!

why so?
EDIT: Ohh ok! You dont take into consideration that it was already legal but you were still trying to make it legal by placing only the ones which dont intersect with it

Oh yes!
This makes sense.
answer would be equal to the number of coloring that are legal for columns minus the number of coloring that are illegal for rows and legal for columns!
I also understand the incorrectness of dp[n] = dp[n-1]*24, it being that lets suppose one of the legal ways of coloring for n = 1 would be RRB but then in the very next column we are taking all 24 choices i.e we also take RRB or RGB and many more which are illegal!

Yes you are right, the plus something part is definetely wrong. I will try to rectify it!

Thats a diplomatic answerXD.
Please provide a reason.

Ohh alright!
But this solution looks promising!

Lets assume we have the answer for 3*(n-1) grid. Now its obvious that for 3*n grid we just have to take care for the nth column to be legal.

And the number of ways a column can be legal is 24 ( 3 cells in a column, number of ways to fill is 27 and number of illegal ways would be 3 i.e RRR, GGG, BBB ).

Lets assume we call answer for 3*(n-1) to be dp[n-1] then we can write it as:
dp[n] = dp[n-1]*24 + something
This plus something is because some of the illegal ways for coloring 3*(n-1) can also be made legal.
Now its obvious that these illegal ways for (n-1) would be only illegal in terms of rows and not columns.
Lets see how many illegal ways of rows exists!
Either one of the rows can be illegal or 2 rows can be illegal. Note that all 3 rows cannot be simultaneously be illegal.
And hence number of one row illegal = 3C1*3
Similarly for 2 rows = 3C2*3
And considering the coloring options for these 2 conditions, we get:

dp[n] = dp[n-1]*24 + Σ 3Ci*3*2i for all i ∈ {1,2}


P.S — I'm obviously unsure of the solution and would like to test it. So please provide a link to the problem.

On ConstructorU → SIT STAR Contest, 6 years ago
+8

Well I still would've wasted more than half of it!

On ConstructorU → SIT STAR Contest, 6 years ago
0

K was my favourite!

On ConstructorU → SIT Star Contest, 6 years ago
+1

What was the intended solution for Problem K?
Was it SCC+combinatorics or not?
In either case, could someone please share the solution!?

UPD:Got the solution, thanks!

On liouzhou_101 → Codeforces Round #700, 6 years ago
+1

You shouldn't keep it rated! Problems with B and weakest pretests for C! YOU'VE GOT TO BE KIDDING ME!!!
Plus are you going to check each and every comment here and then rejudge that particular solution?
Thats tiring!

P.S : I only say this for Div2.

Before — PANIK
Now — KALM

Its turning out to be a nightmare! No contests scheduled till now.

I sincerely don't hope so!

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

I think you never understood the question!

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

me .... literally after every "is it rated "comment in every contest

there you go !!! thanks!!

why has no one yet asked whether the round is rated or not!!