Comments
On Jon.SnowCSES Tree section editorial, 12 months ago
0

even in path queries 2 u can solve with LCA + array flattening

i solved it in nlogn dont know about o(n) tho

cant believe I fell sleep mid competition

I undertsand now ;/

shit why did I not think of this now I think about it taking 1 as root always might not be good choice

how to solve D? I was root->child<-grandchild->xxx<-yyy...... kind of thing it was producing n-1 good pairs then was trying to change direction of any one leaf node whose depth is greater than 2

+20

new era of competitive programming

Host a Codeforces contest.

Sell the solutions.

side hustle.

please please unrate this contest please

dehatis have ruined codeforces too

no at max there are n*(n-1)/2 swaps = 40x39=780 it is for n-1,n-2...

u just had to make sure your operation wont exceed 1709 and max array size was 40. even at worst case you wouldnt need more than 780 swaps to sort single array , to sort both arrays 780+780 and if a[i]>b[i] then lets take 40 more operation they are within range , its brute force literally

DEF were easier compare to normal div 3 , Instantly knew solution of D,E here (this doesnt happen usually)

On voventaCodeforces Round 1032 (Div. 3), 15 months ago
0

why? I thought it was pretty easy to guess bubble sort would work operation wouldnt exceed 1709

On szilbCodeforces Round 1030 (Div. 2), 15 months ago
0

true C felt like 900-1000 kinda problem

I know , but my 4d dp solution was correct but it was TLE so i was thingking how to improve it

no its true except idk about E

bruh this was causing problem got AC now

A could be done by simulation thats what made problem easy

lets say we are given (A,B,C,D) (sorted) then which pair is better ? A-C,B-D or A-D, B-C?

how y'all doing D in minutes -_-

how to solve D? zig-zag is optimal right?

I was thinking of 4d dp solution for div2B for hours , then looked at picture provided got the answer in seconds

i mean if u had to choose subset first thing that should come to mind is DP ;)

Div2B>Div2C

dp on subsets ,selecting a minimal subset whose gcd is equal to gcd of whole array

On PvProCodeforces Round 1026 (Div. 2), 15 months ago
0

there is problem called Maximize The root something , for me this problem was similar to that one of the reason it quickly led me to BS solution

my thinking was correct for D but couldnt implmenet it ;/

0

how to solve D/D/D ?I was thinking of finding maximum odd/even we can get from multiset then if distance is even and <=maxeven its true else we can check if we can make it jump to some other node that has answer statisfied???

0

I hope I will not reach pupil

On BlagojCodeforces Round 1019 (Div. 2), 16 months ago
+2

ordered_set can only contain distinct elements and u can use two multiset (rolling median) to find median of any array but here we only needed to know if median will be <=k so we didnt need to use that

On BlagojCodeforces Round 1019 (Div. 2), 16 months ago
+7

reversing array was kinda smart , finding vwv was easiest part of the problem

On BlagojCodeforces Round 1019 (Div. 2), 16 months ago
0

looks like I wasnt alone

On BlagojCodeforces Round 1019 (Div. 2), 16 months ago
+1

when question are too easy like q1 was too easy I took 2 min only due to (externalforces)

if we remove H then tourist would rank 1

if my funtion cant find any valid transition to move forward it will return INF; if it returns INF means its invalid like i will do operation now and move forward to next row but then compare if it finds prev row == current row its invalid

what I did was either do operation on row or skip it , then similarly another memoization for doing operation on col or skip it ans is rowrec + colrec (just make sure you are not doing anything invalid)

my are u guys using dp isnt it simple iteration

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

is there way I can decrease my rating to 1399 ? I wamma participate officialy

0

oh no ;(, I should have improved sol

0

maybe not TLE but WA

0

nah ur explaination was good I was just thinking Why I couldnt understand this during contest , this testcase is itself solution ig

0

just go to my submissions from profile

+3

check my way of knowing mex till now -> intialize set and intialize mex with 0 and just do while(set.count(mex))mex++; and as u go left to right just add elements in set

0

i am retarded

0

and I was counting 1 as prime got 4 WA

0

u must have mistaken my E for C

+3

understood we dont need to blank all incorrect pos we can just do it one by one thanks

+5

E was easier than B

+3
4 5
a s k A
d s D t
O R i A
a X b Y
b a k A
u s k J  
why is answer to this 8 not 10

maybe u should try including last check funtion that checks again if everything is reversed after all operation and also for n==odd ,(try placing (a[i]==b[i]) pair into mid and do rest of the operation like me ) check my sol

find out which test case is falling

I dont know about edge cases I only got wa because I was taking mid as (n+1)/2 even though I am using 0-indexed array

I should have tried more;/

real, just look at D so many people have similar solution 5 lines of code you cant even say they cheated or not

man I got 3 WA on C due to silly mistake and was D really that easy?

never use MOD when not specified , large number can also be answer to this problem use long long for that

but why is bro using MOD in B

what are u even trying to do here? and why are you taking MOD ?

thats what I was doing I had implementation problem due to using mint template

I had right mindset in D but i dont why answer was some random no always I hate this MOD kind of questions

oh

which is Digit DP ? D? if so whats the intution

b was kind of easy but I wasted time taking x as int and debugging ;(

On AlperenTApril Fools Day Contest 2025, 17 months ago
0

READ editorial

On AlperenTApril Fools Day Contest 2025, 17 months ago
0

wow looks like my dao is far inferior

On AlperenTApril Fools Day Contest 2025, 17 months ago
+3

legend

On AlperenTApril Fools Day Contest 2025, 17 months ago
+10

I was printing their names written in 3 words (from youtube description)

On AlperenTApril Fools Day Contest 2025, 17 months ago
-11

any website that gives accurate result for reverse engineering photo location?

On AlperenTApril Fools Day Contest 2025, 17 months ago
+2

Hawk Tuah Button ---------->

On AlperenTApril Fools Day Contest 2025, 17 months ago
-13

i am so dumb

On AlperenTApril Fools Day Contest 2025, 17 months ago
-17

whoever dms me answer will become billionaire

On AlperenTApril Fools Day Contest 2025, 17 months ago
-19

is 2nd just generating random number unless ur luck works and random answer doesnt match any previous answers ?

On k1saraCodeforces Round 1014 (Div. 2), 17 months ago
0

lol imagine if we changed P to D and D to P in question E

is C correct?

hard c

thats how I coded my solution look at my sol

 int n, k;
    cin >> n >> k;
    string s;
    cin >> s;
    string t = s;
    reverse(all(t));
    map<char,int> mp;
    rep(i,0,n) mp[s[i]]++;
    if(mp.size()>1 && k){
        yes();
        return;
    }
    if (s < t) {
        yes();
        return;
    }
    else if(k==0){
        no();
        return;
    }
    else{
        no();
        return;
    }

same with NSUT

I was getting forbidden error too while using my uni wifi

ALL leaked solution :> (src -yt)

Leaked D solution
Leaked C solution
Leaked E solution

ALL leaked solution :> (src -yt)

Leaked D solution
Leaked C solution
Leaked E solution

why cant I submit solution now that contest is over

your pfp was me 30 minutes ago

bruh my alarm didn't ring

lets see if -100+ is possible or not

lol I gave up after second WA

how are people solving it then? although I dont understand why my solution is giving WA

what was A and B spoil me

aiming to reach specialist tmr

+1

I didnt encounter such problem

On Mhn_Neektourist vs Golovanov399, 18 months ago
+10

before even anyone solved the problem they said they would do rematch cause problem is broken not after

-16

Russians are built different

I guess yes

On FetFotCodeforces Round 1007 (Div. 2), 18 months ago
0

so solution is always possible

On FetFotCodeforces Round 1007 (Div. 2), 18 months ago
0

if your sum+i is sqaure does it matter if u swap (a[i-1],a[i])? total sum will be sum right

On FetFotCodeforces Round 1007 (Div. 2), 18 months ago
0

you can check if sum till now is perfect quare or not by doing sqrt(sum)*sqrt(sum)==sum

On FetFotCodeforces Round 1007 (Div. 2), 18 months ago
0

i think you can store all n numbers in set and then for i till n : run whole set check if (sum till now + no in set forms perfect square if it does skip it otherwise add it and break the loop ) if u cant add a number wihout forming a perfect sqaure output -1:

On FetFotCodeforces Round 1007 (Div. 2), 18 months ago
0

nice approach

A is just — 0 1 2 15 16 17 30 31 32 45 46 47 ....

this I am considering u meant (maximum sum of subarray you are painting) if penalty is sum of every red cell painted then answer would be diff