#pragma GCC optimize("Ofast") #pragma GCC target("sse3","sse2","sse") //#pragma GCC target("avx","sse4","sse4.1","sse4.2","ssse3") //#pragma GCC target("f16c") //#pragma GCC target("fma","avx2") //#pragma GCC target("xop","fma4") #pragma GCC optimize("inline","fast-math","unroll-loops","no-stack-protector") #pragma GCC diagnostic error "-fwhole-program" #pragma GCC diagnostic error "-fcse-skip-blocks" #pragma GCC diagnostic error "-funsafe-loop-optimizations" #pragma GCC diagnostic error "-std=c++14"
注释掉的几行是特殊指令集,要视评测机决定是否使用(都用高精模板试一下(不然不一定试的出来),如果评测机不支持,但是开了,就会RE)
没注释掉的那行的特殊指令集应该是比较普遍能用的
加了特殊指令集不一定会变快(可能变慢)
第2-6行中:
xjoi、洛谷可以用前三行
hdu第一行
也许有用(?):
...optimize("-funroll-all-loops") #pragma GCC diagnostic error "-fforce-addr"
奇怪的质数:
1e14级别
360023843327831
100000000000000