steinum's blog

By steinum, 20 months ago, In English

Hello, Codeforces!

The flagship contest of SUST is here everyone! There will be 12 problems and the problemset is based on Brain Craft Intra SUST Programming Contest 2023. We cordially invite you to participate in this contest. Also, we encourage you to participate as teams. Please make sure that you read ALL the problems!

The contest will be held on Apr/07/2023 11:05 (Moscow time) and will run for 5 hours.

The setters of this contest are: Alfeh, Kawchar85, Mac_prime, magic_kiri, nh_nayeem, Raiden, ShikariSohan, ShinnirKolaChori, susmoydhar7, Tahseen

Contest link: Contest Based on Brain Craft Intra SUST Programming Contest 2023

UPD: Congratulations to the winners of the round!

Top 5 of all participants:

PlaceParticipantProblem solved=
1satyam343101274
2lukameladze1, keta_tsimakuridze, Phantom_Performer101341
3Adam_GS102116
4Coder_Nayak, sloppy_coder, Krypto_Ray7588
5MinhazIbnMizan, BrehamPie, Arnob7652

Participants who sent the first correct solution to the problems:

TaskParticipantPenalty
AthisIsMorningstar01:07
Bshort-circuit00:05
Clukameladze1, keta_tsimakuridze, Phantom_Performer00:34
DMinhazIbnMizan, BrehamPie, Arnob01:42
Esatyam34301:12
FCoronaVirus21675300:04
GCoder_Nayak, sloppy_coder, Krypto_Ray00:06
Hmerlin_00:28
iCoronaVirus21675300:24
Jsatyam34300:54
KJanekKwadrat, _supernalu_02:25
L--

UPD2:

Solutions

104283A - Yet Another Short Statement
ideas: Kawchar85
prepared: steinum

Solution (steinum)

104283B - Johny English and Group Formation
ideas: Raiden
prepared: Raiden

Solution (Raiden)

104283C - Johnny English Strikes Again
ideas: Raiden
prepared: Raiden

Solution (Raiden)

104283D - Search For Beauty
ideas: Kawchar85
prepared: Kawchar85

Solution (Kawchar85)

104283E - Tree query with update
ideas: Alfeh
prepared: Alfeh

Solution (Alfeh)

104283F - Find GCD
ideas: Kawchar85
prepared: Kawchar85

Solution (Kawchar85)

104283G - Another Tree Query
ideas: Alfeh
prepared: Alfeh

Solution (Alfeh)

104283H - Sequential Nim
ideas: Kawchar85
prepared: Kawchar85

Solution (Raiden)

104283I - The Secret Key
ideas: Kawchar85
prepared: Kawchar85

Solution (steinum)

104283J - Magic Balls
ideas: Raiden
prepared: Raiden

Solution (nh_nayeem)

104283K - Special Lattice Path
ideas: magic_kiri
prepared: steinum

Solution (steinum)

104283L - Ultimate Game
ideas: ShinnirKolaChori
prepared: Raiden

Solution (steinum)
  • Vote: I like it
  • +102
  • Vote: I do not like it

| Write comment?
»
20 months ago, # |
  Vote: I like it +10 Vote: I do not like it

Supper Excited

»
20 months ago, # |
  Vote: I like it +10 Vote: I do not like it

Thanks for the contest(:

»
20 months ago, # |
  Vote: I like it +28 Vote: I do not like it

There are some very interesting problems. I'd suggest everyone to read all the problems. Also participating as a team is recommended.

»
20 months ago, # |
  Vote: I like it +29 Vote: I do not like it

The tasks are worth brainstorming I assure! Good luck people!

»
20 months ago, # |
  Vote: I like it +28 Vote: I do not like it

As a setter and tester I can assure you that the problems are quite interesting and you will enjoy it.

»
20 months ago, # |
  Vote: I like it +21 Vote: I do not like it

As a setter & tester, the tasks are quite interesting and the statements are clear.

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

As a participant, I will not do this contest again.

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

Very Eagerly waiting!

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

I'm excited to participate with my team

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

excited to participate but it will coincide with the iftar time.

»
20 months ago, # |
Rev. 3   Vote: I like it +5 Vote: I do not like it

What was the intended time complexity on I ?

My solution had a complexity of $$$\mathcal{O}(T \cdot \text{div}(N))$$$, where div(N) is count of all the divisors of N = max(A, B). And, still my solution didn't fit into the limit. I changed long long to int and it passed, nice.

  • »
    »
    20 months ago, # ^ |
    Rev. 3   Vote: I like it 0 Vote: I do not like it

    I think you mean T*div(max(A,B)), where T is number of testcases. My solution using long long initially TLed but passed using fast io.

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

      Yes, thanks. Idk, I had even fast io, still I had hard time getting AC.

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

    Can you share the solution of tree query problem both E and G

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

    $$$\mathcal{O}(t\times log(\sigma_{0}(n))$$$

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

    approach pls

    • »
      »
      »
      19 months ago, # ^ |
        Vote: I like it +1 Vote: I do not like it

      $$$X$$$ should be the divisor of $$$g=\gcd(A-m_1,B-m_2)$$$. You can check all divisors of $$$g$$$. You need to be careful when $$$A=m_1$$$ and $$$B=m_2$$$. In that case, answer is $$$\max(A,B)+1$$$.

    • »
      »
      »
      19 months ago, # ^ |
        Vote: I like it +1 Vote: I do not like it

      In addition to what @satyam343 has said, you have to handle cases when either A or B is equal to its remainder or less than its remainder.

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

Easier version of G. Also, how to do A? I thought of digit dp + binary search, but number of operations per testcase would be 162*18*10*log(k), which will TL over 1e5 testcases

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

    How to do G , Any hint??

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

      Suppose you have two components, and you know the endpoints of a diameter for both. Suppose [P1, P2] is a diameter of the first component, [Q1, Q2] is a diameter of the second component. After merging these two components, the resulting diameter will have endpoints among [P1, P2, Q1, Q2]. We can check all these distances in logarithmic time using LCA, and update the diameter accordingly

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

        Can you please share your solution. It is difficult for me to understand. by seeing code and what you say , I can interpret the idea behind the solution I will be vey thankful to you.

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

        I see your code , i am getting some idea. Actually you are merging and keep track of diameter end point of these two components and we have our full tree also which give us distance so we can figure out the new diameter end point. Thanks for your solution

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

    instead of binary search you can just walk on dp table. again if you take a smaller number for any position, you can save the state for all test case

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

How to see others solution? If it is restricted please make it open , it will be very helpful Thanks

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

How to solve D ?

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

    $$$\sigma_0{(n)}\phi{(n)}$$$

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

      why

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

      9 days passed, when you are going to provide explaination for the problems lmfao

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

        we are not publishing official editorial.

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

          that doesn't make any sense, what about for those who want to upsolve ? i really liked the problems but now i cant solve them now because there's no official/unofficial solution/ideas !

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

Anyone give me B and F solution, please.

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

How to solve D, any hints? I tried to solve J considering strongly connected component of a directed graph. I tried to maximize the prizes of each balls accordingly. what was wrong?

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

How to solve F? was gettin tle

»
19 months ago, # |
Rev. 2   Vote: I like it +14 Vote: I do not like it

I love whole Problem Set, Can anyone give me some hints for Ques A). Yet Another Short Statement

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

In Problem E solution. The Function is_parent() is actually checking if a is anchestor of b, not only direct parent. Correct me if I'm wrong. And I didn't get the u = Lca(u, lvl[u]-lv[v]-1) part.. Please help...Alfeh

  • »
    »
    17 months ago, # ^ |
    Rev. 2   Vote: I like it +5 Vote: I do not like it

    Yes, is_parent(a, b) function is actually checking if a is one of the ancestors of b, not only the direct one.

    Lca(a,b) function find bth ancestor of node a. Sorry for misguiding function name. Maybe kth_ancestor(a, k) would be a good name.