复活。
资源区
快读快输
class istream{
char buf[15000003],*s;
public:
inline istream(){
#ifndef ONLINE_JUDGE
freopen("a.txt","r",stdin);
freopen("b.txt","w",stdout);
#endif
buf[fread(s=buf,1,15000001,stdin)]='\n';
}
template<typename T>
inline void operator>>(T&rhs){
for(rhs=0;!isdigit(*s);++s);
while(isdigit(*s))rhs=rhs*10+(*s++&15);
}
}in;
struct ostream{
char buf[15000005],*s;
inline ostream(){s=buf;}
inline void operator<<(long long d){
if(!d){
*s++='0';
}else{
static long long w;
for(w=1;w<=d;w*=10);
for(;w/=10;d%=w)*s++=d/w^'0';
}
*s++='\n';
}
inline ostream&operator<<(const char&c){*s++=c;return*this;}
inline~ostream(){fwrite(buf,1,s-buf,stdout);}
}out;