首页 > TAG信息列表 > 快输
快读,快输
快读 #define gc getchar inline ll read(){ ll a=0;int f=0;char p=gc(); while(!isdigit(p)){f|=p=='-';p=gc();} while(isdigit(p)){a=(a<<3)+(a<<1)+(p^48);p=gc();} return f?-a:a; } 快输 inline void write(int n)快读快输模板
1 #include "bits/stdc++.h" 2 using namespace std; 3 typedef long long ll; 4 inline ll read()//内联函数可以节省调用的开销,而且能够便于编译器和上下文配合做优化 5 { 6 ll s = 0,w = 1; 7 char ch = getchar(); 8 while(ch < '0' || ch > '9'c++ 快读快输模板
快读 inline int read(){ int X=0; bool flag=1; char ch=getchar(); while(ch<'0'||ch>'9') {if(ch=='-') flag=0; ch=getchar();} while(ch>='0'&&ch<='9') {X=(X<<1)+(X<<3)+c快读,快输板子
template<class T>void read(T &res){ res = 0; char c = getchar(); T f = 1; while(c < '0' || c > '9') { if(c == '-') f = -1; c = getchar(); } while(c >= '0' &&