Блог пользователя steinum

Автор steinum, 14 месяцев назад, По-английски

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)
  • Проголосовать: нравится
  • +102
  • Проголосовать: не нравится

»
14 месяцев назад, # |
  Проголосовать: нравится +10 Проголосовать: не нравится

Supper Excited

»
14 месяцев назад, # |
  Проголосовать: нравится +10 Проголосовать: не нравится

Thanks for the contest(:

»
14 месяцев назад, # |
  Проголосовать: нравится +28 Проголосовать: не нравится

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

»
14 месяцев назад, # |
  Проголосовать: нравится +29 Проголосовать: не нравится

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

»
14 месяцев назад, # |
  Проголосовать: нравится +28 Проголосовать: не нравится

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

»
14 месяцев назад, # |
  Проголосовать: нравится +21 Проголосовать: не нравится

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

»
14 месяцев назад, # |
  Проголосовать: нравится 0 Проголосовать: не нравится

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

»
14 месяцев назад, # |
  Проголосовать: нравится +4 Проголосовать: не нравится

Very Eagerly waiting!

»
14 месяцев назад, # |
  Проголосовать: нравится +9 Проголосовать: не нравится

I'm excited to participate with my team

»
13 месяцев назад, # |
  Проголосовать: нравится +4 Проголосовать: не нравится

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

»
13 месяцев назад, # |
Rev. 3   Проголосовать: нравится +5 Проголосовать: не нравится

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.

  • »
    »
    13 месяцев назад, # ^ |
    Rev. 3   Проголосовать: нравится 0 Проголосовать: не нравится

    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.

    • »
      »
      »
      13 месяцев назад, # ^ |
        Проголосовать: нравится 0 Проголосовать: не нравится

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

  • »
    »
    13 месяцев назад, # ^ |
      Проголосовать: нравится 0 Проголосовать: не нравится

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

  • »
    »
    13 месяцев назад, # ^ |
    Rev. 2   Проголосовать: нравится 0 Проголосовать: не нравится

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

  • »
    »
    13 месяцев назад, # ^ |
      Проголосовать: нравится 0 Проголосовать: не нравится

    approach pls

    • »
      »
      »
      13 месяцев назад, # ^ |
        Проголосовать: нравится +1 Проголосовать: не нравится

      $$$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$$$.

    • »
      »
      »
      13 месяцев назад, # ^ |
        Проголосовать: нравится +1 Проголосовать: не нравится

      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.

»
13 месяцев назад, # |
  Проголосовать: нравится 0 Проголосовать: не нравится

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

  • »
    »
    13 месяцев назад, # ^ |
      Проголосовать: нравится 0 Проголосовать: не нравится

    How to do G , Any hint??

    • »
      »
      »
      13 месяцев назад, # ^ |
        Проголосовать: нравится 0 Проголосовать: не нравится

      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

  • »
    »
    13 месяцев назад, # ^ |
      Проголосовать: нравится 0 Проголосовать: не нравится

    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

»
13 месяцев назад, # |
  Проголосовать: нравится 0 Проголосовать: не нравится

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

»
13 месяцев назад, # |
  Проголосовать: нравится 0 Проголосовать: не нравится

How to solve D ?

»
13 месяцев назад, # |
  Проголосовать: нравится 0 Проголосовать: не нравится

Anyone give me B and F solution, please.

»
13 месяцев назад, # |
  Проголосовать: нравится 0 Проголосовать: не нравится

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?

»
13 месяцев назад, # |
  Проголосовать: нравится 0 Проголосовать: не нравится

How to solve F? was gettin tle

»
13 месяцев назад, # |
Rev. 2   Проголосовать: нравится +14 Проголосовать: не нравится

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

»
11 месяцев назад, # |
Rev. 3   Проголосовать: нравится 0 Проголосовать: не нравится

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

  • »
    »
    11 месяцев назад, # ^ |
    Rev. 2   Проголосовать: нравится +5 Проголосовать: не нравится

    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.