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

Автор Hosen_ba, 2 года назад, По-английски

We are happy to invite you to participate in 2024 Tishreen Collegiate Programming Contest that was held on the 25th of June in latakia, Syria.

The problems are authored and prepared by ahmad_alghadban, Ahmad7_7, Zaher, Go8, EyadBT, JaberSH1, Khaled_Mardini, SaeedSabbagh, Neodoomer, Yaman_Alwaza, OmarAlzakout, and me.

Thanks to The_Hallak, AmmarDab3an, Bisher_Sahloul, SUL, THE_THUNDERSTORM_BEGINS, Grizoo,skahl15, Khaled_Al_Awad, AhmadSelo, abd-alrzaq, and kareem_Bizreh for testing the contest.

We would love to hear your feedback on the problems in the comments section. Hope you enjoy solving the problems!

  • Проголосовать: нравится
  • +71
  • Проголосовать: не нравится

»
2 года назад, скрыть # |
 
Проголосовать: нравится +20 Проголосовать: не нравится

As a LordOfTheWrongs ... good job for this magnificent contest

»
2 года назад, скрыть # |
 
Проголосовать: нравится +28 Проголосовать: не нравится

ah yes , new gym as a tester = more contributions

»
2 года назад, скрыть # |
 
Проголосовать: нравится +5 Проголосовать: не нравится

When will the contest start ??? How do I participate?

»
2 года назад, скрыть # |
 
Проголосовать: нравится +28 Проголосовать: не нравится

As a first time tester, I really enjoy writing "as a tester...".

Just kidding, the problems were really awesome.

»
2 года назад, скрыть # |
 
Проголосовать: нравится +25 Проголосовать: не нравится

As Tester i really enjoyed the contest.

thanks for the problem setters for the awesome problems :)

»
2 года назад, скрыть # |
 
Проголосовать: нравится +27 Проголосовать: не нравится

as tester , I Enjoy very much as testing this gym Finally , new ideas !!!!!!

»
2 года назад, скрыть # |
 
Проголосовать: нравится +18 Проголосовать: не нравится

as a non tester

all the authors are my uncles

»
2 года назад, скрыть # |
 
Проголосовать: нравится +27 Проголосовать: не нравится

as wtf ammar

The contest is uncly for sure

»
2 года назад, скрыть # |
 
Проголосовать: нравится +16 Проголосовать: не нравится

For me, I can feel it's another LIT gym.I can't wait to participate!!

»
2 года назад, скрыть # |
 
Проголосовать: нравится +17 Проголосовать: не нравится

As a sea problem setter, I hope you find the problems interesting <3

»
2 года назад, скрыть # |
 
Проголосовать: нравится +3 Проголосовать: не нравится

will you post the solutions ?

»
2 года назад, скрыть # |
 
Проголосовать: нравится +3 Проголосовать: не нравится

Is G's answers just 2 or 4.

Anyway, how to solve J :(

  • »
    »
    2 года назад, скрыть # ^ |
    Rev. 2  
    Проголосовать: нравится +9 Проголосовать: не нравится
    Hints
  • »
    »
    2 года назад, скрыть # ^ |
    Rev. 2  
    Проголосовать: нравится +3 Проголосовать: не нравится
    Spoiler
»
2 года назад, скрыть # |
 
Проголосовать: нравится 0 Проголосовать: не нравится

How to solve H . Divide And Multiply ..i try to solve this using freq array but got WA on 2

  • »
    »
    2 года назад, скрыть # ^ |
     
    Проголосовать: нравится +3 Проголосовать: не нравится

    You can see that the value you want to get is a number in an array a

    Let's that value is d

    If you want to make all elements equal to d, you can see that: . If d = a[i], you don't need to use operation . If d is divisor of a[i], you need 1 transform to make a[i] equal to d . If d is multiplier of a[i], you need 1 transform to make a[i] equal to d . Otherwise, you need to make 2 transforms to make a[i] equal to d

    So the problem can convert to for any d, let's cntDiv[d] is number of elements in a with d is divisor, and cntMul[d] is number of elements in a with d is multiplier

»
2 года назад, скрыть # |
 
Проголосовать: нравится +3 Проголосовать: не нравится

How to solve C ? any hint?

  • »
    »
    2 года назад, скрыть # ^ |
     
    Проголосовать: нравится +3 Проголосовать: не нравится

    Find diameter of tree and then use grundy

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

      Sorry, I still don't understand how to use the greedy to solve this. Could you please explain it to me?

      • »
        »
        »
        »
        2 года назад, скрыть # ^ |
        Rev. 2  
        Проголосовать: нравится +8 Проголосовать: не нравится

        In this game, we can identify winning and losing states based on the diameter of the tree.

        Winning State: If the diameter of the tree has 1 or 2 nodes, you can remove both, making 1 and 2 winning states. Now, let's consider a diameter of 3 nodes:

        Losing State: If there are 3 nodes in the diameter, you can remove one or two nodes on your move. However, by doing so, you always leave your opponent in a winning state, with no way to force them into a losing state. Thus, a diameter of 3 is a losing state.

        For diameters of 4 and 5:

        Winning State: With 4 nodes in the diameter, you can remove 1 node, leaving your opponent with a diameter of 3 nodes, which is a losing state. Similarly, with 5 nodes, you can remove 2 nodes, again reducing the diameter to 3, thus giving your opponent a losing state.

        For a diameter of 6:

        Losing State: You cannot force your opponent into a losing state because any move you make will leave them with a diameter of 4 or 5, both of which are winning states. Therefore, a diameter of 6 is also a losing state.

        From this analysis, we can conclude that if the diameter of the tree has 3*k nodes, it's a losing state. Otherwise, you can always win the game.

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

        Not greedy, it's grundy in game theory. You can search it on Google :D

»
2 года назад, скрыть # |
 
Проголосовать: нравится +11 Проголосовать: не нравится

as a tester , this was an amaizing contest

»
2 года назад, скрыть # |
 
Проголосовать: нравится 0 Проголосовать: не нравится

How to prove F? my solution is just

$$$ 2 \times \left\lfloor \frac{n}{2} \right\rfloor \times \left( \left\lfloor \frac{n}{2} \right\rfloor + 1 \right) + \left( n \bmod 2 \times \left\lceil \frac{n}{2} \right\rceil \right) $$$
»
2 года назад, скрыть # |
 
Проголосовать: нравится +11 Проголосовать: не нравится

As a problem setter, wtf ammar?!

»
2 года назад, скрыть # |
 
Проголосовать: нравится 0 Проголосовать: не нравится

Is there any editorial available?

»
2 года назад, скрыть # |
 
Проголосовать: нравится 0 Проголосовать: не нравится

Testcases for H seem not strong enough. Were $$$\mathcal{O}(n \sqrt{n})$$$ solutions intended to pass?

Solution spoiler
»
2 года назад, скрыть # |
 
Проголосовать: нравится +16 Проголосовать: не нравится

As a problem-setter <3

»
2 года назад, скрыть # |
 
Проголосовать: нравится 0 Проголосовать: не нравится

for D is the intended solution O(n)? can O(nlogn) pass ?

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

How to solve problem G?