读入输出
从文件读入输出
freopen("data.in", "r", stdin);
freopen("data.out", "w", stdout);
快速读入
template<class T>
inline void read(T& num) {
bool start=0, neg=0;
char c;
num=0;
while((c=getchar())!=EOF) {
if(c=='-') start=neg=true;
else if(c>='0' && c<='9') {
start=1;
num=num*10+c-'0';
} else if(start) break;
}
if(neg) num=-num;
}
超级快速读入
const int File_Length=1<<27;
char buf[File_Length],*inf=buf;
int read(){
int k=0;
while(!isdigit(*inf))++inf;
while(isdigit(*inf)){
k=k*10+(*inf-'0');
++inf;
}
return k;
}
int main(){
fread(buf, 1, N, stdin);
*****
return 0;
}
加速 cin
#define endl "\n"
#define IOS_ONLY do{ios_base::sync_with_stdio(false);std::cin.tie(NULL);} while(0)
int main()
{
IOS_ONLY;
}