bubble cup 2019 microsoft development center serbia 6 mdcs – bubble cup 2019 about bubble cup...

Download Bubble Cup 2019 Microsoft Development Center Serbia 6 MDCS – Bubble Cup 2019 About Bubble Cup Bubble

Post on 17-Oct-2019

10 views

Category:

Documents

0 download

Embed Size (px)

TRANSCRIPT

  • Bubble Cup 2019

    Microsoft Development Center Serbia

    Problem set & Analysis from

    the Finals and Qualification

    rounds

    Belgrade, 2019

  • 2 MDCS – Bubble Cup 2019

    Scientific committee:

    Aleksa Milisavljević

    Aleksandar Damjanović

    Bojan Vučković

    Janko Šušteršič

    Kosta Bizetić

    Kosta Grujčić

    Miloš Šuković

    Nebojša Savić

    Nikola Smiljković

    Nikola Nedeljković

    Predrag Ilkić

    Slavko Ivanović

    Qualification analysts:

    Aleksa Miljković Nikola Pešić

    Ivan Stošić Pavle Janevski

    Katarzyna Kowalska Pavle Martinović

    Konrad Majewski Petar Vasiljević

    Krzysztof Maziarz Tadija Šebez

    Magdalina Jelić Uroš Berić

    Marko Šišović Uroš Maleš

    Michal Zawalski Veljko Radić

    Mihailo Milošević

    Miloš Purić

    Mladen Puzić

    Nikola Jovanović

    Cover:

    Sava Čajetinac

    Typesetting:

    Marijana Prpa

    Anja Pantović

    Volume editor:

    Dragan Tomić

  • MDCS – Bubble Cup 2019 3

    Contents

    Preface .......................................................................................................................................................................... 5

    About Bubble Cup ................................................................................................................................................... 6

    Problem A: Harvester ........................................................................................................................................... 13

    Problem B: Periodic integer number ............................................................................................................. 16

    Problem C: Workout plan................................................................................................................................... 19

    Problem D: The Light Square ............................................................................................................................ 22

    Problem E: BubbleReactor ................................................................................................................................. 26

    Problem F: Function Composition .................................................................................................................. 30

    Problem G: Jumping Transformers ................................................................................................................. 33

    Problem H: Guarding warehouses .................................................................................................................. 37

    Problem I: Xor Spanning Tree........................................................................................................................... 42

    Problem J: Product tuples ................................................................................................................................. 45

    Problem K: Alpha planetary system ............................................................................................................... 48

    Round 1: Ada and Tic-Tac-Toe......................................................................................................................... 55

    Round 1: Building Subways ............................................................................................................................... 59

    Round 1: Input ........................................................................................................................................................ 62

    Round 1: First to meet the spaceship ............................................................................................................ 66

    Round 1: Mysteriousness of a Logical Expression .................................................................................... 70

    Round 1: N..K..Divide ........................................................................................................................................... 74

    Round 1: Rational Numbers .............................................................................................................................. 77

    Round 1: Toby and the Frog ............................................................................................................................. 80

    Round 1: Walk home together ......................................................................................................................... 82

    Round 1: [Challenge] Guess The Number With Lies v5 .......................................................................... 86

    Round 2: Ada and Scarecrow............................................................................................................................ 91

    Round 2: Ada and Prime..................................................................................................................................... 96

    Round 2: Just a Palindrome ............................................................................................................................... 98

    Round 2: Tjandra 19th birthday present (HARD) .................................................................................... 101

    Round 2: Game Simulator ................................................................................................................................ 108

    Round 2: Union Laser ........................................................................................................................................ 117

    Round 2: The Zebra Crossing ......................................................................................................................... 122

  • 4 MDCS – Bubble Cup 2019

    Round 2: Connect the Points .......................................................................................................................... 125

    Round 2: Forest .................................................................................................................................................... 128

    Round 2: [Challenge] JawBreaker Game ..................................................................................................... 132

  • MDCS – Bubble Cup 2019 5

    Preface

    Dear Bubble Cup finalists,

    I would like to thank you for taking part in the twelfth edition of Bubble Cup in Belgrade, Serbia.

    This year there are two divisions: The Premier League – the division opened for high school and

    university teams which meet the eligibility requirements of Bubble Cup; and Rising Stars – the

    division opened only for eligible Serbian high school teams. By creating the Rising Stars

    division, we want to encourage Serbian high schools to compete in Bubble Cup and motivate

    young programming talents in Serbia as well.

    Bubble Cup 12 has gathered more than 80 competitors in 28 teams (The Premier League consists

    of 16 teams and Rising Stars consists of 12 teams). The Finalists come from Belarus, Bulgaria,

    Poland, Ukraine and Serbia. The Rising Stars finalists, composed of high school teams from

    Serbia, come from Belgrade, Niš, Novi Sad and Sombor.

    For twelve years, Microsoft Development Center has been hosting Bubble Cup, a competition

    designed for high school and university students, as a form of a complete preparation for some

    of the most significant and prestigious coding tournaments – such as the ACM competition. In

    addition to that, the importance of the participation in the Bubble Cup competition in preparing

    young talents for professional development is also reflected in the fact that many of more than

    300 employees of Microsoft Development Center were once Bubble Cup finalists.

    We are glad to have you all as a part of our Bubble Cup team for a better future of discovering

    new coding models and creating new friendships.

    Sincerely,

    Dragan Tomic

    MDCS PARTNER Engineer manager/Director

  • 6 MDCS – Bubble Cup 2019

    About Bubble Cup

    Bubble Cup is a coding contest started by Microsoft Development Center Serbia in 2008 with

    a purpose of creating a local competition similar to the ACM Collegiate Contest, but soon that

    idea was overgrown and the vision was expanded to attract talented programmers from the

    entire region and promote the values of communication, companionship and teamwork.

    This edition of Bubble Cup is special because the format of the competition has changed this

    year. Now we have two divisions:

    1. Premier League – Division opened to high school and university teams that satisfy

    eligibility rules

    2. Rising Stars – Division opened only to eligible Serbian high schools’ teams.

    The best 16 teams from the Premier League division and the best 8 teams from the Rising Star

    division will have chance to compete in the Finals. Additionally, 4 best teams from specialized

    IT departments were invited to compete in Rising Stars division for total number of 12 teams

    in Rising Stars division.

    This year, all Bubble Cup finalists had a chan

Recommended

View more >