SHENZHEN I/O

SHENZHEN I/O

评价数不足
ODD OR EVEN
   
奖励
收藏
已收藏
取消收藏
文件大小
发表于
6.000 KB
2018 年 1 月 2 日 上午 3:42
1 项改动说明 ( 查看 )

订阅以下载
ODD OR EVEN

描述
11 条留言
Cocoa 2022 年 7 月 12 日 上午 12:35 
3/303/8

pulse = 100 - |number mod 2| × 50
Use dst instruction can force set acc to negative, without any test instruction.
RedRam 2022 年 4 月 2 日 下午 9:20 
3/303/8 O_O

I abused the behavior of dst when the 2nd operand isnt a simple single digit number
and I also didn't use braching
Sir FailsALot 2019 年 2 月 15 日 上午 6:32 
Best Attempt: 5/452/14

Worst Attempt: 17/776K/50 (I actually tried to be inefficient.)
lisamariefan 2018 年 8 月 3 日 下午 9:53 
3/341/9
7/189/5

Yeah, I know I didn't need dgt though it was something I missed in my fast and initial attempt. Like I said, it was a mindless approach where I wasn't analyzing as closely as I should.
O_T 2018 年 7 月 24 日 下午 2:16 
price: 3 / 303 / 9
power and lines: 7 / 189 / 5

@ lisamariefan
When you are using the ROM you don't need dgt and dst
lisamariefan 2018 年 7 月 24 日 下午 12:59 
And...7/189/6 as I could cut out a move to the accumulator...
lisamariefan 2018 年 7 月 24 日 下午 12:57 
I was really unthinking in my first approach and had an unnecessary dgt 0 in my code. New approach is 7/227/6.
lisamariefan 2018 年 7 月 17 日 下午 8:12 
I'm sure there's more efficient ways to do this, but my first rather unthinking approach was 7/265/7
TehJumpingJawa 2018 年 4 月 13 日 下午 5:43 
2nd hint:
The 'dst' instruction :)

Is 3 / 303 / 9 the best cheapest solution?

For such a trivially simple problem, the complexity created by the I/O & operator constraints creates a surprisingly large number of approaches to solving it.
coelocanth 2018 年 2 月 1 日 下午 3:59 
Hint: the 'dst' instruction