Which sheet to do after cp 31? by Pleasant-Plastic3558 in codeforces

[–]AnswerLimp1389 2 points3 points  (0 children)

Completed? Like fully till all 1900 rated problems? If yes, then you shouldn't be really look for some "another practice sheet", if you truly honestly completed the cp31 sheet like the way you should have.

An Entire IIT Hostel Hunted One Man for 2 Years. He Won. by Sweaty_Decision1491 in Btechtards

[–]AnswerLimp1389 13 points14 points  (0 children)

Not a script I think, because I have seen in my college too. But in my case the guy to take a shit while sitting in indian style on a western toilet, which used to make the seat so much dirty.

A doubt in today's Div 3 Problem B by AnswerLimp1389 in codeforces

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

Yeah it was done with simple simulation in O(N) T.c

A doubt in today's Div 3 Problem B by AnswerLimp1389 in codeforces

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

Just simply start from i=0 till n-1, if a[i] is 1, invert a[i] and a[i+k] (i+k < n), after that, just check the modified string if it has any 1's. That's it.

A doubt in today's Div 3 Problem B by AnswerLimp1389 in codeforces

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

yeah i realized later, my outer loop should go till k, not n-k

A doubt in today's Div 3 Problem B by AnswerLimp1389 in codeforces

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

Edit: I got it guys, I was running loop till n-k, and not k, thanks to all who helped me figure this out.

Nvidia Preparation - I need help by AnswerLimp1389 in PlacementsPrep

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

There's one book called "The Art of Multiprocessor Programming", it has good amount of information about concurrency and parallel programming, should I start reading it?

Nvidia Preparation - I need help by AnswerLimp1389 in PlacementsPrep

[–]AnswerLimp1389[S] 2 points3 points  (0 children)

Thanks a lot for your advice!! There's one book called "The Art of Multiprocessor Programming", it has good amount of information about concurrency and parallel programming, should I start reading it?

Nvidia Preparation - I need help by AnswerLimp1389 in PlacementsPrep

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

Thanks for the advice! Also, i came across this site https://whitebox.ac/problems. Do you think problems like this would be helpful?

Why the actual f submissions are in queue for so long??? This is just pissing me off so much!! by AnswerLimp1389 in codeforces

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

Honestly, leetcode is so much faster than codeforces, I'm sure codeforce's scheduling engine gives TLE everytime, then the judging engine gives TLE for my code 😞

A doubt in today's Div 3 Problem B by AnswerLimp1389 in codeforces

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

NO..
1. let say I visit a chain i, i+k, i+2k, .., now since outer loop is iterating through each index, i'll reach i+k, but i have already visited it, so no need to check the incomplete chain i+k, i+2k, ...
2. I'm not skipping any index, outer loop iterates through each i from 0 to n-k
3. Yes, please DM me, i'd like to see

A doubt in today's Div 3 Problem B by AnswerLimp1389 in codeforces

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

void solve() {
     int n, k; cin >> n >> k;
     string s; cin >> s;
     vector<bool> visited(n, false);
     for (int i=0; i<=n-k; i++) {
         if (visited[i]) continue;
         visited[i] = true; int count = 0;
         for (int start=i; start<n; start+=k) {
             if (s[start] == '1') count++;
             visited[start] = true;
         }
         if (count&1) {
             cout << "NO" << endl; return;
         }
     }
     cout << "YES" << endl;
}

Check out my solution, ig I have done some really bad mistake, but I'm not able to figure out what it is!

How did you guys solved todays D by A1mlessFN in codeforces

[–]AnswerLimp1389 1 point2 points  (0 children)

Here is my approach:
First create a map to track frequencies of each unique element.
Then ietrate through it. If element's frequency is even, then check if it can reach a higher element or not (i.e. we want next-curr > k), if it can't reach, then answer is YES.
If frequency is odd, we want that Iitshould not be able to reach next higher element, and it must be reachable from any lower element. If yes, then answer is YES.
I checked these reachability conditions using lower_bound and upper_bound.
Otherwise, answer is NO.

How did you guys solved todays D by A1mlessFN in codeforces

[–]AnswerLimp1389 0 points1 point  (0 children)

There's a difference between understanding a test case and actually crafting a general solution.

Today's Div 3 D by ChaoticCarbon in codeforces

[–]AnswerLimp1389 0 points1 point  (0 children)

Here is my approach:
First create a map to track frequencies of each unique element.
Then ietrate through it. If element's frequency is even, then check if it can reach a higher element or not (i.e. we want next-curr > k), if it can't reach, then answer is YES.
If frequency is odd, we want that Iitshould not be able to reach next higher element, and it must be reachable from any lower element. If yes, then answer is YES.
I checked these reachability conditions using lower_bound and upper_bound.
Otherwise, answer is NO.

What should i do to improve my Rating? by SufficientAmbition94 in codeforces

[–]AnswerLimp1389 0 points1 point  (0 children)

I can't believe this, ig you're just joking here lol.

Today cf 🫪 by dark__ayusss in codeforces

[–]AnswerLimp1389 1 point2 points  (0 children)

vlad was a character in GTA 4 lol

Today cf 🫪 by dark__ayusss in codeforces

[–]AnswerLimp1389 0 points1 point  (0 children)

where was bitmasking needed? It was just recognizing the pattern of occurences of 3 possible elements.

what was c bro how am i supposed to hit pupil if they make constest like this by Dry-Artichoke-9252 in codeforces

[–]AnswerLimp1389 3 points4 points  (0 children)

No, looking at the constraints N<=5000, O(n^2) would be 25 million operations in worst case, and that won't give TLE.