注意事项
不开 long long 见祖宗!
多测不清空,爆 0 两行泪!
不看数据范围、时间限制见祖宗!
不开 unordered_map 见祖宗!
不关同步流见祖宗!
写 memset 见祖宗!
#include<windows.h>
Sleep(500);
system("cls");
ios::sync_with_stdio(0),cin.tie(0),cout.tie(0);
对齐输出:
setw(x);//场宽为x
随机数:
srand(time(0));
cout<<rand%r+l;注意:求几大子序列:
不下降:可以相等 -> 用 upper_bound (找第一个大于的)
上升:不能相等 -> 用 lower_bound (找第一个大于等于的)
不上升:可以相等 -> 用 lower_bound with greater (找第一个小于的)
下降:不能相等 -> 用 upper_bound with greater (找第一个小于等于的)