Competitive Programming using... Scratch?

Правка en2, от dolphingarlic, 2020-08-21 21:10:23

One of the many reasons why SAPO is the best informatics Olympiad is that we're allowed to submit solutions in Scratch (TianCilliers wrote a CMS plugin to support Scratch a while ago)

The second round of SAPO 2020 was held earlier this week, so obviously I had to try to solve the problems using Scratch.

The problems were:

  • Given X, Y, and N, output N / X + N / Y - N / lcm(X, Y).
  • Add two given numbers in base B for a given B.
  • This problem but modulo 1e8.
  • Given a tree and some paths, find the number of edges in the union of those paths.

I was able to solve the first and third problems this way:

but I couldn't implement the second and fourth problems.

As you can see in the code for problem 3, working with multiple arrays is a bit of a nightmare.

I feel like problem 2 is solvable using Scratch (albeit very painfully), but since Scratch doesn't have 2D arrays, I don't see how one could solve problem 4 using Scratch.

Do any of you have ideas about how one can work with graphs using Scratch?

(P.S. my other Scratch implementations are available at https://github.com/dolphingarlic/ScrAtChO)

EDIT: Thanks to -is-this-fft-, I was able to implement a solution for problem 4. https://scratch.mit.edu/projects/419364160

Теги scratch, help, discussion

История

 
 
 
 
Правки
 
 
  Rev. Язык Кто Когда Δ Комментарий
en2 Английский dolphingarlic 2020-08-21 21:10:23 151
en1 Английский dolphingarlic 2020-08-21 13:43:26 1434 Initial revision (published)