模板IO

· · 个人记录


#include<bits/stdc++.h>
using namespace std;
namespace IO{
 int len=0;
 char ibuf[(1<<20)+1],*iS,*iT,out[(1<<25)+1];
 #define gh() (iS==iT?iT=(iS=ibuf)+fread(ibuf,1,(1<<20)+1,stdin),(iS==iT?EOF:*iS++):*iS++)
 inline int read(){
  char ch=gh(); int x=0;char t=0;
  while(ch<'0'||ch>'9') t|=ch=='-',ch=gh();
  while(ch>='0'&&ch<='9') x=x*10+(ch^48),ch=gh();
  return t?-x:x;
 }
 inline void putc(char ch){out[len++]=ch;}
 template<class T>
 inline void write(T x){
  if(x<0)putc('-'),x=-x;
  if(x>9)write(x/10);
  out[len++]=x%10+48;
 }
 string getstr(void){
  string s="";
  char c=gh();
  while(c==' '||c=='\n'||c=='\r'||c=='\t'||c==EOF) c = gh();
  while(!(c==' '||c=='\n'||c=='\r'||c=='\t'||c==EOF)) s.push_back(c),c=gh();
  return s;
 }
 void putstr(string str,int begin=0,int end=-1){
  if(end==-1) end=str.size();
  for(int i=begin;i<end;i++) putc(str[i]);
  return;
 }
 inline void flush(){fwrite(out,1,len,stdout);len=0;}
}
using IO::read;
using IO::write;
using IO::flush;
using IO::putc;
using IO::getstr;
using IO::putstr;
signed main(){

 return 0;
}