快读快写 O3 优化
模板:
code:
1 #include<bits/stdc++.h> 2 #pragma GCC optimize(3) 3 4 using namespace std; 5 6 7 inline int read(){ 8 int x=0,f=1;char ch=getchar(); 9 while(!isdigit(ch)){if(ch=='-')f=-1;ch=getchar();} 10 while(isdigit(ch)){x=(x<<1)+(x<<3)+(ch^48);ch=getchar();} 11 return x*f; 12 } 13 inline void write(int x) 14 { 15 if(x<0)x=-x,putchar('-'); 16 if(x>9)write(x/10); 17 putchar(x%10+'0'); 18 } 19 int main() 20 { 21 22 return 0; 23 }
快读:
1 inline int read(){ 2 int x=0,f=1;char ch=getchar(); 3 while(!isdigit(ch)){if(ch=='-')f=-1;ch=getchar();} 4 while(isdigit(ch)){x=(x<<1)+(x<<3)+(ch^48);ch=getchar();} 5 return x*f; 6 }
快写:
1 inline void write(int x) 2 { 3 if(x<0)x=-x,putchar('-'); 4 if(x>9)write(x/10); 5 putchar(x%10+'0'); 6 }
O3优化:
1 #pragma GCC optimize(3)
当然在NOIP竞赛(现在叫CSP)中不允许使用O3优化