Programming

Programming

[Solved] Find an integer STARTERS 73 CodeChef

[Solved] Find an integer STARTERS 73 CodeChef

Chef has two nephews who love integers XX and YY. An integer NN is awesome if the following conditions hold: Find any awesome integer N. We can prove that under the given constraints, an answer always exists. Note that you do not have to minimize the answer. Input Format Output Format For…

[Solved] Consecutive Xor STARTERS 73 CodeChef

[Solved] Consecutive Xor STARTERS 73 CodeChef

Chef has an array AA of length NN. He can perform the following operation on AA: 1) Select an index ii (1 \le i \le N – 1)(1≤i≤N−1) and select an integer XX (1 \le X \lt 2^{20})(1≤X<220).\\2) Set A_i := (A_i \oplus X)Ai​:=(Ai​⊕X) and A_{i + 1} := (A_{i + 1} \oplus X)Ai+1​:=(Ai+1​⊕X).…

[Solved] Append for OR STARTERS 73 CodeChef

[Solved] Append for OR STARTERS 73 CodeChef

Chef has an array AA of length NN. Chef wants to append a non-negative integer XX to the array AA such that the bitwise OR of the entire array becomes = Y=Y i.e. (A_1 \ | \ A_2 \ | \ \ldots \ | \ A_N \ | \ X) = Y(A1​ ∣ A2​ ∣ … ∣ AN​ ∣ X)=Y. (Here, |∣ denotes the…

[Solved] Lucky Numbers STARTERS 73 CodeChef

[Solved] Lucky Numbers STARTERS 73 CodeChef

Chef calls a number lucky if it contains the digit 77 at least once. Given a number XX, determine if it is a lucky number or not. Input Format Output Format For each test case, output YES if XX is a lucky number. Otherwise, output NO. You may print each character of YES and NO in…