[Solution] Tokitsukaze and All Zero Sequence solution codeforces

Tokitsukaze and All Zero Sequence solution codeforces – Tokitsukaze has a sequence đť‘Ža of length 𝑛n. For each operation, she selects two numbers 𝑎𝑖ai and 𝑎𝑗aj (𝑖≠𝑗i≠j; 1≤𝑖,𝑗≤𝑛1≤i,j≤n). If 𝑎𝑖=đť‘Žđť‘—ai=aj, change one of them to 00. Otherwise change both of them to min(đť‘Žđť‘–,đť‘Žđť‘—)min(ai,aj). [Solution] Tokitsukaze and All Zero Sequence solution codeforces Tokitsukaze wants to know the minimum number of operations to change all numbers in … Read more

[Ans] According to legend, which author wrapped up her dead husband’s heart and kept it for nearly 30 years?

According to legend, which author wrapped up her dead husband’s heart and kept it for nearly 30 years? – Percy Shelley, aged 29, drowns in the Gulf of Spezia while sailing. Widowed at 25, with a toddler son, Mary keeps his burnt heart wrapped in silk in her writing case and decides to earn a … Read more

[Solution] Alternating Diameter solution codechef

Alternating Diameter solution codechef – Chef stumbled upon BB black nodes and WW white nodes and now wants to construct a tree using them. [Solution] Alternating Diameter solution codechef Chef is bamboozled by the total number of trees that can be constructed using these nodes. To reduce this count, Chef considered only those trees which have at least one diameter … Read more

[Solution] Mystical Numbers solution codechef

Mystical Numbers solution codechef – A number MM is said to be a Mystical Number with respect to a number XX if (M⊕X)>(M&X)(M⊕X)>(M&X). [Solution] Mystical Numbers solution codechef You are given an array AA of size NN. You are also given QQ queries. Each query consists of three integers LL, RR, and XX. For each query, find the count of Mystical Numbers in the subarray A[L:R]A[L:R] with respect to the number XX. Notes: ⊕⊕ represents … Read more

[Solution] Pushpa solution codechef

Pushpa solution codechef – Pushpa has entered Chefland and wants to establish Pushpa-Raj here too. [Solution] Pushpa solution codechef Chefland consists of NN floating wooden logs. Each log has a positive integer written on it which denotes the height of the log from ground. The ithith wooden log is initially floating at a height HiHi from the ground. Pushpa will initially … Read more

[Solution] The Magical Stone solution codechef

The Magical Stone solution codechef – Initially, there is a magical stone of mass 2N2N lying at the origin of the number line. For the next NN seconds, the following event happens: [Solution] The Magical Stone solution codechef Let us define the decomposition of a magical stone as follows: If there is a magical stone of mass M>1M>1 lying at coordinate XX, then … Read more

[Solution] Sugarcane Juice Business solution codechef

Sugarcane Juice Business solution codechef – While Alice was drinking sugarcane juice, she started wondering about the following facts: [Solution] Sugarcane Juice Business solution codechef The juicer sells each glass of sugarcane juice for 5050 coins. He spends 20%20% of his total income on buying sugarcane. He spends 20%20% of his total income on buying salt and mint leaves. He spends 30%30% of … Read more

[Solution] The Attack of Queen solution codechef

The Attack of Queen solution codechef – Chef has started developing interest in playing chess, and was learning how the Queen moves. [Solution] The Attack of Queen solution codechef Chef has an empty NĂ—NNĂ—N chessboard. He places a Queen at (X,Y)(X,Y) and wonders – What are the number of cells that are under attack by the Queen? Notes: The top-left … Read more

[Solution] Football Cup solution codechef

Football Cup solution codechef – It is the final day of La Liga. Chef has a certain criteria for assessing football matches.In particular, he only likes a match if: [Solution] Football Cup solution codechef The match ends in a draw, and, At least one goal has been scored by either team. Given the goals scored by … Read more

[Solution] Miami GP solution codechef

Miami GP solution codechef – Chef has finally got the chance of his lifetime to drive in the F1F1 tournament. But, there is one problem. Chef did not know about the 107% rule and now he is worried whether he will be allowed to race in the main event or not. [Solution] Miami GP solution codechef Given the … Read more