反正不会咕咕的。
sort之类没+1的问题不说
双向边n*2的问题不说
变量n+5的问题不说
1.先生成后判断
(见NOIP 2016 pj t2回文日期)
这个思想在这道题体现的不明显,记得洛谷上面有个回文素数的题,如果暴力枚举每个数直接TLE,但是先生成前一b,然后得到该段回文d,可以得到bd(如果这个数位数为奇需要特判断)。
(2019.6.18)Upd:洛谷P1403也是一个很好的先生成再判断的题。
#不上代码
2.爆搜及时跳出
(洛谷P1156)
如果在爆搜不断刷新答案后,时间快T了,完全可以拿你现在的答案赌一把(反正TLE与WA一样不得分)
即使要求具体方案的时候,这样的做法也香!
3.学习算法的时候画流程图
(其实是网上找这种算法的gif,貌似有个网站集了很多)
算法流程只凭脑子的时候早过了,初中前面还好,学到图论稳爆炸。(我们教练曾今讲加边讲了三天(也许是我太菜))
4.WPE三件套
用了之后,真香。
当时教练讲贪心的时候画了个excel表格(貌似是排课),然后一目了然,真香。
据说隔壁生物竞赛(绵中国家队)用Excel 做出了一道场内只有他能写出来的题
5.富贵苟中求
(大部分题)爆搜好打,正解难写,先写爆搜保底(如果爆搜都写不出来你怎么A的题)
然后如果写不了正解的话优化下爆搜吧(我把一个爆搜21分的题改成92)
6.函数封装
(下晚自习了先不更了)