Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- [q] SX # exit if we run out of stack without an answer
- [
- d 2020 r - * pq # print top * (2020 - top) and exit
- ] SP
- [
- z 0 =X # exit if stack empty
- d 1 r:v # put 1 at v[top]
- d 2020 r - ;v 1 =P # dup, if v[2020 - top] = 1 then call Print
- s. # junk top of stack to remove unneeded dup
- lLx # loop
- ] SL
- lLx
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement