One of the many reasons why [SAPO](https://saco-evaluator.org.za/cms/) is the best informatics Olympiad is that we're allowed to submit solutions in Scratch ([user:TianCilliers,2020-08-21] 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](https://cses.fi/problemset/task/1638) 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:↵
↵
![ ](/predownloaded/02/51/0251a08bbf0c148756c0be2b4fc719185a51d13c.png)↵
↵
![ ](/predownloaded/47/fc/47fc30d904692d3e815a62968836f21a3a1f3f38.png)↵
↵
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.sS. my other Scratch implementations are available at https://github.com/dolphingarlic/ScrAtChO)↵
↵
**EDIT**: Thanks to [user:-is-this-fft-,2020-08-21], I was able to implement a solution for problem 4. https://scratch.mit.edu/projects/419364160
↵
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](https://cses.fi/problemset/task/1638) 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:↵
↵
![ ](/predownloaded/02/51/0251a08bbf0c148756c0be2b4fc719185a51d13c.png)↵
↵
![ ](/predownloaded/47/fc/47fc30d904692d3e815a62968836f21a3a1f3f38.png)↵
↵
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.
↵
**EDIT**: Thanks to [user:-is-this-fft-,2020-08-21], I was able to implement a solution for problem 4. https://scratch.mit.edu/projects/419364160