Codeforces Round 1133 (Div. 1, Div. 2) is coming soon! Register here. ×

jay_jani_0011's blog

By jay_jani_0011, 12 months ago, In English

Thanks for participating in the contest! Link to access contest: CodeNite 2025

644977A - Four Coprimes

Author: jay_jani_0011

Solution
Code - aryansanghi

644977B - Permuting the LCM

Author: Dragmon

Hint 1
Solution
Code - jay_jani_0011

644977C - The XOR Array Alchemist

Author: jay_jani_0011

Hint 1
Hint 2
Hint 3
Solution
Code - jay_jani_0011

644977D - Quantum Cascade

Author: BayernForce

Hint 1
Hint 2
Solution
Code - BayernForce

644977E - Drop the Ball

Author: _chrisrex_

Hint 1
Hint 2
Solution
Code - _chrisrex_

644977F - Maximizing Line Graph

Author: Dragmon

Hint 1
Hint 2
Hint 3
Solution
Code - aryansanghi
Code - Um_nik
  • Vote: I like it
  • +48
  • Vote: I do not like it

| Write comment?
»
12 months ago, hide # |
 
Vote: I like it +9 Vote: I do not like it

Nice Problems! Thanks for the contest :)

»
12 months ago, hide # |
 
Vote: I like it +6 Vote: I do not like it

Alt Soln for B. find all i from 1 to N which are a factor of k. Take the lcm of all such i's if its equal to k then Yes else No

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

    Fkin hate that I bricked D. I found out that this is just Range Query using segtree but I couldn't think (underconfident) about how to merge the nodes. Should have thinked patiently

»
12 months ago, hide # |
 
Vote: I like it +9 Vote: I do not like it

This contest feels kinda like AtCoder ABC. There are all problems but the last which are just some tech and the last problem just isn't solvable. Though the quality of problems A-E is better, than of a typical ABC, all of them are kinda straightforward.

A — bruteforce

B — cool idea that you can just mix up all of the divisors $$$\le n$$$

C — 2143F - Increasing Xor but easier, though I overkilled a bit with xor basis

D — the problem just says to you that you need to find out how to use segment tree. It also felt logical that the answer is $$$kx + b$$$ and then it's just writing down a lot of formulas and factoring them

E — sort children by a and then find the vertex with the least time out, doesn't feel harder than D.

It's basically a speedforces from A to E, some intermediate problem before F would really be good here, especially since it seems like aryan is the only one who can understand line graphs

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

    Can you share your code for C using the XOR basis?

  • »
    »
    12 months ago, hide # ^ |
     
    Vote: I like it +24 Vote: I do not like it

    Hi, thank you for the extensive feedback, hope that you enjoyed the problems. Well, I did have an intermediate problem to give before F, but alas it was on line graphs too(and I have it saved for a future contest, will be held sometime someday), so we decided to go with the current set. I'll take the "especially since it seems like aryan is the only one who can understand line graphs" as a compliment xd(though Um_nik destroyed the problem in $$$1$$$ hr).

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

    can you please explain approach for 3rd one ?as i had observed that first move from right and try to make a[i] as large as possible with a[i]<=a[i+1] but then i realised that order will matters ? we can not do operation from last

    • »
      »
      »
      12 months ago, hide # ^ |
      ← Rev. 2  
      Vote: I like it 0 Vote: I do not like it

      You can do it, using XOR basis in O(121*n) greedily by making a[i] as large as possible <= a[i+1].

      Spoiler
»
12 months ago, hide # |
← Rev. 2  
Vote: I like it +13 Vote: I do not like it

My Solution for D used matrix Exponentiation using segment trees. as Eout=(pi⋅mi+1−pi)⋅Ein+(1−pi)⋅si

build a matrix as [[E 1],[0 0]] and multiplying with [[pi⋅mi+1−pi 0],[(1-pi).si 1]]

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

For problem C can we just generate all XOR values with XOR basis then find if there exists N number of non-descending numbers? I think it will work!

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

    That should not work. An element at an index $$$i$$$ cannot be turned into any arbitrary xor sum of any combination of elements of the array. It can only be made into xor of itself with any combination of elements on its right.

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

for C we can use xor basis to solve for n * (bits^2) https://pastebin.com/1fs0jg49

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

does the technique used in E have some common name ? , and it would be helpful if someone recommend similar problem to E, for practice. Thanks.