Comments

why this submission is wrong in D : 314149872

+9

I need to wait 7k contest more to post a blog like this ;)

justice_for_Eljoker

se is changed after se+=min(k,fi-se) so you need to use temp like t = in(k,fi-se) , se+=t

c < b

The last cell contribute to the answer with 2 not 1 because you then color a row and a column in the same time so the greedy solution doesn't really work because its not globally optimal to just take the current smallest number.

Yes it's the intended solution but there are other solutions that passes with nk*10000

how solutions with O(n*k*100*100) passes in F?

how solutions with O(n*k*100*100) passes in F?

in his heaven we all will be a red coder :)

how can you be sure that the last valid value for r is not between 2^i and 2^i+1 and 2^i+1 will not overflow in check function? this sub overflow if we use this method 274332031

+35

Now you need to delete both of them :)

do dp range and the cost is the min element in range * length of range

On sum → Codeforces Round #919 (Div. 2), 3 years ago
0

Ohhhh my goooood i am such a stupiddddd , thanks man

On sum → Codeforces Round #919 (Div. 2), 3 years ago
0

Its enough to check till sqrt(n) because i check for i and n/i .

On sum → Codeforces Round #919 (Div. 2), 3 years ago
0

why it gives wa ?? 241464609

On sadness → Good Bye 2023 tutorial, 3 years ago
0

Can anyone prove this to me or explain why?

In this case, b=a⋅p, where p is the smallest prime factor of x. Then x=b⋅p=b⋅ba

On marzipan → Good Bye 2023, 3 years ago
+4

Everyone :-3231 downvotes

Mike : what a beautiful round ! it should be rated.

On marzipan → Good Bye 2023, 3 years ago
+55

74TrAkToR = -delta

0

you can solve it with a set , make every even index element negative then loop on the array and insert the prefix sum till i in the set , and find if you have the same prefix already , if true then its a YES .

"You will be given 3 problems and 3 hours to solve them"

-26
For Egyptians only
On pinely → Pinely Round 2, 3 years ago
-44

today's lesson : Don't ever participate in any div1+div2 rounds

Unfortunately, it's highly unlikely that someone who has been practising hard for an year and is still stuck in grey/green will ever reach the lofty goal they have set for themselves (often gm).

In other words, you are saying that if you cannot reach point Y in time X, you will never be able to achieve your goal and you should give up. With all due respect, I think this is a naive way to look at life. If we take this as a rule, most(average) people will never achieve anything.

Firstly, how do you know what the goal is for everyone? Maybe the goal for some people who are stuck in green is just to reach cyan.

Secondly, based on what have you decided that it takes a year to pass green/gray? People are different. The time it takes me to do a task may be 10 times the time it takes you. Everyone should respect their own skills and find the optimal way to use them without limiting themselves to a certain time or rate.you want people to give up on their goals just because they have not achieved them in a certain amount of time ! Everyone learns and progresses at their own pace I don't care if I reach cyan or blue in 10 years and someone else does it in a month. It is not a race. I just want to learn, have fun, and achieve my reasonable target that suits my abilities. Not everyone is a genius, and CP and life are not only for them. Take your time, do your best, and have fun.

Oh my god!!! That ruined my contest, thanks.

In problem b, how this test : cdba will be abcd with k=4

yeah, but I am too lazy to clean it.

yes for me, I don't need to make global variables or send them to a function or to reinitialize the containers .

:)

really? Can you point to the confusing parts?

oh shit, I forgot about memset, thanks.

come on its not that complicated :(

why dp solution dosent work for c , 219347506 thanks.

I edited it, thanks.

for problem b, the constraints are tricky because the highest Fibonacci term (where in the original Fibonacci sequence the first two terms are min possible ) less than 2 * 10 ^ 5 is the 27th term(0-based) so it's okay to brute force the solution. you know that the last element is n so start from pos n — 1 and try all numbers that you can use from n to 0 and call it x for every x use recursion to build the sequence, if at any pos you can't get a valid value ( positive and less than the next value in sequence ) so this x is invalid

Its only offended or more precisely Not suitable if it was talking about "your belief" or "your god " And there is no mention to any ot these in the statement , the term god is not exclusive to Islamic god , actually Muslims don't use the word god they use Allah instead . If you believe in something you cant force people to shut up if they have different belifies or prevent them from expressing what they belive in or even write a fictional story ! in Islamic country and i live in one of them you can study mythology and "God" is a mythologic term that used in this literature with a specific definition different than Abrahamic religions and this problem used that "god" . so come down guys.

the operation given in problem, you can only take consecutive range then you can reduce it by deleting some range from it.

everyone knows that a^a = 0 this is the only reduction you need and its also a well-known property of xor

That's why it's obvious. you can take any suffix you want and delete from it(a^a=0) any other suffix and it gives you any subarray you want.

Thankfully everyone has access to the internet, so it's an equal playing field when it comes to fetching code to solve standard problems..

yes, but you don't participate in rounds to copy solutions, it's okay to copy some block of code that will help you in solving the problem but not the solution itself! , so when I participate in a round i trust in cf that it will give me original problems so i depend on myself, others maybe will go to copy the answer so you will have 5k+ solutions so its not fair to those who trust cf.

You can carry on and have fun with the remaining 5 problems in the contest instead of complaining

for sorry not everyone can solve the whole problem set, if someone can only solve till c it will affect him if c was a googlable so i has the right to complain .

easily you can see that the task is finding the max xor range it's obvious, everyone knows that a^a = 0 this is the only reduction you need and its also a well-known property of xor, if you just copy standard problems and rephrase them almost every round will be googlable! and worthless. it's okay to use standard ideas in a multitasking problem or make from them a new variation but anyone can just copy the code from gfg with no understanding of it at all and it will pass! , this is my opinion i respect all your points but it is just not fair.

what is the test that hacks problem a?

On oursaco → Revenge at Last, 4 years ago
0

then dapingguo8 hack him in the next contest ...

0

The legand says that i am in queue from the last div 4

On ilia_rr → Activity streak, 4 years ago
+8

it really doesn't matter, streak thing is a bad practice, continuity is not about solving x problems every day, at some point, you will find yourself exhausted and solving from your comfort zone problems or you just don't learn anything from the problem you have solved, its healthy that if you find your self tired or bored go do anything else! , solving problems every day is like solving problems while you are falling asleep.

-6

Nah , hamo el tekha wins

On adamant → Codeforces Round #869, 4 years ago
0

Impressive! Congratulations

what is the point from problems like div2B ? problems that depends on a pattern/sequence is pointless

i think you should take a vote to make it rated or not, you shouldn't decide on your own that people are affected because of some mistake in d , come on most people were stuck in b .

0

problem G2 should be c or something! , really? G2 is a simple greedy problem?

why everyone hated problem b ?? its a very nice problem .

contest ended

system testing:

0

you have 2 subarrays that satisfy the condition. (2, 2) and (5 , 5)

WA on test 2 3 times WA on test 3 2 times, life is cruel

after getting WA on test 3 *

i don't think that the optimal way is to use the "smallest" b[i] value because the cost will be 2*b[i] ex: b-> 3 2 2 3 if you take 2 then 2 then 3 total cost = 2*(2+2)+3 = 11+sum of as but if you take 3 then 2 then 2 the total cost = 2+2+3 = 7+sum of as so the main observation here is we always will leave just one element so we will take all bs except one so the optimal way to choose them is taking them from both ends (front and back) and when you reach the max value you just leave it and continue from the other end

why do you take b[i] *2 when you can take b[i] as you did in your last sub ?

why this 177209802 doesn't work, I try answers from 0 to n and take the max answer possible, in every iteration I find the max element less than or equal to k and then erase it and repeat the same process to k-1 for bob(my idea is bob will choose the max element Alice can choose in the next stage and increment it by k ) and when all elements are bigger than the curr k or there is no elements we can't use this 'i'

no

there is a huge gap between c and d that you know your contest ended after reading it and it was a matter of speed :(

0

why my sub of E 176032553 get WA in test 1 ! but my compiler give the same expected result, so what is the stupid newbie mistake i did

I agree with you, the pretests were weak

It depends on your solution, we have 2 ways to get result[i], arr[i-1]+result[i] it's always a valid solution but arr[i-1]-result[i]it's only valid if the result is non negative so it's obvious that it should be >= 0 Or maybe i didn't get you right

Waiting your solution of B to get hacked Pics-Art-09-29-10-38-58

عبث عايشين في عبث

you have 4 cases in this problem

1 : n % 3 == 0 then the optimal answer is using only 3s number of times = n / 3

2: n % 3 == 2 then the optimal answer is using ( n / 3 ) 3s and just 1 two

3: n % 3 == 1 the the optimal answer is removing 1 three from (n/3) 3s and use (2) 2s instead of it (3+1 = 4 = 2 + 2)

4: if n == 1 so answer is 2

so for case 2 and 3 the answer is n/3 + 1 , this formula = ceil( n / 3) (which include the answer for the first three cases)

in contest : oh i took so much time solving A & B , but its okay i have enough time to solve c

problem c :

baa

Really? just 2 seconds? Humans can do that?

0

What do you mean by "works for both" ?

0

Sample Test case : any code will pass bro

Pretests : haha go delete your code

Search for " Ascii art generator "

why this sub for c gives TLE 154641815 ? bug or bad idea

0

oops , thanks for helping <3

0

why this sub 154484811 for F gives TLE ?

any hints for b and c ??

think about dividing the string to blocks of 'R' and figure out how to distribute Rs between them number of blocks = b+1 number of Rs we can distribute equally between all blocks = number of Rs /number of blocks the remaining Rs = number of Rs%(number of blocks ) then find way to distribute the remaining

+5

this time i am proud to solve A !

then even problem a is hacked ;))

Thank you for your effort. Actually i solved it with this approach but i wondered if it can pass in 3 sec

Thank you this is very helpful! I solved it with map but i thought that i can solve it with logarithmic rules the 3 sec time limit tempted me :)) Thanks again.

i did this if ( fabs(l - (double)d) < 1e-9 ) cnt++ ; but it stil gives the same answer , i think there is a problem in casting because the DOUBLE << log10(7+1)/log10(2) = 3 >> != the INT << log10(7+1)/log10(2) = 2>> so , what modification should i do ? thanks.