[混乱]NOIP需要注意的细节

1, 位运算优先级
[外链图片转存失败,源站可能有防盗链机制,建议将图片保存下来直接上传(img-aYzLuPR6-1574849576565)(https://leanote.com/api/file/getImage?fileId=58f6c488ab64415134005ec6)]
2 重载 < 的const
3 exgcd y = x ( a / b ) y -= x*(a/b) ;写成 y = x a / b y -= x*a/b ;
位运算,除法注意括号
4 从0开始的一些习惯问题
5 多组数据时一定要注意,有的数组\变量需要及时清空
6 dcmp
7 %%%,多取% TLE ,少取% WA
8 1LL<<32,常数炸int
9 #define pow2(x) (xx) (LL) pow2(x)
#define f(x) x+x 15
f(x) -> 15*x+x
10 数组大小(MLE,开小),在不MLE时宁大勿小
cout << sizeof(a)/1024/1024
11 ‘\0’ ‘\n’ ‘\r’
12 dfs爆栈
13 l,L r,R,n,m变量名弄混 n,m,m,m,n,n,m,n
14 next数组
15 tp++ s.insert(a[tp])还是s.insert(a[tp]) tp++
16 set无重复元素 muiltset
17 F(t++,t++,t++) 不要鬼畜
18 min,max自己写
19 double输出最好用%f
20 bool cmp(int a,int b) const int &a
int &a

21加错剪枝

倒着做 
meet in mid
/
notepad++
fc
/
运行时间
double t = clock();
cout<<(clock()-t)/1000;
别忘了删ctime
/
t1多检查,能对拍就写写,
题目难度不一定递增

猜你喜欢

转载自blog.csdn.net/qq_33831360/article/details/103280881