Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- DEFLNG A-Z
- TYPE tLL
- d AS LONG
- n AS LONG
- p AS LONG
- END TYPE
- DIM LL(10000000) AS tLL
- DIM s(1000) AS LONG
- DIM shi(1000) AS LONG
- players = 476: marbles = 7143100
- FOR m = 1 TO marbles
- i = LL(i).n: i = LL(i).n: inext = LL(i).n
- py = py + 1: IF py > players THEN py = py - players
- IF m MOD 23 = 0 THEN
- s(py) = s(py) + m
- FOR h = 1 TO 8: i = LL(i).p: NEXT
- iprev = LL(i).p
- inext = LL(i).n
- LL(iprev).n = inext
- LL(inext).p = iprev
- s(py) = s(py) + LL(i).d
- ELSE
- t = t + 1:
- LL(i).n = t: LL(t).n = inext: LL(t).d = m
- LL(inext).p = t: LL(t).p = i
- END IF
- WHILE s(py) > 100000: s(py) = s(py) - 100000: shi(py) = shi(py) + 1: WEND
- NEXT
- FOR py = 1 TO players
- IF shi(py) > shi(bestpy) THEN bestpy = py: PRINT shi(py); s(py)
- IF shi(py) = shi(bestpy) AND s(py) > s(bestpy) THEN bestpy = py: PRINT shi(py); s(py)
- NEXT
- PRINT
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement