|
[原创]第十一题 步步逼近
就是常规穷举。针对具有大片连续结果的穷举,如果从最低bit位一个个搜索,每次都使用i++,显然效率低下,因此可以切换思路。假如我们猜测至少有连续的16个结果,那么可以使用i+=0x10进行搜索,这样我们跳过了最低4个比特的搜索,速度提升了16倍。但是这题并不明确连续结果的长度,但是给定了结果的上限0x100000000,这样我们就可以从最高比特开始搜索,相当于把1、2、3、4、5这几个字高低比特反序,这样搜索的值依次为0x80000000、0x40000000、0xc0000000、0x20000000、0xa0000000.因为这题的连续结果很多,且只有一片,因此这种搜索速度非常快,基本低12比特都跳过了,穷举空间只有20比特左右。我记得搜索出的结果类似是0xXXXXX000,经过验证结果的正确性后,顺着这个数继续二分搜索低位的3个0(12比特)就行了。
最后于 2023-10-7 10:18
被xym编辑
,原因:
|
|
叠楼活动 | 看雪23岁,生日快乐!送新年礼物啦
祝看雪23岁生日快乐!新的一年,大展宏“兔”! |
|
叠楼活动 | 看雪23岁,生日快乐!送新年礼物啦
祝看雪23岁生日快乐!新的一年,大展宏“兔”! |
|
|
操作理由
RANk
{{ user_info.golds == '' ? 0 : user_info.golds }}
雪币
{{ experience }}
课程经验
{{ score }}
学习收益
{{study_duration_fmt}}
学习时长
基本信息
荣誉称号:
{{ honorary_title }}
能力排名:
No.{{ rank_num }}
等 级:
LV{{ rank_lv-100 }}
活跃值:
在线值:
浏览人数:{{ visits }}
最近活跃:{{ last_active_time }}
注册时间:{{ user_info.create_date_jsonfmt }}
勋章
兑换勋章
证书
证书查询 >
能力值