yash_daga's blog

By yash_daga, history, 22 months ago, In English

We invite you to participate in CodeChef’s Starters142, this Wednesday, 10th July, rated for till 5-Stars(ie. for users with rating < 2200).

Time: 8:00 PM — 10:00 PM IST

Joining us on the problem setting panel are:

Note: Some problems have subtasks

Written editorials will be available for all on discuss.codechef.com. Pro users can find the editorials directly on the problem pages after the contest. The video editorials of the problems will be available only to Pro users.

Also, if you have some original and engaging problem ideas, and you’re interested in them being used in CodeChef's contests, you can share them here. Hope to see you participating.

Good Luck!

  • Vote: I like it
  • +91
  • Vote: I do not like it

| Write comment?
»
22 months ago, hide # |
 
Vote: I like it 0 Vote: I do not like it

Hoping no problems will be there containing Game Theory. IMHO, CC should give Game Theory some rest.

»
22 months ago, hide # |
 
Vote: I like it +24 Vote: I do not like it
»
22 months ago, hide # |
 
Vote: I like it +14 Vote: I do not like it

Another week another contest not rated for 7* coders :sob;

»
22 months ago, hide # |
 
Vote: I like it +3 Vote: I do not like it

Amr Harb is the best.

»
22 months ago, hide # |
 
Vote: I like it +8 Vote: I do not like it

Whenever you have subtasks you must have separate samples where sample 1 fits the constraints of subtask 1, sample 2 fits the constraints of subtask 2, etc.

»
22 months ago, hide # |
 
Vote: I like it +2 Vote: I do not like it

SpeedChef

»
22 months ago, hide # |
 
Vote: I like it +4 Vote: I do not like it

Was anyone able to solve Sum of Xors(SMXR)?

I thought it would be just (N*M*3)/2 but that's wrong, can someone please explain?

»
22 months ago, hide # |
Rev. 3  
Vote: I like it 0 Vote: I do not like it

[WRONG]

  • »
    »
    22 months ago, hide # ^ |
     
    Vote: I like it 0 Vote: I do not like it

    Sorting the array completely breaks the number of $$$[L, R]$$$ that satisfy the equation.

    For example consider the input:

    $$$n = 6, x = 1, A = [8, 8, 4, 4, 8, 8]$$$

    In this array, only $$$i = 3, j = 4$$$ satisfy the equation, so $$$F(L, R) = 1$$$ for all $$$1 \leq L \leq 3, 4 \leq R \leq 6$$$ giving an answer of $$$9$$$.

    However, if you sort the array, it becomes $$$[4, 4, 8, 8, 8, 8]$$$ which has $$$F(L, R) = 1$$$ for $$$L = 1, 2 \leq R \leq 6$$$ giving an answer of only $$$5$$$.

»
22 months ago, hide # |
 
Vote: I like it +3 Vote: I do not like it

Not a fan of "knowledge-based" problems like "Number Hunt". Its pretty much just "Do you know that the prime gap is small even at $$$10^9$$$?".

Maybe it makes sense to put it in Starters since they are meant to be "educational" contests, but it still feels out of place.

»
22 months ago, hide # |
 
Vote: I like it 0 Vote: I do not like it

I think anyone who solved this problem before can solve today's sum of Xor in 2-3 minutes

»
22 months ago, hide # |
 
Vote: I like it 0 Vote: I do not like it

Today's E (LENGTHX) , its editorial was based on segment trees , any suggestions where to learn seg trees from ?

»
22 months ago, hide # |
 
Vote: I like it 0 Vote: I do not like it

For xor sum , to prove all even $$$i \gt 4$$$ and $$$i \lt NM - 2$$$ , $$$F[i] = 0 $$$ , you can first construct $$$K = 6.$$$ However , it may get confusing when many $$$1s$$$ have been filled , to solve that case , observe that You can invert all $$$1s$$$ to $$$0$$$ and $$$0s$$$ to $$$1$$$ , and $$$F[i]$$$ remains same. Hence the case $$$K = 6$$$ is same as $$$K = NM - 6$$$ .

»
22 months ago, hide # |
Rev. 2  
Vote: I like it 0 Vote: I do not like it

include <bits/stdc++.h>

using namespace std;

int main() { int t; cin >> t; while (t--) { int n; cin >> n; vector v(n); int y = 0; for (int i = 0; i < n; ++i) { cin >> v[i]; y = y | v[i]; }

for (int i = 31; i >= 0; i--) {
        if ((y & (1 << i)) == 0) {
            for (int j = 0; j < n; j++) {
                if (((v[j])> (pow(2,i)))) {
                    v[j] = -1;
                }
            }
        }
    }
    int a = count(v.begin(), v.end(), -1);
    cout << a << "\n";
}
return 0;

}this code is for 4th que of div4 in codechef(array removal) and it got accepted in codechef but this code gives wrong output for the input(n=4) {2,8,9,10}

»
22 months ago, hide # |
 
Vote: I like it +4 Vote: I do not like it

are u gonna do anything about wrong submissions that got accepted for array removal problem,it had massive impact in rankings of div2

»
22 months ago, hide # |
 
Vote: I like it 0 Vote: I do not like it

Cheaters Cheaters everywhere :

https://www.youtube.com/watch?v=lroJG3QAcRA

Today I was hoping to turn three star on Codechef but thanks to them

»
22 months ago, hide # |
Rev. 3  
Vote: I like it 0 Vote: I do not like it

Sorry for mentioning you but the tester's code given for the problem Pairs Sum with Length x in today's contest does not work. Please fix it.
Submission link
mexomerf IceKnight1093.

»
22 months ago, hide # |
 
Vote: I like it 0 Vote: I do not like it

Number Hunt Detailed Video Editorial

https://youtu.be/fhOLz-Or9NA