Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # Command: perl -pe'print pos()." "while(m/[S^]/g);$_="\n"' <input | grep -v '^$' | dc -fdc-p12.dc
- # Process Beam: beam -> 0 (num is passed in reg n)
- [
- lp1+sp # part1++
- d1+ d;t ln+ r:t # table(beam+1) += num; beam
- d1- d;t ln+ r:t # table(beam-1) += num; beam
- 0 r:t # table(beam) = 0
- 0
- ] sB
- ? 1r:t # table(start)=1
- ?
- [
- # split1 split2 ...
- [
- d;t dsn # table(split) split ...
- 0<B
- s.
- z0<L
- ] dsLx
- ? z0<M
- ] dsMx
- [Part 1: ]n lpp
- # Sum table for part 2
- 0*
- F0 # i sum
- [
- d;t # table(i) i sum
- 3R+ r # i sum+=table(i)
- 1- d0<L
- ] dsLx +
- [Part 2: ]n p
Advertisement
Add Comment
Please, Sign In to add comment