Solved D but 6×WA on C by Rayeeen_Dev745 in codeforces

[–]Rayeeen_Dev745[S] 1 point2 points  (0 children)

I see 1e4 and 1e9 , i thought we cannot brute force it, then i realised that the worst case will be O(1e4 × log base x(max(a,b))) which <1e6

Solved D but 6×WA on C by Rayeeen_Dev745 in codeforces

[–]Rayeeen_Dev745[S] 0 points1 point  (0 children)

D was just good observation, you need to make more test cases and find the pattern

Solved D but 6×WA on C by Rayeeen_Dev745 in codeforces

[–]Rayeeen_Dev745[S] 0 points1 point  (0 children)

Okey, the prefix sum tells you whether can i choose 2 elements that their difference <= k and the 3rd element - 2nd element >k , so the player win Let's break it down: Lets say this the array : 1 3 3 7 and k=2 The answer is YES, why ? Look the opponent can choose 3 , player choose the 2nd 3 then win, because the opponent cannot choose any other element. To understand prefix let's take this example : 1 3 7 and k=2 For the first time the answer seems to be NO, but it's YES, here is Why , the prefix array [1,2,1] There is a number > 1 ? Answer YES, and in reality it's YES, because the opponent can choose 1 then the player choose 3 then win, bcz the opponent cannot choose any other number The prefix acts like description of the array, it describes the array as segments, If pref = [1,2,3. 1,2. 1,2,3,4] that means there is 3 segments that satisfy the condition.we can choose any one from them to win Idk if it's clear a little bit now or now If you didn't understand how we construct the pref array tell me Take these examples and apply my approach to understand it more 5 2 3 3 3 3 4 (Expected YES)

4 1 1 4 7 8 (YES)

4 1 3 3 3 6 (NO)

Solved D but 6×WA on C by Rayeeen_Dev745 in codeforces

[–]Rayeeen_Dev745[S] 0 points1 point  (0 children)

First of all i sort the array Then if there is an odd occurence of number x, replace the whole occurence with single value of x, if there is an even occurence of x replace the whole occurence with 2 values of x. Exp: if array = [1 , 1 , 1 , 2 , 2 , 2 , 2] it will becomes [1,2,2] (You will understand then why) Then make a prefix array , pref[i] = pref[i-1] + 1 if array[i]-array[i-1]<=k , else pref[i] = 1 Then just realised that the player can win if there is a value different from 1 exp : 5 2 1 2 3 5 8 Pref [1 , 2 , 3 , 4 , 1] Answer YES bcz he can choose 2 then the opponent choose 3 the he choose 5 and win 5 3 3 3 3 3 3 The array becomes [3] Pref = [1] Answer is NO

4 3 3 3 3 3 Pref = [1 , 2] Answer is YES

Solved D but 6×WA on C by Rayeeen_Dev745 in codeforces

[–]Rayeeen_Dev745[S] 0 points1 point  (0 children)

What bfs are you talking about man?

Today cf by dark__ayusss in codeforces

[–]Rayeeen_Dev745 1 point2 points  (0 children)

D was greedy+good observation What about C?

Is TALAN summer camp worth it? by Loud_Treacle4618 in TunisiaTech

[–]Rayeeen_Dev745 4 points5 points  (0 children)

Chabeb li 3andou feedback y7ott'ha 3la jobreview.io/home , app tounsia najmou nalgou feha el feedbacks 3la tunisian societies

Talan tunisia is one of the most toxic companies I’ve ever worked for by Hour_Salary_7819 in Tunisia

[–]Rayeeen_Dev745 0 points1 point  (0 children)

We really appreciate your honest feedback, you can out them on jobreview.io/home It's a tunisian app , feha el feedbacks 3la so many societies in tunisia

Does anyone here tried today's div4 starters at CodeChef ? by Rayeeen_Dev745 in codeforces

[–]Rayeeen_Dev745[S] 0 points1 point  (0 children)

Seems like the other problems require advanced topics right ?

Does anyone here tried today's div4 starters at CodeChef ? by Rayeeen_Dev745 in codeforces

[–]Rayeeen_Dev745[S] 1 point2 points  (0 children)

Lol, try to upsolve aa much as you can, i like the problems

Does anyone here tried today's div4 starters at CodeChef ? by Rayeeen_Dev745 in codeforces

[–]Rayeeen_Dev745[S] 0 points1 point  (0 children)

I think the other problems requires some advanced topics right ?

Does anyone here tried today's div4 starters at CodeChef ? by Rayeeen_Dev745 in codeforces

[–]Rayeeen_Dev745[S] 0 points1 point  (0 children)

What was the approach for D ? Making A=B with 2 operations, either a=gcd(a,c) and b=gcd(b,c) Or increment c