无敌卡常代码板子

最后更新于 2025-08-03 11:52:51
分类 个人记录
#include<bits/stdc++.h>
#pragma diagnostic error "-std=c++11"
#pragma target("avx")
#pragma optimize(1)
#pragma optimize(2)
#pragma optimize(3)
#pragma optimize("Ofast")
#pragma optimize("inline")
#pragma optimize("-fgcse")
#pragma optimize("-fgcse-lm")
#pragma optimize("-fipa-sra")
#pragma optimize("-ftree-pre")
#pragma optimize("-ftree-vrp")
#pragma optimize("-fpeephole2")
#pragma optimize("-ffast-math")
#pragma optimize("-fsched-spec")
#pragma optimize("unroll-loops")
#pragma optimize("-falign-jumps")
#pragma optimize("-falign-loops")
#pragma optimize("-falign-labels")
#pragma optimize("-fdevirtualize")
#pragma optimize("-fcaller-saves")
#pragma optimize("-fcrossjumping")
#pragma optimize("-fthread-jumps")
#pragma optimize("-funroll-loops")
#pragma optimize("-fwhole-program")
#pragma optimize("-freorder-blocks")
#pragma optimize("-fschedule-insns")
#pragma optimize("inline-functions")
#pragma optimize("-ftree-tail-merge")
#pragma optimize("-fschedule-insns2")
#pragma optimize("-fstrict-aliasing")
#pragma optimize("-fstrict-overflow")
#pragma optimize("-falign-functions")
#pragma optimize("-fcse-skip-blocks")
#pragma optimize("-fcse-follow-jumps")
#pragma optimize("-fsched-interblock")
#pragma optimize("-fpartial-inlining")
#pragma optimize("no-stack-protector")
#pragma optimize("-freorder-functions")
#pragma optimize("-findirect-inlining")
#pragma optimize("-fhoist-adjacent-loads")
#pragma optimize("-frerun-cse-after-loop")
#pragma optimize("inline-small-functions")
#pragma optimize("-finline-small-functions")
#pragma optimize("-ftree-switch-conversion")
#pragma optimize("-foptimize-sibling-calls")
#pragma optimize("-fexpensive-optimizations")
#pragma optimize("-funsafe-loop-optimizations")
#pragma optimize("inline-functions-called-once")
#pragma optimize("-fdelete-null-pointer-checks")
using namespace std;
#define getchar() (p1==p2&&(p2=(p1=buf)+fread(buf,1,1<<21,stdin),p1==p2)?EOF:*p1++)
char buf[1<<23],*p1=buf,*p2=buf,obuf[1<<23],*O=obuf;
inline int read() {
	int x=0,f=1;char ch=getchar();
	while(!isdigit(ch)){if(ch=='-') f=-1;ch=getchar();}
	while(isdigit(ch)) x=x*10+(ch^48),ch=getchar();
	return x*f;
}
namespace QuikIO{
    
    const int size = 1 << 14;
    int p3;
    char out[size];
    
    #define flush() (fwrite(out,1,p3,stdout),p3 = 0)
    #define putchar(ch) (p3 == size && flush(),out[p3++] = ch)
    
    class Flush{public:~Flush(){flush();}}_;
        
    void write(long long x){
        
        if (x > 9) write(x / 10);
        putchar(x % 10 + '0');
        
    }
    
    void print(long long x,char end = '\n'){
        
        write(x);
        putchar(end);
        
    }
    
}using QuikIO::print;
int main(){
    ios::sync_with_stdio(false);
    cin.tie(0),cout.tie(0);
}

如果不是在洛谷,那么可以在optimize前面加上GCC